Skip to content

support TermSetQuery over fastfield #2841

@trinity-1686a

Description

@trinity-1686a

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions