mustDsl

fun mustDsl(block: QueryVariantDsl.() -> Unit)

Adds queries to the must occurrence.

Documents must match all queries in this occurrence. These queries affect the relevance score.

Example

val document = Metamodels.product

BoolQuery.of {
it.boolQueryDsl {
mustDsl {
document.title match "laptop"
document.status term Status.ACTIVE
}
}
}

See also

for available query types