Closed ztawil closed 4 years ago
Given that both bool
(OR) queries only have should
clauses, Elasticsearch uses a minimum_should_match
of 1 by default. Check https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-bool-query.html#bool-min-should-match
If the bool query includes at least one should clause and no must or filter clauses, the default value is 1. Otherwise, the default value is 0.
So the expected output you gave is in practice the same as the one that is generated.
Hi @ztawil as told by @wouterweerkamp you probably don't need minimum_should_match
. However I added some support for passing options to operations. If you need it, you should subclass ElasticsearchQueryBuilder
and specialize _should_operation
to pass options.
Is it possible to force having a
minimum_should_match
value on anybool
values when anOR
operation is present?Currently I have something like:
And the query yields:
Whereas I'd like it to be:
But perhaps I'm doing something wrong?