Bool

Boolean query

/ Bool, / Query

Boolean query #

A query that matches documents matching boolean combinations of other queries. It is built using one or more boolean clauses.

Inside a nested query: supported — must/filter/should/must_not and minimum_should_match all apply within ONE array element; clauses matched by different elements never combine.

How it works #

bool compiles each clause list into iterator algebra: must clauses intersect (AND), must_not clauses subtract, filter clauses intersect without scoring, and should clauses are probed per matched document — a streaming two-pointer walk that adds each matching should score on top of the base hit, with no intermediate materialization.

...