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

Don't expand default_field in query_string before required #53789

Closed
timroes opened this issue Mar 19, 2020 · 1 comment · Fixed by #55158
Closed

Don't expand default_field in query_string before required #53789

timroes opened this issue Mar 19, 2020 · 1 comment · Fixed by #55158
Assignees
Labels
>enhancement :Search/Search Search-related issues that do not fall into other categories

Comments

@timroes
Copy link
Contributor

timroes commented Mar 19, 2020

ES version: 7.6.1

Elasticsearch currently expands the default_field in a query_string query before it's actually needed. So with a default_field: '*' and an index pattern, that has too many fields, you might run into the field expansion matches too many fields, limit: 1024, got: 1089 error, even if the query, actually does not have any part in it, that would require the default_field (because all parts of the query specify a field explicitly).

Suggestion: We should not try to expand the default_field before we're not seeing the first part of the query, that actually not has a field in it, and would require that value.

@timroes timroes added the :Search/Search Search-related issues that do not fall into other categories label Mar 19, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (:Search/Search)

@cbuescher cbuescher self-assigned this Apr 9, 2020
cbuescher pushed a commit to cbuescher/elasticsearch that referenced this issue Apr 14, 2020
Currently QueryStringQueryParser already checks if the field limit is breached
at construction time, which e.g. leads to errors if the default field is set to
"*" or the default is used and there are more fields than the limit, even if the
query itself does not use all these fields.
This change moves this check to happen after query parsing. QueryStringQueryParser now
keeps track of the fields that are actually resolved while parsing. The size of
that set is later used to check against the limit set by the
`indices.query.bool.max_clause_count` setting.

Closes elastic#53789
cbuescher pushed a commit that referenced this issue Apr 23, 2020
Currently QueryStringQueryParser already checks if the field limit is breached
at construction time, which e.g. leads to errors if the default field is set to
"*" or the default isn't used and there are more fields than the limit, even if the
query itself does not use all these fields.
This change moves this check to happen after query parsing. QueryStringQueryParser now
keeps track of the fields that are actually resolved while parsing. The size of
that set is later used to check against the limit set by the
`indices.query.bool.max_clause_count` setting.

Closes #53789
cbuescher pushed a commit to cbuescher/elasticsearch that referenced this issue Apr 23, 2020
…5158)

Currently QueryStringQueryParser already checks if the field limit is breached
at construction time, which e.g. leads to errors if the default field is set to
"*" or the default isn't used and there are more fields than the limit, even if the
query itself does not use all these fields.
This change moves this check to happen after query parsing. QueryStringQueryParser now
keeps track of the fields that are actually resolved while parsing. The size of
that set is later used to check against the limit set by the
`indices.query.bool.max_clause_count` setting.

Closes elastic#53789
cbuescher pushed a commit to cbuescher/elasticsearch that referenced this issue Apr 23, 2020
…5158)

Currently QueryStringQueryParser already checks if the field limit is breached
at construction time, which e.g. leads to errors if the default field is set to
"*" or the default isn't used and there are more fields than the limit, even if the
query itself does not use all these fields.
This change moves this check to happen after query parsing. QueryStringQueryParser now
keeps track of the fields that are actually resolved while parsing. The size of
that set is later used to check against the limit set by the
`indices.query.bool.max_clause_count` setting.

Closes elastic#53789
cbuescher pushed a commit that referenced this issue May 14, 2020
…55661)

Currently QueryStringQueryParser already checks if the field limit is breached
at construction time, which e.g. leads to errors if the default field is set to
"*" or the default isn't used and there are more fields than the limit, even if the
query itself does not use all these fields.
This change moves this check to happen after query parsing. QueryStringQueryParser now
keeps track of the fields that are actually resolved while parsing. The size of
that set is later used to check against the limit set by the
`indices.query.bool.max_clause_count` setting.

Backport of #55158
Closes #53789
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement :Search/Search Search-related issues that do not fall into other categories
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants