https://www.elastic.co/guide/en/elasticsearch/reference/2.4/query-filter-context.html
I'm currently running ES 2.4 working on moving to 5.6. One paradigm shift that needs to happen is the use of bool.query/bool.filter.
There are performance incentives to use filters (non-scoring, and query caching). I want to take advantage of that behavior wherever I can.
Consider the following query:
"query": {
"bool": {
"filter": {
"bool": {
"should": {
"term": {
"first_name": "bob"
}
},
"must": {
"term": {
"last_name": "smith"
}
}
}
}
}
}
Regardless of whether this is an optimal query, my question is about behavior. Normally, query.bool.must/should are scoring queries. When I run the query above, the score is normalized to 1 because it is wrapped in a filter. However, I'm curious if the underlying bool.should/must clause is still performing the scoring operations or if I've actually avoided that behavior.