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

No need to use Field Stats API in the dashboard and visualise tabs (and possibly Discover too) #6644

Closed
colings86 opened this issue Mar 24, 2016 · 7 comments
Labels
Feature:Visualizations Generic visualization features (in case no more specific feature label is available) release_note:enhancement

Comments

@colings86
Copy link
Contributor

Now that requests are rewritten in elasticsearch on each shard. If the range query and the values for the field on the shard do not overlap the query is rewritten to a MatchNoDocsQuery. This means that that part of the query is effectively not run if the shard does not contain terms in the range of the range query. Also because the request will now be cached in the request cache, subsequent searches will also be rewritten and retrieve the results for the request cache making searching non-matching indexes very fast.

Because of this neither the visualise or dashboard tabs need to make calls to the field stats API before they execute the search and can instead just run the search on `indexPattern*. So the field stats API can be removed from these tabs.

The discover tab still may require the field stats API for the segmented fetch it performs to know which order to request data from the indexes, but it would be worth testing whether the request cache and rewrite improvements in ES 5.0 negate the need consult field stats and if the discover tab is fast enough without using field stats now.

@spalger
Copy link
Contributor

spalger commented Mar 24, 2016

I love any chance I get to remove code @epixa wrote

@epixa
Copy link
Contributor

epixa commented Mar 24, 2016

Interesting... this is exciting.

We should make sure to test this change to Kibana on different setups before shipping it, but this could be a very nice change.

@tbragin tbragin added the Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc label Nov 9, 2016
@epixa epixa added :Discovery and removed Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc labels Jan 26, 2017
@epixa
Copy link
Contributor

epixa commented Jan 26, 2017

One thing to note here that was brought up recently in a discussion about the cross-cluster client: there is currently a soft-limit of a max of 1000 shards at a time for queries. That will probably need to be addressed in Elasticsearch by doing a pre-query check phase to reduce shard numbers or by implementing stepwise-reduction of results. @clintongormley is there an elasticsearch issue for that?

@clintongormley
Copy link
Contributor

@epixa not yet - i'll update here when there is one

@clintongormley
Copy link
Contributor

@epixa First step towards incremental reduction of query responses elastic/elasticsearch#23253

@tbragin tbragin added :Sharing Feature:Visualizations Generic visualization features (in case no more specific feature label is available) labels Mar 31, 2017
@epixa
Copy link
Contributor

epixa commented Apr 3, 2017

I created #11011 to track the effort to support cross-cluster search, and that will end up addressing this issue by deprecating this old field_stats based behavior for new index patterns.

@jbudz
Copy link
Member

jbudz commented Jul 21, 2017

Closed by #12814

@jbudz jbudz closed this as completed Jul 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Visualizations Generic visualization features (in case no more specific feature label is available) release_note:enhancement
Projects
None yet
Development

No branches or pull requests

6 participants