Skip to content

Commit 5025334

Browse files
committed
SCBC-483: SDK: Support FTS like Pre-Filters while doing Vector Search
Adding FIT testing. (And fixing a pre-existing performer bug) Change-Id: I8d4821a2310c060922876988d8ef14462bf21816 Reviewed-on: https://review.couchbase.org/c/couchbase-jvm-clients/+/228736 Tested-by: Build Bot <[email protected]> Reviewed-by: David Nault <[email protected]>
1 parent 6535024 commit 5025334

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

scala-fit-performer/src/main/scala/com/couchbase/client/performer/scala/search/SearchHelper.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ object SearchHelper {
385385
out = out.should(converted: _*)
386386
}
387387
if (qr.getMustNotCount > 0) {
388-
val converted = convertSearchQueries(qr.getMustList.asScala)
388+
val converted = convertSearchQueries(qr.getMustNotList.asScala)
389389
out = out.mustNot(converted: _*)
390390
}
391391
if (qr.hasShouldMin) out = out.shouldMin(qr.getShouldMin)
@@ -545,6 +545,9 @@ object SearchHelper {
545545
val opts = vq.getOptions
546546
if (opts.hasNumCandidates) out = out.numCandidates(opts.getNumCandidates)
547547
if (opts.hasBoost) out = out.boost(opts.getBoost)
548+
// [if:1.9.0]
549+
if (opts.hasPrefilter) out = out.prefilter(convertSearchQuery(opts.getPrefilter))
550+
// [end]
548551
}
549552
out
550553
}

scala-fit-performer/src/main/scala/com/couchbase/client/performer/scala/util/Capabilities.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ object Capabilities {
8686
out.add(Caps.SDK_BUCKET_SETTINGS_NUM_VBUCKETS)
8787
// [end:1.8.2]
8888

89+
// [start:1.9.0]
90+
out.add(Caps.SDK_PREFILTER_VECTOR_SEARCH)
91+
// [end:1.9.0]
92+
8993
out
9094
}
9195

0 commit comments

Comments
 (0)