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

MappedFieldType.rangeQuery should rewrite to an exists query when both bounds are open #22640

Closed
jpountz opened this issue Jan 16, 2017 · 2 comments
Labels
>enhancement good first issue low hanging fruit help wanted adoptme :Search/Search Search-related issues that do not fall into other categories

Comments

@jpountz
Copy link
Contributor

jpountz commented Jan 16, 2017

Queries that have both bounds open can be generated even if the user passed explicit bounds due to query rewriting. Unfortunately, queries that have both bounds open are still costly to execute, so we should look into using exists queries instead (or even match_all queries if all docs have a value for the field).

@jpountz jpountz added :Search/Search Search-related issues that do not fall into other categories good first issue low hanging fruit labels Jan 16, 2017
@AnnaGMiguel
Copy link

Hello @jpountz, I'm looking for my first contribution to elasticsearch.
I'm familiarizing myself with the code base.

@jpountz
Copy link
Contributor Author

jpountz commented Aug 2, 2017

@AnnaGMiguel Sorry for the late reply, I just saw your message. If you are looking for help to get started, you can look at the RangeQueryBuilder class.

jimczi added a commit to jimczi/elasticsearch that referenced this issue Aug 11, 2017
This change rewrites range query with open bounds to an exists query that should be faster to execute.

Fixes elastic#22640
jimczi added a commit that referenced this issue Aug 14, 2017
* Rewrite range queries with open bounds to exists query

This change rewrites range query with open bounds to an exists query that should be faster to execute.

Fixes #22640
jimczi added a commit that referenced this issue Aug 14, 2017
* Rewrite range queries with open bounds to exists query

This change rewrites range query with open bounds to an exists query that should be faster to execute.

Fixes #22640
jpountz added a commit to jpountz/elasticsearch that referenced this issue Aug 16, 2017
…tch.

Since `BooleanQuery` has special rewrite rules in case some clauses are
instances of `MatchAllDocsQuery` this can help simplify queries. I think this
change will be especially helpful when elastic#22640 is implemented.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement good first issue low hanging fruit help wanted adoptme :Search/Search Search-related issues that do not fall into other categories
Projects
None yet
Development

No branches or pull requests

3 participants