Apply minimum_should_match in Elasticsearch-DSL to inner scope

Viewed 50

I have such code in Elasticsearch-DSL:

for family_samples_q in qs:
  genotypes_q |= family_samples_q

Search().query('bool', filter=[genotypes_q], minimum_should_match=2)

Unfortunately minimum_should_match applies to the outer scope, to filter (and others if I defined, say, must, another should queries, etc.) but not to inner one, not to genotypes_q list of queries. How to fix that?

0 Answers
Related