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
Query DSL: Add different execution models for terms filter #1568
Comments
hi,shay, |
You mean how it looks like? Something like this:
|
thanks. ------------------ Original ------------------ You mean how it looks like? Something like this:
Reply to this email directly or view it on GitHub: |
What if I have a field named "execution"? |
Does |
The way
terms
filter currently executes is by iterating over the terms provided and finding matches docs (loading into a bitset) and caching it. Sometimes, we want a different execution model that can still be achieved by building more complex queries in the DSL, but would be nice to support them in the more compact model thatterms
filter provides.The
execution
option now has the following options :plain
: The default. Works as today. Iterates over all the terms, building a bit set matching it, and filtering. The total filter is cached (keyed by the terms).bool
: Builds abool
filter wrapping each term in aterm
filter that is cached. The bool filter is optimized in this case since it bitwise or's the different term filter bitsets. The total filter is not cached by default in this case.and
: Builds anand
filter wrapping each term interm
filter that is cached. The total filter is not cached by default in this case. Most times,bool
should be used as its faster thanks to its bitwise execution.The "total" terms filter caching can still be explicitly controlled using the
_cache
option. Note the default value for it depends on theexecution
value.The text was updated successfully, but these errors were encountered: