@@ -80,11 +80,71 @@ GROUP BY VectorDistance(root["VectorFloatField"], [2, 3, 4], false) ]]></SqlQuer
80
80
<Result >
81
81
<Input >
82
82
<Description ><![CDATA[ Float VectorDistance with non null fourth option]]> </Description >
83
- <Expression ><![CDATA[ query.Select(doc => doc.VectorFloatField.VectorDistance(new [] {2, 3, 4}, True, new VectorDistanceOptions() {DistanceFunction = Cosine, DataType = Float32, SearchListSizeMultiplier = 10 }))]]> </Expression >
83
+ <Expression ><![CDATA[ query.Select(doc => doc.VectorFloatField.VectorDistance(new [] {2, 3, 4}, True, new VectorDistanceOptions() {DistanceFunction = Convert( Cosine, Nullable`1), DataType = Convert( Float32, Nullable`1), SearchListSizeMultiplier = Convert(20, Nullable`1) }))]]> </Expression >
84
84
</Input >
85
85
<Output >
86
86
<SqlQuery ><![CDATA[
87
- SELECT VALUE VectorDistance(root["VectorFloatField"], [2, 3, 4], true, {"distanceFunction": "Cosine", "dataType": "Float32", "searchListSizeMultiplier": 10})
87
+ SELECT VALUE VectorDistance(root["VectorFloatField"], [2, 3, 4], true, {"distanceFunction": "cosine", "dataType": "float32", "searchListSizeMultiplier": 20})
88
+ FROM root]]> </SqlQuery >
89
+ <Results ><![CDATA[ [
90
+ 0.9925833339709302,
91
+ 0.9925833339709302
92
+ ]]]> </Results >
93
+ </Output >
94
+ </Result >
95
+ <Result >
96
+ <Input >
97
+ <Description ><![CDATA[ Float VectorDistance with non null fourth option with default SearchListSizeMultiplier]]> </Description >
98
+ <Expression ><![CDATA[ query.Select(doc => doc.VectorFloatField.VectorDistance(new [] {2, 3, 4}, True, new VectorDistanceOptions() {DistanceFunction = Convert(Cosine, Nullable`1), DataType = Convert(Float32, Nullable`1)}))]]> </Expression >
99
+ </Input >
100
+ <Output >
101
+ <SqlQuery ><![CDATA[
102
+ SELECT VALUE VectorDistance(root["VectorFloatField"], [2, 3, 4], true, {"distanceFunction": "cosine", "dataType": "float32"})
103
+ FROM root]]> </SqlQuery >
104
+ <Results ><![CDATA[ [
105
+ 0.9925833339709302,
106
+ 0.9925833339709302
107
+ ]]]> </Results >
108
+ </Output >
109
+ </Result >
110
+ <Result >
111
+ <Input >
112
+ <Description ><![CDATA[ Float VectorDistance with non null fourth option with default DataType]]> </Description >
113
+ <Expression ><![CDATA[ query.Select(doc => doc.VectorFloatField.VectorDistance(new [] {2, 3, 4}, True, new VectorDistanceOptions() {DistanceFunction = Convert(Cosine, Nullable`1), SearchListSizeMultiplier = Convert(10, Nullable`1)}))]]> </Expression >
114
+ </Input >
115
+ <Output >
116
+ <SqlQuery ><![CDATA[
117
+ SELECT VALUE VectorDistance(root["VectorFloatField"], [2, 3, 4], true, {"distanceFunction": "cosine", "searchListSizeMultiplier": 10})
118
+ FROM root]]> </SqlQuery >
119
+ <Results ><![CDATA[ [
120
+ 0.9925833339709302,
121
+ 0.9925833339709302
122
+ ]]]> </Results >
123
+ </Output >
124
+ </Result >
125
+ <Result >
126
+ <Input >
127
+ <Description ><![CDATA[ Float VectorDistance with non null fourth option with default DistanceFunction]]> </Description >
128
+ <Expression ><![CDATA[ query.Select(doc => doc.VectorFloatField.VectorDistance(new [] {2, 3, 4}, True, new VectorDistanceOptions() {DataType = Convert(Float32, Nullable`1), SearchListSizeMultiplier = Convert(10, Nullable`1)}))]]> </Expression >
129
+ </Input >
130
+ <Output >
131
+ <SqlQuery ><![CDATA[
132
+ SELECT VALUE VectorDistance(root["VectorFloatField"], [2, 3, 4], true, {"dataType": "float32", "searchListSizeMultiplier": 10})
133
+ FROM root]]> </SqlQuery >
134
+ <Results ><![CDATA[ [
135
+ 0.9925833339709302,
136
+ 0.9925833339709302
137
+ ]]]> </Results >
138
+ </Output >
139
+ </Result >
140
+ <Result >
141
+ <Input >
142
+ <Description ><![CDATA[ Float VectorDistance with non null fourth option with all default values]]> </Description >
143
+ <Expression ><![CDATA[ query.Select(doc => doc.VectorFloatField.VectorDistance(new [] {2, 3, 4}, True, new VectorDistanceOptions()))]]> </Expression >
144
+ </Input >
145
+ <Output >
146
+ <SqlQuery ><![CDATA[
147
+ SELECT VALUE VectorDistance(root["VectorFloatField"], [2, 3, 4], true, {})
88
148
FROM root]]> </SqlQuery >
89
149
<Results ><![CDATA[ [
90
150
0.9925833339709302,
@@ -205,15 +265,60 @@ GROUP BY VectorDistance(root["VectorUInt8Field"], [2, 3, 4], false) ]]></SqlQuer
205
265
<Result >
206
266
<Input >
207
267
<Description ><![CDATA[ UInt8 VectorDistance with non null fourth option]]> </Description >
208
- <Expression ><![CDATA[ query.Select(doc => doc.VectorUInt8Field.VectorDistance(new [] {2, 3, 4}, True, new VectorDistanceOptions() {DistanceFunction = DotProduct, DataType = Uint8}))]]> </Expression >
268
+ <Expression ><![CDATA[ query.Select(doc => doc.VectorUInt8Field.VectorDistance(new [] {2, 3, 4}, True, new VectorDistanceOptions() {DistanceFunction = Convert(DotProduct, Nullable`1), DataType = Convert(Uint8, Nullable`1), SearchListSizeMultiplier = Convert(20, Nullable`1)}))]]> </Expression >
269
+ </Input >
270
+ <Output >
271
+ <SqlQuery ><![CDATA[
272
+ SELECT VALUE VectorDistance(root["VectorUInt8Field"], [2, 3, 4], true, {"distanceFunction": "dotProduct", "dataType": "uint8", "searchListSizeMultiplier": 20})
273
+ FROM root]]> </SqlQuery >
274
+ <Results ><![CDATA[ [
275
+ 20.0,
276
+ 20.0
277
+ ]]]> </Results >
278
+ </Output >
279
+ </Result >
280
+ <Result >
281
+ <Input >
282
+ <Description ><![CDATA[ UInt8 VectorDistance with non null fourth option with default DistanceFunction]]> </Description >
283
+ <Expression ><![CDATA[ query.Select(doc => doc.VectorUInt8Field.VectorDistance(new [] {2, 3, 4}, True, new VectorDistanceOptions() {DataType = Convert(Uint8, Nullable`1), SearchListSizeMultiplier = Convert(20, Nullable`1)}))]]> </Expression >
284
+ </Input >
285
+ <Output >
286
+ <SqlQuery ><![CDATA[
287
+ SELECT VALUE VectorDistance(root["VectorUInt8Field"], [2, 3, 4], true, {"dataType": "uint8", "searchListSizeMultiplier": 20})
288
+ FROM root]]> </SqlQuery >
289
+ <Results ><![CDATA[ [
290
+ 0.9925833339709302,
291
+ 0.9925833339709302
292
+ ]]]> </Results >
293
+ </Output >
294
+ </Result >
295
+ <Result >
296
+ <Input >
297
+ <Description ><![CDATA[ UInt8 VectorDistance with non null fourth option with default SearchListSizeMultiplier]]> </Description >
298
+ <Expression ><![CDATA[ query.Select(doc => doc.VectorUInt8Field.VectorDistance(new [] {2, 3, 4}, True, new VectorDistanceOptions() {DistanceFunction = Convert(DotProduct, Nullable`1), DataType = Convert(Uint8, Nullable`1)}))]]> </Expression >
209
299
</Input >
210
300
<Output >
211
301
<SqlQuery ><![CDATA[
212
- SELECT VALUE VectorDistance(root["VectorUInt8Field"], [2, 3, 4], true, {"distanceFunction": "DotProduct ", "dataType": "Uint8 "})
302
+ SELECT VALUE VectorDistance(root["VectorUInt8Field"], [2, 3, 4], true, {"distanceFunction": "dotProduct ", "dataType": "uint8 "})
213
303
FROM root]]> </SqlQuery >
214
304
<Results ><![CDATA[ [
215
305
20.0,
216
306
20.0
307
+ ]]]> </Results >
308
+ </Output >
309
+ </Result >
310
+ <Result >
311
+ <Input >
312
+ <Description ><![CDATA[ UInt8 VectorDistance with non null fourth option with default DistanceFunction and SearchListSizeMultiplier]]> </Description >
313
+ <Expression ><![CDATA[ query.Select(doc => doc.VectorUInt8Field.VectorDistance(new [] {2, 3, 4}, True, new VectorDistanceOptions() {DataType = Convert(Uint8, Nullable`1)}))]]> </Expression >
314
+ </Input >
315
+ <Output >
316
+ <SqlQuery ><![CDATA[
317
+ SELECT VALUE VectorDistance(root["VectorUInt8Field"], [2, 3, 4], true, {"dataType": "uint8"})
318
+ FROM root]]> </SqlQuery >
319
+ <Results ><![CDATA[ [
320
+ 0.9925833339709302,
321
+ 0.9925833339709302
217
322
]]]> </Results >
218
323
</Output >
219
324
</Result >
@@ -230,6 +335,22 @@ ORDER BY RANK RRF(VectorDistance(root["VectorUInt8Field"], [2, 3, 4], false), Ve
230
335
<Results ><![CDATA[ [
231
336
"Test",
232
337
"Test"
338
+ ]]]> </Results >
339
+ </Output >
340
+ </Result >
341
+ <Result >
342
+ <Input >
343
+ <Description ><![CDATA[ UInt8 VectorDistance + RRF + non null fourth option with default SearchListSizeMultiplier]]> </Description >
344
+ <Expression ><![CDATA[ query.OrderByRank(doc => RRF(new [] {doc.VectorUInt8Field.VectorDistance(new [] {2, 3, 4}, False, null), doc.VectorUInt8Field.VectorDistance(new [] {3, 4, 5}, False, new VectorDistanceOptions() {DistanceFunction = Convert(DotProduct, Nullable`1), DataType = Convert(Uint8, Nullable`1)})})).Select(doc => doc.Pk)]]> </Expression >
345
+ </Input >
346
+ <Output >
347
+ <SqlQuery ><![CDATA[
348
+ SELECT VALUE root["Pk"]
349
+ FROM root
350
+ ORDER BY RANK RRF(VectorDistance(root["VectorUInt8Field"], [2, 3, 4], false), VectorDistance(root["VectorUInt8Field"], [3, 4, 5], false, {"distanceFunction": "dotProduct", "dataType": "uint8"}))]]> </SqlQuery >
351
+ <Results ><![CDATA[ [
352
+ "Test",
353
+ "Test"
233
354
]]]> </Results >
234
355
</Output >
235
356
</Result >
@@ -246,6 +367,22 @@ ORDER BY RANK RRF(VectorDistance(root["VectorUInt8Field"], [2, 3, 4], false), Fu
246
367
<Results ><![CDATA[ [
247
368
"Test",
248
369
"Test"
370
+ ]]]> </Results >
371
+ </Output >
372
+ </Result >
373
+ <Result >
374
+ <Input >
375
+ <Description ><![CDATA[ UInt8 VectorDistance + RRF + FullTextScore + non null fourth option with default DistanceFunction]]> </Description >
376
+ <Expression ><![CDATA[ query.OrderByRank(doc => RRF(new [] {doc.VectorUInt8Field.VectorDistance(new [] {2, 3, 4}, False, new VectorDistanceOptions() {DataType = Convert(Uint8, Nullable`1), SearchListSizeMultiplier = Convert(20, Nullable`1)}), doc.VectorUInt8Field.FullTextScore(new [] {"string", "name"})})).Select(doc => doc.Pk)]]> </Expression >
377
+ </Input >
378
+ <Output >
379
+ <SqlQuery ><![CDATA[
380
+ SELECT VALUE root["Pk"]
381
+ FROM root
382
+ ORDER BY RANK RRF(VectorDistance(root["VectorUInt8Field"], [2, 3, 4], false, {"dataType": "uint8", "searchListSizeMultiplier": 20}), FullTextScore(root["VectorUInt8Field"], "string", "name"))]]> </SqlQuery >
383
+ <Results ><![CDATA[ [
384
+ "Test",
385
+ "Test"
249
386
]]]> </Results >
250
387
</Output >
251
388
</Result >
@@ -322,11 +459,11 @@ GROUP BY VectorDistance(root["VectorInt8Field"], [2, 3, 4], false) ]]></SqlQuery
322
459
<Result >
323
460
<Input >
324
461
<Description ><![CDATA[ Int8 VectorDistance with non null fourth option]]> </Description >
325
- <Expression ><![CDATA[ query.Select(doc => doc.VectorInt8Field.VectorDistance(new [] {2, 3, 4}, True, new VectorDistanceOptions() {DistanceFunction = Euclidean, DataType = Int8}))]]> </Expression >
462
+ <Expression ><![CDATA[ query.Select(doc => doc.VectorInt8Field.VectorDistance(new [] {2, 3, 4}, True, new VectorDistanceOptions() {DistanceFunction = Convert( Euclidean, Nullable`1), DataType = Convert( Int8, Nullable`1) }))]]> </Expression >
326
463
</Input >
327
464
<Output >
328
465
<SqlQuery ><![CDATA[
329
- SELECT VALUE VectorDistance(root["VectorInt8Field"], [2, 3, 4], true, {"distanceFunction": "Euclidean ", "dataType": "Int8 "})
466
+ SELECT VALUE VectorDistance(root["VectorInt8Field"], [2, 3, 4], true, {"distanceFunction": "euclidean ", "dataType": "int8 "})
330
467
FROM root]]> </SqlQuery >
331
468
<Results ><![CDATA[ []]]> </Results >
332
469
</Output >
@@ -386,6 +523,66 @@ FROM root]]></SqlQuery>
386
523
<Output >
387
524
<SqlQuery ><![CDATA[
388
525
SELECT VALUE VectorDistance(root["VectorFloatField"], [2, 3, 4], true)
526
+ FROM root]]> </SqlQuery >
527
+ <Results ><![CDATA[ [
528
+ 0.9925833339709302,
529
+ 0.9925833339709302
530
+ ]]]> </Results >
531
+ </Output >
532
+ </Result >
533
+ <Result >
534
+ <Input >
535
+ <Description ><![CDATA[ VectorDistance with default values]]> </Description >
536
+ <Expression ><![CDATA[ query.Select(doc => doc.VectorFloatField.VectorDistance(new [] {2, 3, 4}, True, new VectorDistanceOptions() {DataType = Convert(Float32, Nullable`1), DistanceFunction = Convert(Euclidean, Nullable`1), SearchListSizeMultiplier = Convert(10, Nullable`1)}))]]> </Expression >
537
+ </Input >
538
+ <Output >
539
+ <SqlQuery ><![CDATA[
540
+ SELECT VALUE VectorDistance(root["VectorFloatField"], [2, 3, 4], true, {"distanceFunction": "euclidean", "dataType": "float32", "searchListSizeMultiplier": 10})
541
+ FROM root]]> </SqlQuery >
542
+ <Results ><![CDATA[ [
543
+ 1.7320508075688772,
544
+ 1.7320508075688772
545
+ ]]]> </Results >
546
+ </Output >
547
+ </Result >
548
+ <Result >
549
+ <Input >
550
+ <Description ><![CDATA[ VectorDistance with non default values 1]]> </Description >
551
+ <Expression ><![CDATA[ query.Select(doc => doc.VectorFloatField.VectorDistance(new [] {2, 3, 4}, True, new VectorDistanceOptions() {DataType = Convert(Int8, Nullable`1), DistanceFunction = Convert(Cosine, Nullable`1), SearchListSizeMultiplier = Convert(20, Nullable`1)}))]]> </Expression >
552
+ </Input >
553
+ <Output >
554
+ <SqlQuery ><![CDATA[
555
+ SELECT VALUE VectorDistance(root["VectorFloatField"], [2, 3, 4], true, {"distanceFunction": "cosine", "dataType": "int8", "searchListSizeMultiplier": 20})
556
+ FROM root]]> </SqlQuery >
557
+ <Results ><![CDATA[ [
558
+ 0.9925833339709302,
559
+ 0.9925833339709302
560
+ ]]]> </Results >
561
+ </Output >
562
+ </Result >
563
+ <Result >
564
+ <Input >
565
+ <Description ><![CDATA[ VectorDistance with non default values 2]]> </Description >
566
+ <Expression ><![CDATA[ query.Select(doc => doc.VectorFloatField.VectorDistance(new [] {2, 3, 4}, True, new VectorDistanceOptions() {DataType = Convert(Uint8, Nullable`1), DistanceFunction = Convert(DotProduct, Nullable`1), SearchListSizeMultiplier = Convert(50, Nullable`1)}))]]> </Expression >
567
+ </Input >
568
+ <Output >
569
+ <SqlQuery ><![CDATA[
570
+ SELECT VALUE VectorDistance(root["VectorFloatField"], [2, 3, 4], true, {"distanceFunction": "dotProduct", "dataType": "uint8", "searchListSizeMultiplier": 50})
571
+ FROM root]]> </SqlQuery >
572
+ <Results ><![CDATA[ [
573
+ 20.0,
574
+ 20.0
575
+ ]]]> </Results >
576
+ </Output >
577
+ </Result >
578
+ <Result >
579
+ <Input >
580
+ <Description ><![CDATA[ VectorDistance with nullable values]]> </Description >
581
+ <Expression ><![CDATA[ query.Select(doc => doc.VectorFloatField.VectorDistance(new [] {2, 3, 4}, True, new VectorDistanceOptions() {DataType = null, DistanceFunction = null, SearchListSizeMultiplier = null}))]]> </Expression >
582
+ </Input >
583
+ <Output >
584
+ <SqlQuery ><![CDATA[
585
+ SELECT VALUE VectorDistance(root["VectorFloatField"], [2, 3, 4], true, {})
389
586
FROM root]]> </SqlQuery >
390
587
<Results ><![CDATA[ [
391
588
0.9925833339709302,
@@ -396,11 +593,11 @@ FROM root]]></SqlQuery>
396
593
<Result >
397
594
<Input >
398
595
<Description ><![CDATA[ VectorDistance with partial fourth option]]> </Description >
399
- <Expression ><![CDATA[ query.Select(doc => doc.VectorFloatField.VectorDistance(new [] {2, 3, 4}, True, new VectorDistanceOptions() {DistanceFunction = Euclidean}))]]> </Expression >
596
+ <Expression ><![CDATA[ query.Select(doc => doc.VectorFloatField.VectorDistance(new [] {2, 3, 4}, True, new VectorDistanceOptions() {DistanceFunction = Convert( Euclidean, Nullable`1) }))]]> </Expression >
400
597
</Input >
401
598
<Output >
402
599
<SqlQuery ><![CDATA[
403
- SELECT VALUE VectorDistance(root["VectorFloatField"], [2, 3, 4], true, {"distanceFunction": "Euclidean "})
600
+ SELECT VALUE VectorDistance(root["VectorFloatField"], [2, 3, 4], true, {"distanceFunction": "euclidean "})
404
601
FROM root]]> </SqlQuery >
405
602
<Results ><![CDATA[ [
406
603
1.7320508075688772,
@@ -411,7 +608,7 @@ FROM root]]></SqlQuery>
411
608
<Result >
412
609
<Input >
413
610
<Description ><![CDATA[ VectorDistance with partial fourth option 2]]> </Description >
414
- <Expression ><![CDATA[ query.Select(doc => doc.VectorFloatField.VectorDistance(new [] {2, 3, 4}, True, new VectorDistanceOptions() {SearchListSizeMultiplier = 1 }))]]> </Expression >
611
+ <Expression ><![CDATA[ query.Select(doc => doc.VectorFloatField.VectorDistance(new [] {2, 3, 4}, True, new VectorDistanceOptions() {SearchListSizeMultiplier = Convert(1, Nullable`1) }))]]> </Expression >
415
612
</Input >
416
613
<Output >
417
614
<SqlQuery ><![CDATA[
@@ -426,7 +623,7 @@ FROM root]]></SqlQuery>
426
623
<Result >
427
624
<Input >
428
625
<Description ><![CDATA[ VectorDistance with fourth option with invalid values 1]]> </Description >
429
- <Expression ><![CDATA[ query.Select(doc => doc.VectorFloatField.VectorDistance(new [] {2, 3, 4}, True, new VectorDistanceOptions() {SearchListSizeMultiplier = -100}))]]> </Expression >
626
+ <Expression ><![CDATA[ query.Select(doc => doc.VectorFloatField.VectorDistance(new [] {2, 3, 4}, True, new VectorDistanceOptions() {SearchListSizeMultiplier = Convert( -100, Nullable`1) }))]]> </Expression >
430
627
</Input >
431
628
<Output >
432
629
<SqlQuery ><![CDATA[
0 commit comments