-
Notifications
You must be signed in to change notification settings - Fork 996
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
1,769 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
src/main/java/io/lettuce/core/RediSearchCommandBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* Copyright 2025, Redis Ltd. and Contributors | ||
* All rights reserved. | ||
* | ||
* Licensed under the MIT License. | ||
*/ | ||
package io.lettuce.core; | ||
|
||
import io.lettuce.core.codec.RedisCodec; | ||
import io.lettuce.core.output.StatusOutput; | ||
import io.lettuce.core.protocol.BaseRedisCommandBuilder; | ||
import io.lettuce.core.protocol.Command; | ||
import io.lettuce.core.protocol.CommandArgs; | ||
import io.lettuce.core.protocol.CommandKeyword; | ||
import io.lettuce.core.search.Fields; | ||
import io.lettuce.core.search.arguments.CreateArgs; | ||
import io.lettuce.core.search.Field; | ||
|
||
import static io.lettuce.core.protocol.CommandType.*; | ||
|
||
/** | ||
* Command builder for RediSearch commands. | ||
* | ||
* @param <K> Key type. | ||
* @param <V> Value type. | ||
* @since 6.6 | ||
*/ | ||
class RediSearchCommandBuilder<K, V> extends BaseRedisCommandBuilder<K, V> { | ||
|
||
RediSearchCommandBuilder(RedisCodec<K, V> codec) { | ||
super(codec); | ||
} | ||
|
||
/** | ||
* Create a new index with the given name, index options and fields. | ||
* | ||
* @param index the index name | ||
* @param createArgs the index options | ||
* @param fields the fields | ||
* @return the result of the create command | ||
*/ | ||
public Command<K, V, String> ftCreate(K index, CreateArgs<K, V> createArgs, Fields<K> fields) { | ||
notNullKey(index); | ||
notEmpty(fields.getFields().toArray()); | ||
|
||
CommandArgs<K, V> args = new CommandArgs<>(codec).addKey(index); | ||
|
||
if (createArgs != null) { | ||
createArgs.build(args); | ||
} | ||
|
||
args.add(CommandKeyword.SCHEMA); | ||
|
||
for (Field<K> field : fields.getFields()) { | ||
field.build(args); | ||
} | ||
|
||
return createCommand(FT_CREATE, new StatusOutput<>(codec), args); | ||
|
||
} | ||
|
||
} |
35 changes: 35 additions & 0 deletions
35
src/main/java/io/lettuce/core/api/async/RediSearchAsyncCommands.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright 2025, Redis Ltd. and Contributors | ||
* All rights reserved. | ||
* | ||
* Licensed under the MIT License. | ||
*/ | ||
package io.lettuce.core.api.async; | ||
|
||
import io.lettuce.core.RedisFuture; | ||
import io.lettuce.core.search.Fields; | ||
import io.lettuce.core.search.arguments.CreateArgs; | ||
|
||
/** | ||
* Asynchronous executed commands for RediSearch functionality | ||
* | ||
* @param <K> Key type. | ||
* @param <V> Value type. | ||
* @author Tihomir Mateev | ||
* @see <a href="https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/search/">RediSearch</a> | ||
* @since 6.6 | ||
* @generated by io.lettuce.apigenerator.CreateAsyncApi | ||
*/ | ||
public interface RediSearchAsyncCommands<K, V> { | ||
|
||
/** | ||
* Create a new index with the given name, index options and fields. | ||
* | ||
* @param index the index name | ||
* @param options the index options | ||
* @param fields the fields | ||
* @return the result of the create command | ||
*/ | ||
RedisFuture<String> ftCreate(K index, CreateArgs<K, V> options, Fields<K> fields); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
src/main/java/io/lettuce/core/api/reactive/RediSearchReactiveCommands.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright 2025, Redis Ltd. and Contributors | ||
* All rights reserved. | ||
* | ||
* Licensed under the MIT License. | ||
*/ | ||
package io.lettuce.core.api.reactive; | ||
|
||
import io.lettuce.core.search.Field; | ||
import io.lettuce.core.search.Fields; | ||
import io.lettuce.core.search.arguments.CreateArgs; | ||
import reactor.core.publisher.Mono; | ||
|
||
/** | ||
* Reactive executed commands for RediSearch functionality | ||
* | ||
* @param <K> Key type. | ||
* @param <V> Value type. | ||
* @author Tihomir Mateev | ||
* @see <a href="https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/search/">RediSearch</a> | ||
* @since 6.6 | ||
* @generated by io.lettuce.apigenerator.CreateReactiveApi | ||
*/ | ||
public interface RediSearchReactiveCommands<K, V> { | ||
|
||
/** | ||
* Create a new index with the given name, index options and fields. | ||
* | ||
* @param index the index name | ||
* @param options the index options | ||
* @param fields the fields | ||
* @return the result of the create command | ||
*/ | ||
Mono<String> ftCreate(K index, CreateArgs<K, V> options, Fields<K> fields); | ||
|
||
} |
34 changes: 34 additions & 0 deletions
34
src/main/java/io/lettuce/core/api/sync/RediSearchCommands.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright 2025, Redis Ltd. and Contributors | ||
* All rights reserved. | ||
* | ||
* Licensed under the MIT License. | ||
*/ | ||
package io.lettuce.core.api.sync; | ||
|
||
import io.lettuce.core.search.Fields; | ||
import io.lettuce.core.search.arguments.CreateArgs; | ||
|
||
/** | ||
* Synchronous executed commands for RediSearch functionality | ||
* | ||
* @param <K> Key type. | ||
* @param <V> Value type. | ||
* @author Tihomir Mateev | ||
* @see <a href="https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/search/">RediSearch</a> | ||
* @since 6.6 | ||
* @generated by io.lettuce.apigenerator.CreateSyncApi | ||
*/ | ||
public interface RediSearchCommands<K, V> { | ||
|
||
/** | ||
* Create a new index with the given name, index options and fields. | ||
* | ||
* @param index the index name | ||
* @param options the index options | ||
* @param fields the fields | ||
* @return the result of the create command | ||
*/ | ||
String ftCreate(K index, CreateArgs<K, V> options, Fields<K> fields); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/main/java/io/lettuce/core/cluster/api/async/RediSearchAsyncCommands.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright 2025, Redis Ltd. and Contributors | ||
* All rights reserved. | ||
* | ||
* Licensed under the MIT License. | ||
*/ | ||
package io.lettuce.core.cluster.api.async; | ||
|
||
import io.lettuce.core.search.Fields; | ||
import io.lettuce.core.search.arguments.CreateArgs; | ||
|
||
/** | ||
* Asynchronous executed commands on a node selection for RediSearch functionality | ||
* | ||
* @param <K> Key type. | ||
* @param <V> Value type. | ||
* @author Tihomir Mateev | ||
* @see <a href="https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/search/">RediSearch</a> | ||
* @since 6.6 | ||
* @generated by io.lettuce.apigenerator.CreateAsyncNodeSelectionClusterApi | ||
*/ | ||
public interface RediSearchAsyncCommands<K, V> { | ||
|
||
/** | ||
* Create a new index with the given name, index options and fields. | ||
* | ||
* @param index the index name | ||
* @param options the index options | ||
* @param fields the fields | ||
* @return the result of the create command | ||
*/ | ||
AsyncExecutions<String> ftCreate(K index, CreateArgs<K, V> options, Fields<K> fields); | ||
|
||
} |
35 changes: 35 additions & 0 deletions
35
src/main/java/io/lettuce/core/cluster/api/sync/RediSearchCommands.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright 2025, Redis Ltd. and Contributors | ||
* All rights reserved. | ||
* | ||
* Licensed under the MIT License. | ||
*/ | ||
package io.lettuce.core.cluster.api.sync; | ||
|
||
import io.lettuce.core.search.Field; | ||
import io.lettuce.core.search.Fields; | ||
import io.lettuce.core.search.arguments.CreateArgs; | ||
|
||
/** | ||
* Synchronous executed commands on a node selection for RediSearch functionality | ||
* | ||
* @param <K> Key type. | ||
* @param <V> Value type. | ||
* @author Tihomir Mateev | ||
* @see <a href="https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/search/">RediSearch</a> | ||
* @since 6.6 | ||
* @generated by io.lettuce.apigenerator.CreateSyncNodeSelectionClusterApi | ||
*/ | ||
public interface RediSearchCommands<K, V> { | ||
|
||
/** | ||
* Create a new index with the given name, index options and fields. | ||
* | ||
* @param index the index name | ||
* @param options the index options | ||
* @param fields the fields | ||
* @return the result of the create command | ||
*/ | ||
Executions<String> ftCreate(K index, CreateArgs<K, V> options, Fields<K> fields); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.