HomePhorge

Use filtered query instead of filter in Elasticsearch

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

Provenance
Jakub VranaAuthored on Aug 1 2013, 4:38 PM
themackabuPushed on Mar 25 2025, 8:07 PM
Parents
rP78f73e7d4543: Add one-line feed story.
Branches
Unknown
Tags
Unknown

Event Timeline