The main difference between queries and filters is related to counting. Requests return documents with a relative rating score for each document. There are no filters. This difference allows the filter to be faster for two reasons. Firstly, it does not bear the cost of calculating the score for each document. Secondly, he can cache the results, since he does not need to deal with possible changes in the account from moment to moment - this is just a logical value, does the document correspond or not?
From the documentation:
Filters are usually faster than queries because:
they don’t need to calculate the _score relevance for each document - the answer is simply logical “Yes, the document matches the filter” or “No, the document does not match the filter”. The results of most filters can be cached in memory, which speeds up subsequent quotes.
, , ? , - . , , , . , (, : "EN" ) , . , .
, . :
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-filtered-query.html
http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/query-dsl-filtered-query.html
http://exploringelasticsearch.com/searching_data.html
http://elasticsearch-users.115913.n3.nabble.com/Filters-vs-Queries-td3219558.html