0
votes

I am confused about the difference between behaviour of filter and query when wrapped in constant_score compound query.
Both gives me score of 1 without any boost for all documents. But the docs say that filter context is activated when we use filter clause inside constant_score.
If I am getting constant score for all documents with query parameter under constant_score then that means that the query is running in filter context only. So why the doc specifically mentions filter parameter inside constant_score ? What am I missing ?

1

1 Answers

0
votes

You should read this part of documentation:

https://www.elastic.co/guide/en/elasticsearch/reference/5.5/query-filter-context.html

https://www.elastic.co/guide/en/elasticsearch/reference/5.5/query-dsl-constant-score-query.html

Elasticsearch provides good explanation of your.

However, filters out constant_score will return all values that match them. Filters in constant_point, returns the result of the filter, limited by constant_score.

Regards.