You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importlanceimportpyarrowaspadata=pa.table({
"text": ["Frodo was a puppy", "There were several kittens playing", "Frodo was a happy puppy", "Frodo was a very happy puppy"],
"sentiment": ["neutral", "neutral", "positive", "positive"]
})
ds=lance.write_dataset(data, "/tmp/test.lance", mode="overwrite")
ds.create_scalar_index("text", "INVERTED")
ds.create_scalar_index("sentiment", "BITMAP")
results=ds.to_table(full_text_query="puppy", filter="sentiment='positive'", prefilter=True, with_row_id=True)
print(results)
assertresults.num_rows==2
I suspect that the wand / posting iterator logic is doing something like (apologies in advance for my poor understanding of the wand search :) )...
candidate = iterator.current()
while not iterator.exhuasted():
if candidate.matches_fts():
iterator.advance_until_greater_than(candidate.score)
And the mask is only applied in iterator.next and so that first call to iterator.current() is always returning the first result, whether it matches the mask or not.
The text was updated successfully, but these errors were encountered:
Simple reproduction (courtesy of lancedb/lancedb#1656)
I suspect that the wand / posting iterator logic is doing something like (apologies in advance for my poor understanding of the wand search :) )...
And the mask is only applied in
iterator.next
and so that first call toiterator.current()
is always returning the first result, whether it matches the mask or not.The text was updated successfully, but these errors were encountered: