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

Fix range and wildcard queries on type-field for single-type indices #31632

Closed
cbuescher opened this issue Jun 27, 2018 · 4 comments
Closed

Fix range and wildcard queries on type-field for single-type indices #31632

cbuescher opened this issue Jun 27, 2018 · 4 comments
Labels
help wanted adoptme :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch

Comments

@cbuescher
Copy link
Member

This comes from a discussion with @jpountz after looking at #31476.
Range and wildcard queries throw an error when run against a _type field for single-type indices in 6.x and most likely also
in master. While _type is deprecated, it might still we worth fixing these for the time being. In the other hand it seems to be a
rare use-case to query the _type field with a range query, so I'd probably discuss this before diving deeper into it.

@cbuescher cbuescher added :Search Foundations/Mapping Index mappings, including merging and defining field types v7.0.0 v6.4.0 team-discuss labels Jun 27, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search-aggs

@cbuescher
Copy link
Member Author

Talked about this in the group, while supporting rangequeries on single type indices seems a bit of an esoteric usecase, supporting wildcards seems desirable to do. Unfortunately this seems to be the harder case technically, so there are no clear ideas of how to do this. Marking this as "adoptme" regardless.

@cbuescher cbuescher added help wanted adoptme and removed team-discuss labels Jul 2, 2018
cbuescher pushed a commit to cbuescher/elasticsearch that referenced this issue Jul 3, 2018
With the introduction of single types in 6.x, the `_type` field is no longer
indexed, which leads to certain queries that were working before throw errors
now. One such query is the `range` query, that, if performed on a single typer
index, currently throws an IAE since the field is not indexed.
This change adds special treatment for this case in the TypeFieldMapper,
comparing the range queries lower and upper bound to the one existing type and
either returns a MatchAllDocs or a MatchNoDocs query.

Relates to elastic#31632
Closes elastic#31476
cbuescher pushed a commit that referenced this issue Jul 18, 2018
With the introduction of single types in 6.x, the `_type` field is no longer
indexed, which leads to certain queries that were working before throw errors
now. One such query is the `range` query, that, if performed on a single typer
index, currently throws an IAE since the field is not indexed.
This change adds special treatment for this case in the TypeFieldMapper,
comparing the range queries lower and upper bound to the one existing type and
either returns a MatchAllDocs or a MatchNoDocs query.

Relates to #31632
Closes #31476
cbuescher pushed a commit to cbuescher/elasticsearch that referenced this issue Jul 18, 2018
…31756)

With the introduction of single types in 6.x, the `_type` field is no longer
indexed, which leads to certain queries that were working before throw errors
now. One such query is the `range` query, that, if performed on a single typer
index, currently throws an IAE since the field is not indexed.
This change adds special treatment for this case in the TypeFieldMapper,
comparing the range queries lower and upper bound to the one existing type and
either returns a MatchAllDocs or a MatchNoDocs query.

Relates to elastic#31632
Closes elastic#31476
cbuescher pushed a commit that referenced this issue Jul 23, 2018
…32161)

With the introduction of single types in 6.x, the `_type` field is no longer
indexed, which leads to certain queries that were working before throw errors
now. One such query is the `range` query, that, if performed on a single typer
index, currently throws an IAE since the field is not indexed.
This change adds special treatment for this case in the TypeFieldMapper,
comparing the range queries lower and upper bound to the one existing type and
either returns a MatchAllDocs or a MatchNoDocs query.

Relates to #31632
Closes #31476
@lcawl lcawl added v6.4.1 and removed v6.4.0 labels Aug 23, 2018
@jasontedor jasontedor added v8.0.0 and removed v7.0.0 labels Feb 6, 2019
@jtibshirani
Copy link
Contributor

@cbuescher I'm wondering if it’s worth still keeping this open, or if we should close it. In 7.0 it is deprecated to use _type in searches, and I think wildcard queries on _type are rare.

@cbuescher
Copy link
Member Author

@jtibshirani agreed, since we are moving close to 7.0 and there hasn't been much outside need to fix this since when I opened it last year, I think we can close the issue. If this limitation gets raised from a user side we can still re-evaluate considering the context.

@javanna javanna added the Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch label Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted adoptme :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch
Projects
None yet
Development

No branches or pull requests

6 participants