-
-
Notifications
You must be signed in to change notification settings - Fork 866
Description
Is your feature request related to a problem? Please describe.
we support TermQuery over fastfield, but nott TermSetQuery. It's a shame, because TermSetQuery over fastfield would be a lot more efficient than n*TermQuery over fastfield, as you can check every document only once
this is inspired by this pr quickwit-oss/quickwit#6151 (comment)
Describe the solution you'd like
supporting a fallback to run TermSetQuery over fastfield. For string/byte fields, first map value to ordinal once per segment, and make that into a set. For all (we now have a number), scan the fastfield doc by doc, and check for each doc if it matches the set.
[Optional] describe alternatives you've considered
Union of TermQueries is a possibility, but it's substantially more compute intensive. TermSetQuery over fastfield would be, in first approximation constant complexity in the number of terms per field, whereas an union of TermQuery is linear in number of terms