@@ -10,20 +10,10 @@ describe('FT.HYBRID', () => {
1010 HYBRID . parseCommand ( parser , 'index' ) ;
1111 assert . deepEqual (
1212 parser . redisArgs ,
13- [ 'FT.HYBRID' , 'index' , '2' , 'DIALECT' , '2' ]
13+ [ 'FT.HYBRID' , 'index' ]
1414 ) ;
1515 } ) ;
1616
17- it ( 'with count expressions' , ( ) => {
18- const parser = new BasicCommandParser ( ) ;
19- HYBRID . parseCommand ( parser , 'index' , {
20- countExpressions : 3
21- } ) ;
22- assert . deepEqual (
23- parser . redisArgs ,
24- [ 'FT.HYBRID' , 'index' , '3' , 'DIALECT' , '2' ]
25- ) ;
26- } ) ;
2717
2818 it ( 'with SEARCH expression' , ( ) => {
2919 const parser = new BasicCommandParser ( ) ;
@@ -34,7 +24,7 @@ describe('FT.HYBRID', () => {
3424 } ) ;
3525 assert . deepEqual (
3626 parser . redisArgs ,
37- [ 'FT.HYBRID' , 'index' , '2' , ' SEARCH', '@description: bikes' , 'DIALECT' , '2 ']
27+ [ 'FT.HYBRID' , 'index' , 'SEARCH' , '@description: bikes' ]
3828 ) ;
3929 } ) ;
4030
@@ -53,9 +43,9 @@ describe('FT.HYBRID', () => {
5343 assert . deepEqual (
5444 parser . redisArgs ,
5545 [
56- 'FT.HYBRID' , 'index' , '2' , ' SEARCH', '@description: bikes' ,
46+ 'FT.HYBRID' , 'index' , 'SEARCH' , '@description: bikes' ,
5747 'SCORER' , 'TFIDF.DOCNORM' , 'param1' , 'param2' ,
58- 'YIELD_SCORE_AS' , 'search_score' , 'DIALECT' , '2'
48+ 'YIELD_SCORE_AS' , 'search_score'
5949 ]
6050 ) ;
6151 } ) ;
@@ -78,7 +68,7 @@ describe('FT.HYBRID', () => {
7868 assert . deepEqual (
7969 parser . redisArgs ,
8070 [
81- 'FT.HYBRID' , 'index' , '2' , ' VSIM', '@vector_field' , 'BLOB_DATA' ,
71+ 'FT.HYBRID' , 'index' , 'VSIM' , '@vector_field' , 'BLOB_DATA' ,
8272 'KNN' , '1' , 'K' , '10' , 'EF_RUNTIME' , '50' , 'YIELD_DISTANCE_AS' , 'vector_dist' ,
8373 'DIALECT' , '2'
8474 ]
@@ -103,7 +93,7 @@ describe('FT.HYBRID', () => {
10393 assert . deepEqual (
10494 parser . redisArgs ,
10595 [
106- 'FT.HYBRID' , 'index' , '2' , ' VSIM', '@vector_field' , 'BLOB_DATA' ,
96+ 'FT.HYBRID' , 'index' , 'VSIM' , '@vector_field' , 'BLOB_DATA' ,
10797 'RANGE' , '1' , 'RADIUS' , '0.5' , 'EPSILON' , '0.01' , 'YIELD_DISTANCE_AS' , 'vector_dist' ,
10898 'DIALECT' , '2'
10999 ]
@@ -129,9 +119,9 @@ describe('FT.HYBRID', () => {
129119 assert . deepEqual (
130120 parser . redisArgs ,
131121 [
132- 'FT.HYBRID' , 'index' , '2' , ' VSIM', '@vector_field' , 'BLOB_DATA' ,
122+ 'FT.HYBRID' , 'index' , 'VSIM' , '@vector_field' , 'BLOB_DATA' ,
133123 'FILTER' , '@category:{bikes}' , 'POLICY' , 'BATCHES' , 'BATCHES' , 'BATCH_SIZE' , '100' ,
134- 'YIELD_SCORE_AS' , 'vsim_score' , 'DIALECT' , '2'
124+ 'YIELD_SCORE_AS' , 'vsim_score'
135125 ]
136126 ) ;
137127 } ) ;
@@ -153,8 +143,8 @@ describe('FT.HYBRID', () => {
153143 assert . deepEqual (
154144 parser . redisArgs ,
155145 [
156- 'FT.HYBRID' , 'index' , '2' , ' COMBINE', 'RRF' , '2' , 'WINDOW' , '10' , 'CONSTANT' , '60' ,
157- 'YIELD_SCORE_AS' , 'combined_score' , 'DIALECT' , '2'
146+ 'FT.HYBRID' , 'index' , 'COMBINE' , 'RRF' , '2' , 'WINDOW' , '10' , 'CONSTANT' , '60' ,
147+ 'YIELD_SCORE_AS' , 'combined_score'
158148 ]
159149 ) ;
160150 } ) ;
@@ -175,8 +165,7 @@ describe('FT.HYBRID', () => {
175165 assert . deepEqual (
176166 parser . redisArgs ,
177167 [
178- 'FT.HYBRID' , 'index' , '2' , 'COMBINE' , 'LINEAR' , '2' , 'ALPHA' , '0.7' , 'BETA' , '0.3' ,
179- 'DIALECT' , '2'
168+ 'FT.HYBRID' , 'index' , 'COMBINE' , 'LINEAR' , '2' , 'ALPHA' , '0.7' , 'BETA' , '0.3'
180169 ]
181170 ) ;
182171 } ) ;
@@ -199,8 +188,8 @@ describe('FT.HYBRID', () => {
199188 assert . deepEqual (
200189 parser . redisArgs ,
201190 [
202- 'FT.HYBRID' , 'index' , '2' , ' LOAD', '2' , 'field1' , 'field2' ,
203- 'SORTBY' , '1' , 'score' , 'DESC' , 'LIMIT' , '0' , '10' , 'DIALECT' , '2'
191+ 'FT.HYBRID' , 'index' , 'LOAD' , '2' , 'field1' , 'field2' ,
192+ 'SORTBY' , '1' , 'score' , 'DESC' , 'LIMIT' , '0' , '10'
204193 ]
205194 ) ;
206195 } ) ;
@@ -220,8 +209,7 @@ describe('FT.HYBRID', () => {
220209 assert . deepEqual (
221210 parser . redisArgs ,
222211 [
223- 'FT.HYBRID' , 'index' , '2' , 'GROUPBY' , '1' , '@category' , 'REDUCE' , 'COUNT' , '0' ,
224- 'DIALECT' , '2'
212+ 'FT.HYBRID' , 'index' , 'GROUPBY' , '1' , '@category' , 'REDUCE' , 'COUNT' , '0'
225213 ]
226214 ) ;
227215 } ) ;
@@ -236,7 +224,7 @@ describe('FT.HYBRID', () => {
236224 } ) ;
237225 assert . deepEqual (
238226 parser . redisArgs ,
239- [ 'FT.HYBRID' , 'index' , '2' , ' APPLY', '@score * 2' , 'AS' , 'double_score' , 'DIALECT' , '2 ']
227+ [ 'FT.HYBRID' , 'index' , 'APPLY' , '@score * 2' , 'AS' , 'double_score' ]
240228 ) ;
241229 } ) ;
242230
@@ -247,7 +235,7 @@ describe('FT.HYBRID', () => {
247235 } ) ;
248236 assert . deepEqual (
249237 parser . redisArgs ,
250- [ 'FT.HYBRID' , 'index' , '2' , ' FILTER', '@price:[100 500]' , 'DIALECT' , '2 ']
238+ [ 'FT.HYBRID' , 'index' , 'FILTER' , '@price:[100 500]' ]
251239 ) ;
252240 } ) ;
253241
@@ -262,8 +250,7 @@ describe('FT.HYBRID', () => {
262250 assert . deepEqual (
263251 parser . redisArgs ,
264252 [
265- 'FT.HYBRID' , 'index' , '2' , 'PARAMS' , '4' , 'query_vector' , 'BLOB_DATA' , 'min_price' , '100' ,
266- 'DIALECT' , '2'
253+ 'FT.HYBRID' , 'index' , 'PARAMS' , '4' , 'query_vector' , 'BLOB_DATA' , 'min_price' , '100'
267254 ]
268255 ) ;
269256 } ) ;
@@ -276,7 +263,7 @@ describe('FT.HYBRID', () => {
276263 } ) ;
277264 assert . deepEqual (
278265 parser . redisArgs ,
279- [ 'FT.HYBRID' , 'index' , '2' , ' EXPLAINSCORE', 'TIMEOUT' , '5000' , 'DIALECT' , '2 ']
266+ [ 'FT.HYBRID' , 'index' , 'EXPLAINSCORE' , 'TIMEOUT' , '5000' ]
280267 ) ;
281268 } ) ;
282269
@@ -291,16 +278,14 @@ describe('FT.HYBRID', () => {
291278 assert . deepEqual (
292279 parser . redisArgs ,
293280 [
294- 'FT.HYBRID' , 'index' , '2' , 'WITHCURSOR' , 'COUNT' , '100' , 'MAXIDLE' , '300000' ,
295- 'DIALECT' , '2'
281+ 'FT.HYBRID' , 'index' , 'WITHCURSOR' , 'COUNT' , '100' , 'MAXIDLE' , '300000'
296282 ]
297283 ) ;
298284 } ) ;
299285
300286 it ( 'complete example with all options' , ( ) => {
301287 const parser = new BasicCommandParser ( ) ;
302288 HYBRID . parseCommand ( parser , 'index' , {
303- countExpressions : 2 ,
304289 SEARCH : {
305290 query : '@description: bikes' ,
306291 SCORER : {
@@ -343,29 +328,17 @@ describe('FT.HYBRID', () => {
343328 assert . deepEqual (
344329 parser . redisArgs ,
345330 [
346- 'FT.HYBRID' , 'index' , '2' ,
331+ 'FT.HYBRID' , 'index' ,
347332 'SEARCH' , '@description: bikes' , 'SCORER' , 'TFIDF.DOCNORM' , 'YIELD_SCORE_AS' , 'text_score' ,
348333 'VSIM' , '@vector_field' , '$query_vector' , 'KNN' , '1' , 'K' , '5' , 'YIELD_SCORE_AS' , 'vector_score' ,
349334 'COMBINE' , 'RRF' , '2' , 'CONSTANT' , '60' , 'YIELD_SCORE_AS' , 'final_score' ,
350335 'LOAD' , '2' , 'description' , 'price' ,
351336 'SORTBY' , '1' , 'final_score' , 'DESC' ,
352337 'LIMIT' , '0' , '10' ,
353- 'PARAMS' , '2' , 'query_vector' , 'BLOB_DATA' ,
354- 'DIALECT' , '2'
338+ 'PARAMS' , '2' , 'query_vector' , 'BLOB_DATA'
355339 ]
356340 ) ;
357341 } ) ;
358-
359- it ( 'with custom DIALECT' , ( ) => {
360- const parser = new BasicCommandParser ( ) ;
361- HYBRID . parseCommand ( parser , 'index' , {
362- DIALECT : 3
363- } ) ;
364- assert . deepEqual (
365- parser . redisArgs ,
366- [ 'FT.HYBRID' , 'index' , '2' , 'DIALECT' , '3' ]
367- ) ;
368- } ) ;
369342 } ) ;
370343
371344 // Integration tests would need to be added when RediSearch supports FT.HYBRID
0 commit comments