Homec4science

Use filtered query instead of filter in Elasticsearch

Authored by Jakub Vrana <jakub@vrana.cz> on Aug 2 2013, 01:38.

Description

Use filtered query instead of filter in Elasticsearch

Summary:
The 'filter' works like this: Get all results matching query (all if there's no query), compute facets (if there are any) and then filter out the uninteresting results.
The 'filtered' query applies the filters when searching, not when processing results.
This is obviously not documented anywhere in the great Elasticsearch documentation.
http://stackoverflow.com/questions/14007078/performance-of-elastic-queries

We don't hit this problem very often as we usually use some query.

Test Plan: Searched for open documents using Elasticsearch, verified the sent JSON, verified results.

Reviewers: epriestley, wez

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D6643

Details

Committed
Jakub Vrana <jakub@vrana.cz>Aug 2 2013, 01:38
Pushed
aubortJan 31 2017, 17:16
Parents
rPH78f73e7d4543: Add one-line feed story.
Branches
Unknown
Tags
Unknown

Event Timeline

Jakub Vrana <jakub@vrana.cz> committed rPH6c7f36f6b81b: Use filtered query instead of filter in Elasticsearch (authored by Jakub Vrana <jakub@vrana.cz>).Aug 2 2013, 01:38