-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Auto expanding fields in Discovery/Query-String performance issue #12097
Comments
It's just that |
+1 to making |
Yes, confirmed that As a quick test, this is the performance win for just doing that change:
vs
|
Under what real world circumstances would a person want the behavior of |
I suspect none. |
If the user has a default search field set (say Is there any reason we should prefer cc @lukasolson |
well that's just the convention in |
I can't think of a scenario where a user wants to expand a * query across all the fields, unless you want to get the documents that those field exists, but for that i would recommend explicit query string with field names, and i haven't seen that case in Kibana use cases. A Whatever we do, it needs to be also done in 5.x in my opinion. I have seen:
While we do not recommend huge/very_large mappings, some users have use cases which have been working fine in 4.x series, but after upgrading this started to fail. There is an easy fix which is configuring a default field, but it's a bad experience, so i would try with a native fix in Kibana. This issue was introduced in |
For very large mappings, changing |
To clarify, I'm just proposing we change the default query to a
I'll leave this decision up to @epixa. If a user has a default search field set and has saved visualizations or dashboards with empty searches, this change could alter the results of their queries so it's theoretically a breaking change. Perhaps that demographic is small enough and the benefit of the change is great enough that it's worth it. |
Could we only use a |
I opened an issue elastic/elasticsearch#25105 so we can discuss this and decide on a good limit |
I think we'd have to get and parse the settings for every matching index to get that info wouldn't we? |
BTW this issue seems to be exacerbated by highlighting, so a workaround for currently affected users would be to set |
This has gotten to the point of making Discover unusable for metricbeat with it's 993 fields. If I run this in dev console (which is the query part from the Discover request);
I get this (so long I cut most of it out);
If I change the query from
|
Fixed by #13047. |
Kibana version: 5.4.x
Elasticsearch version: 5.4.x
Server OS version: ANY
Browser version: ANY
Browser OS version: ANY
Original install method (e.g. download page, yum, from source, etc.): ZIP file
Description of the problem including expected versus actual behavior:
Since elastic/elasticsearch#20925 when executing a query string query in an index (index pattern) that had
_all
disabled, we 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.Basically, we will expand the query string for each specific field that you have in the index. Saved searches and discovery usually use the following query, along with other filters:
This means that for index patterns that have lots of fields, we will see the query expanded with many
ConstantScore(_field_names:<FIELD_NAME_HERE>
and this can be a performance impact compared with previous Elasticsearch/Kibana versions. This has been introduced inES/Kibana 5.1.1
.This can be easily tested by grabbing the network call from a discovery page. This two steps are a quick repro:
Note that i added the
profile: true
to be able to see the lucene expressions being used.My proposal is to, when
_all
is disabled and nofields
ordefault_field
is used, add a warning that the query will auto expand to all the fields available in the index patter, and that will have an extra cost.The text was updated successfully, but these errors were encountered: