forked from redis/lettuce
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…edis#3160)" This reverts commit 319e315.
- Loading branch information
Showing
23 changed files
with
1,764 additions
and
17 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
63 changes: 63 additions & 0 deletions
63
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,63 @@ | ||
/* | ||
* 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.arguments.CreateArgs; | ||
import io.lettuce.core.search.Field; | ||
|
||
import java.util.List; | ||
|
||
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, List<Field<K>> fields) { | ||
notNullKey(index); | ||
notEmpty(fields.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) { | ||
field.build(args); | ||
} | ||
|
||
return createCommand(FT_CREATE, new StatusOutput<>(codec), args); | ||
|
||
} | ||
|
||
} |
38 changes: 38 additions & 0 deletions
38
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,38 @@ | ||
/* | ||
* Copyright 2025, Redis Ltd. and Contributors | ||
* All rights reserved. | ||
* | ||
* Licensed under the MIT License. | ||
*/ | ||
package io.lettuce.core.api.async; | ||
|
||
import java.util.List; | ||
import io.lettuce.core.RedisFuture; | ||
import io.lettuce.core.search.Field; | ||
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, as a key | ||
* @param options the index {@link CreateArgs} | ||
* @param fields the {@link Field}s of the index | ||
* @return the result of the create command | ||
* @since 6.6 | ||
* @see <a href="https://redis.io/docs/latest/commands/ft.create/">FT.CREATE</a> | ||
*/ | ||
RedisFuture<String> ftCreate(K index, CreateArgs<K, V> options, List<Field<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
38 changes: 38 additions & 0 deletions
38
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,38 @@ | ||
/* | ||
* Copyright 2025, Redis Ltd. and Contributors | ||
* All rights reserved. | ||
* | ||
* Licensed under the MIT License. | ||
*/ | ||
package io.lettuce.core.api.reactive; | ||
|
||
import java.util.List; | ||
import io.lettuce.core.search.Field; | ||
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, as a key | ||
* @param options the index {@link CreateArgs} | ||
* @param fields the {@link Field}s of the index | ||
* @return the result of the create command | ||
* @since 6.6 | ||
* @see <a href="https://redis.io/docs/latest/commands/ft.create/">FT.CREATE</a> | ||
*/ | ||
Mono<String> ftCreate(K index, CreateArgs<K, V> options, List<Field<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
37 changes: 37 additions & 0 deletions
37
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,37 @@ | ||
/* | ||
* Copyright 2025, Redis Ltd. and Contributors | ||
* All rights reserved. | ||
* | ||
* Licensed under the MIT License. | ||
*/ | ||
package io.lettuce.core.api.sync; | ||
|
||
import java.util.List; | ||
import io.lettuce.core.search.Field; | ||
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, as a key | ||
* @param options the index {@link CreateArgs} | ||
* @param fields the {@link Field}s of the index | ||
* @return the result of the create command | ||
* @since 6.6 | ||
* @see <a href="https://redis.io/docs/latest/commands/ft.create/">FT.CREATE</a> | ||
*/ | ||
String ftCreate(K index, CreateArgs<K, V> options, List<Field<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
37 changes: 37 additions & 0 deletions
37
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,37 @@ | ||
/* | ||
* Copyright 2025, Redis Ltd. and Contributors | ||
* All rights reserved. | ||
* | ||
* Licensed under the MIT License. | ||
*/ | ||
package io.lettuce.core.cluster.api.async; | ||
|
||
import java.util.List; | ||
import io.lettuce.core.search.Field; | ||
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, as a key | ||
* @param options the index {@link CreateArgs} | ||
* @param fields the {@link Field}s of the index | ||
* @return the result of the create command | ||
* @since 6.6 | ||
* @see <a href="https://redis.io/docs/latest/commands/ft.create/">FT.CREATE</a> | ||
*/ | ||
AsyncExecutions<String> ftCreate(K index, CreateArgs<K, V> options, List<Field<K>> fields); | ||
|
||
} |
37 changes: 37 additions & 0 deletions
37
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,37 @@ | ||
/* | ||
* Copyright 2025, Redis Ltd. and Contributors | ||
* All rights reserved. | ||
* | ||
* Licensed under the MIT License. | ||
*/ | ||
package io.lettuce.core.cluster.api.sync; | ||
|
||
import java.util.List; | ||
import io.lettuce.core.search.Field; | ||
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, as a key | ||
* @param options the index {@link CreateArgs} | ||
* @param fields the {@link Field}s of the index | ||
* @return the result of the create command | ||
* @since 6.6 | ||
* @see <a href="https://redis.io/docs/latest/commands/ft.create/">FT.CREATE</a> | ||
*/ | ||
Executions<String> ftCreate(K index, CreateArgs<K, V> options, List<Field<K>> fields); | ||
|
||
} |
Oops, something went wrong.