49
49
import io .lettuce .core .protocol .RedisCommand ;
50
50
import io .lettuce .core .protocol .TracedCommand ;
51
51
import 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 ;
52
58
import io .lettuce .core .tracing .TraceContext ;
53
59
import io .lettuce .core .tracing .TraceContextProvider ;
54
60
import io .lettuce .core .tracing .Tracing ;
86
92
* @author Tihomir Mateev
87
93
* @since 4.0
88
94
*/
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 > {
95
102
96
103
private final StatefulConnection <K , V > connection ;
97
104
98
105
private final RedisCommandBuilder <K , V > commandBuilder ;
99
106
100
107
private final RedisJsonCommandBuilder <K , V > jsonCommandBuilder ;
101
108
109
+ private final RediSearchCommandBuilder <K , V > searchCommandBuilder ;
110
+
102
111
private final RedisVectorSetCommandBuilder <K , V > vectorSetCommandBuilder ;
103
112
104
113
private final Supplier <JsonParser > parser ;
@@ -123,6 +132,7 @@ public AbstractRedisReactiveCommands(StatefulConnection<K, V> connection, RedisC
123
132
this .commandBuilder = new RedisCommandBuilder <>(codec );
124
133
this .jsonCommandBuilder = new RedisJsonCommandBuilder <>(codec , parser );
125
134
this .vectorSetCommandBuilder = new RedisVectorSetCommandBuilder <>(codec , parser );
135
+ this .searchCommandBuilder = new RediSearchCommandBuilder <>(codec );
126
136
this .clientResources = connection .getResources ();
127
137
this .tracingEnabled = clientResources .tracing ().isEnabled ();
128
138
}
@@ -1604,6 +1614,61 @@ public boolean isOpen() {
1604
1614
return connection .isOpen ();
1605
1615
}
1606
1616
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
+
1607
1672
@ Override
1608
1673
public Flux <Long > jsonArrappend (K key , JsonPath jsonPath , JsonValue ... values ) {
1609
1674
return createDissolvingFlux (() -> jsonCommandBuilder .jsonArrappend (key , jsonPath , values ));
0 commit comments