4949import io .lettuce .core .protocol .RedisCommand ;
5050import io .lettuce .core .protocol .TracedCommand ;
5151import io .lettuce .core .resource .ClientResources ;
52+ import io .lettuce .core .search .AggregationReply ;
53+ import io .lettuce .core .search .SearchReply ;
54+ import io .lettuce .core .search .arguments .AggregateArgs ;
55+ import io .lettuce .core .search .arguments .CreateArgs ;
56+ import io .lettuce .core .search .arguments .FieldArgs ;
57+ import io .lettuce .core .search .arguments .SearchArgs ;
5258import io .lettuce .core .tracing .TraceContext ;
5359import io .lettuce .core .tracing .TraceContextProvider ;
5460import io .lettuce .core .tracing .Tracing ;
8692 * @author Tihomir Mateev
8793 * @since 4.0
8894 */
89- public abstract class AbstractRedisReactiveCommands <K , V > implements RedisAclReactiveCommands <K , V >,
90- RedisHashReactiveCommands <K , V >, RedisKeyReactiveCommands <K , V >, RedisStringReactiveCommands <K , V >,
91- RedisListReactiveCommands <K , V >, RedisSetReactiveCommands <K , V >, RedisSortedSetReactiveCommands <K , V >,
92- RedisScriptingReactiveCommands <K , V >, RedisServerReactiveCommands <K , V >, RedisHLLReactiveCommands <K , V >,
93- BaseRedisReactiveCommands <K , V >, RedisTransactionalReactiveCommands <K , V >, RedisGeoReactiveCommands <K , V >,
94- RedisClusterReactiveCommands <K , V >, RedisJsonReactiveCommands <K , V >, RedisVectorSetReactiveCommands <K , V > {
95+ public abstract class AbstractRedisReactiveCommands <K , V >
96+ implements RedisAclReactiveCommands <K , V >, RedisHashReactiveCommands <K , V >, RedisKeyReactiveCommands <K , V >,
97+ RedisStringReactiveCommands <K , V >, RedisListReactiveCommands <K , V >, RedisSetReactiveCommands <K , V >,
98+ RedisSortedSetReactiveCommands <K , V >, RedisScriptingReactiveCommands <K , V >, RedisServerReactiveCommands <K , V >,
99+ RedisHLLReactiveCommands <K , V >, BaseRedisReactiveCommands <K , V >, RedisTransactionalReactiveCommands <K , V >,
100+ RedisGeoReactiveCommands <K , V >, RedisClusterReactiveCommands <K , V >, RedisJsonReactiveCommands <K , V >,
101+ RedisVectorSetReactiveCommands <K , V >, RediSearchReactiveCommands <K , V > {
95102
96103 private final StatefulConnection <K , V > connection ;
97104
98105 private final RedisCommandBuilder <K , V > commandBuilder ;
99106
100107 private final RedisJsonCommandBuilder <K , V > jsonCommandBuilder ;
101108
109+ private final RediSearchCommandBuilder <K , V > searchCommandBuilder ;
110+
102111 private final RedisVectorSetCommandBuilder <K , V > vectorSetCommandBuilder ;
103112
104113 private final Supplier <JsonParser > parser ;
@@ -123,6 +132,7 @@ public AbstractRedisReactiveCommands(StatefulConnection<K, V> connection, RedisC
123132 this .commandBuilder = new RedisCommandBuilder <>(codec );
124133 this .jsonCommandBuilder = new RedisJsonCommandBuilder <>(codec , parser );
125134 this .vectorSetCommandBuilder = new RedisVectorSetCommandBuilder <>(codec , parser );
135+ this .searchCommandBuilder = new RediSearchCommandBuilder <>(codec );
126136 this .clientResources = connection .getResources ();
127137 this .tracingEnabled = clientResources .tracing ().isEnabled ();
128138 }
@@ -1604,6 +1614,61 @@ public boolean isOpen() {
16041614 return connection .isOpen ();
16051615 }
16061616
1617+ @ Override
1618+ public Mono <String > ftCreate (K index , CreateArgs <K , V > options , List <FieldArgs <K >> fieldArgs ) {
1619+ return createMono (() -> searchCommandBuilder .ftCreate (index , options , fieldArgs ));
1620+ }
1621+
1622+ @ Override
1623+ public Mono <String > ftCreate (K index , List <FieldArgs <K >> fieldArgs ) {
1624+ return createMono (() -> searchCommandBuilder .ftCreate (index , null , fieldArgs ));
1625+ }
1626+
1627+ @ Override
1628+ public Mono <String > ftCursordel (K index , long cursorId ) {
1629+ return createMono (() -> searchCommandBuilder .ftCursordel (index , cursorId ));
1630+ }
1631+
1632+ @ Override
1633+ public Mono <String > ftDropindex (K index , boolean deleteDocumentKeys ) {
1634+ return createMono (() -> searchCommandBuilder .ftDropindex (index , deleteDocumentKeys ));
1635+ }
1636+
1637+ @ Override
1638+ public Mono <String > ftDropindex (K index ) {
1639+ return createMono (() -> searchCommandBuilder .ftDropindex (index , false ));
1640+ }
1641+
1642+ @ Override
1643+ public Mono <SearchReply <K , V >> ftSearch (K index , V query , SearchArgs <K , V > args ) {
1644+ return createMono (() -> searchCommandBuilder .ftSearch (index , query , args ));
1645+ }
1646+
1647+ @ Override
1648+ public Mono <SearchReply <K , V >> ftSearch (K index , V query ) {
1649+ return createMono (() -> searchCommandBuilder .ftSearch (index , query , SearchArgs .<K , V > builder ().build ()));
1650+ }
1651+
1652+ @ Override
1653+ public Mono <AggregationReply <K , V >> ftAggregate (K index , V query , AggregateArgs <K , V > args ) {
1654+ return createMono (() -> searchCommandBuilder .ftAggregate (index , query , args ));
1655+ }
1656+
1657+ @ Override
1658+ public Mono <AggregationReply <K , V >> ftAggregate (K index , V query ) {
1659+ return createMono (() -> searchCommandBuilder .ftAggregate (index , query , null ));
1660+ }
1661+
1662+ @ Override
1663+ public Mono <AggregationReply <K , V >> ftCursorread (K index , long cursorId , int count ) {
1664+ return createMono (() -> searchCommandBuilder .ftCursorread (index , cursorId , count ));
1665+ }
1666+
1667+ @ Override
1668+ public Mono <AggregationReply <K , V >> ftCursorread (K index , long cursorId ) {
1669+ return createMono (() -> searchCommandBuilder .ftCursorread (index , cursorId , -1 ));
1670+ }
1671+
16071672 @ Override
16081673 public Flux <Long > jsonArrappend (K key , JsonPath jsonPath , JsonValue ... values ) {
16091674 return createDissolvingFlux (() -> jsonCommandBuilder .jsonArrappend (key , jsonPath , values ));
0 commit comments