Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NOT operator in FTS queries #3401

Open
wjones127 opened this issue Jan 21, 2025 · 0 comments
Open

NOT operator in FTS queries #3401

wjones127 opened this issue Jan 21, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@wjones127
Copy link
Contributor

wjones127 commented Jan 21, 2025

We claim to use Tantivy's query parser, but the NOT (-) operator doesn't seem to work:

import lancedb

db = lancedb.connect("memory://")
table = db.create_table('test', [{'text': 'apple fruit'}, {'text': 'apple'}, {'text': 'fruit'}])
table.create_fts_index(field_names='text', use_tantivy=False)
table.search('apple -fruit', query_type="fts").to_list()
[{'text': 'apple fruit', '_score': 0.7803833484649658},
 {'text': 'fruit', '_score': 0.5235483646392822},
 {'text': 'apple', '_score': 0.5235483646392822}]
@wjones127 wjones127 added the enhancement New feature or request label Jan 21, 2025
@wjones127 wjones127 added this to the Lance Papercuts milestone Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant