fix: reject combined-fields queries on legacy Enterprise servers (#5343)

Closes #5340.

Reject `CombinedFields` before sending an FTS query to a LanceDB
Enterprise server older than 0.3.0. The check follows all Boolean
clauses and both sides of a Boost query. The 0.3.0 regression test also
checks that unequal column weights and the `AND` operator reach the
server.

Reproduced with Python SDK 0.42.1 against a mock 0.2.0 server. Both
searches returned HTTP 200. The top-level query lost its weights and
operator, and the nested Boolean query sent an empty string. The same
searches preserved the structured query on 0.3.0.
This commit is contained in:
KarthikS
2026-12-02 12:04:52 +08:00
committed by GitHub
parent 9bdb1b7219
commit 3afd0ced9c
2 changed files with 71 additions and 2 deletions
+3
View File
@@ -829,6 +829,9 @@ The query below finds `car` in `text` and `merrily` in `text2`, returning rows 1
and 3. The same query with `MultiMatchQuery` returns no rows, because neither
column contains both words on its own.
On LanceDB Enterprise, combined-fields queries require server version 0.3.0 or
later, including when nested in a Boolean or boost query.
Every column must use the same tokenizer configuration. The two indexes in this
example are built with the same `FTS` settings. Boosts work as they do for
`MultiMatchQuery`: one weight per column, each at least 1.