Navigation Menu

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

Post Filter - Elastic search performance advice #1187

Closed
idhard opened this issue Oct 14, 2016 · 2 comments
Closed

Post Filter - Elastic search performance advice #1187

idhard opened this issue Oct 14, 2016 · 2 comments

Comments

@idhard
Copy link

idhard commented Oct 14, 2016

According to the documentation :

https://www.elastic.co/guide/en/elasticsearch/guide/current/_post_filter.html

Use a post_filter only if you need to differentially filter search results and aggregations. Sometimes people will use post_filter for regular searches.

Don’t do this! The nature of the post_filter means it runs after the query, so any performance benefit of filtering (such as caches) is lost completely.

The post_filter should be used only in combination with aggregations, and only when you need differential filtering.

And i have noticed that the Query builder is setting the filters in the post_filter parent.

i have followed some of the related issues on this topic but still im confused about the implementation of this class.

should we use filtered queries instead of Query in order to follow the performance advice ?

@p365labs
Copy link
Collaborator

Hi @idhard , when u say "And i have noticed that the Query builder is setting the filters in the post_filter parent." where exactly QueryBuilder is setting filters in the post_filters ? can u show me some code ?

@Tobion
Copy link
Collaborator

Tobion commented Mar 12, 2017

Closing as the query builder does not set filters at all as pointed out by @p365labs

@Tobion Tobion closed this as completed Mar 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants