Add "all fields" execution mode to simple_query_string query#21341
Add "all fields" execution mode to simple_query_string query#21341dakrone merged 1 commit intoelastic:masterfrom
Conversation
jimczi
left a comment
There was a problem hiding this comment.
Left two minors, LGTM otherwise
There was a problem hiding this comment.
Maybe just throw an exception in that case (like fields does) ?
There was a problem hiding this comment.
Yes! I actually missed this and the exception throwing was only validating the xcontent parsing, so things like the transport client weren't tripping it. I've changed that to validate it always.
There was a problem hiding this comment.
I think you'll want to have a test mixing numbers and text ?
There was a problem hiding this comment.
Sure, I've added another test for mixing the types (other tests in the suite do this as well)
|
The fact that we need to implement this feature on multiple query parsers makes me wonder whether this could be done at the mapping level, ie the |
|
@jpountz i thought of something similar, but do we really want this mode to be used in (eg) term queries? |
|
@jpountz when I talked to Clint about it (basically creating a "meta-field"), I think the |
Good question. We already do something similar with the
Fair enough, I just wanted to make sure we considered this option. |
|
retest this please |
1 similar comment
|
retest this please |
|
retest this please but don't fail pulling the builds this time :-/ |
34806a7 to
a1b6bb5
Compare
This commit introduces a new execution mode for the
`simple_query_string` query, which is intended down the road to be a
replacement for the current _all field.
It now does auto-field-expansion and auto-leniency when the following criteria
are ALL met:
The _all field is disabled
No default_field has been set in the index settings
No fields are specified in the request
Additionally, a user can force the "all-like" execution by setting the
all_fields parameter to true.
When executing in all field mode, the `simple_query_string` query will
look at all the fields in the mapping that are not metafields and can be
searched, and automatically expand the list of fields that are going to
be queried.
Relates to elastic#20925, which is the `query_string` version of this work.
This is basically the same behavior, but for the `simple_query_string`
query.
Relates to elastic#19784
a1b6bb5 to
7420fd0
Compare
As part of elastic#20925 and elastic#21341 we added an "all-fields" mode to the `query_string` and `simple_query_string`. This would expand the query to all fields and automatically set `lenient` to true. However, we should still allow a user to override the `lenient` flag to whichever value they desire, should they add it in the request. This commit does that.
This change disables the _all meta field by default. Now that we have the "all-fields" method of query execution, we can save both indexing time and disk space by disabling it. _all can no longer be configured for indices created after 6.0. Relates to elastic#20925 and elastic#21341 Resolves elastic#19784
This commit introduces a new execution mode for the
simple_query_stringquery, which is intended down the road to be areplacement for the current _all field.
It now does auto-field-expansion and auto-leniency when the following criteria
are ALL met:
Additionally, a user can force the "all-like" execution by setting the
all_fields parameter to true.
When executing in all field mode, the
simple_query_stringquery willlook at all the fields in the mapping that are not metafields and can be
searched, and automatically expand the list of fields that are going to
be queried.
Relates to #20925, which is the
query_stringversion of this work.This is basically the same behavior, but for the
simple_query_stringquery.
Relates to #19784