mirror of
https://github.com/lancedb/lancedb.git
synced 2026-05-25 16:00:49 +00:00
feat: add parity between fast_search keyword argument between vector and FTS searches (#3091)
We don't necessarily need to do this, but one user was confused having used `fast_search=True` as a keyword argument for vector searches, but being unable to do so for FTS, even after the most recent changes. I think this is the only discrepancy in where that is possible.
This commit is contained in:
@@ -27,6 +27,7 @@ from lancedb.query import (
|
||||
PhraseQuery,
|
||||
BooleanQuery,
|
||||
Occur,
|
||||
LanceFtsQueryBuilder,
|
||||
)
|
||||
import numpy as np
|
||||
import pyarrow as pa
|
||||
@@ -920,6 +921,10 @@ def test_fts_fast_search(table):
|
||||
assert query.limit == 5
|
||||
assert query.columns == ["text"]
|
||||
|
||||
# fast_search should be enabled by keyword argument too
|
||||
query = LanceFtsQueryBuilder(table, "xyz", fast_search=True).to_query_object()
|
||||
assert query.fast_search is True
|
||||
|
||||
# Verify it executes without error and skips unindexed data
|
||||
results = table.search("xyz", query_type="fts").fast_search().limit(5).to_list()
|
||||
assert len(results) == 0
|
||||
|
||||
Reference in New Issue
Block a user