plus

operator fun BoolQueryDsl.Must.plus(block: QueryVariantDsl.() -> Unit)

Operator syntax for adding queries to the must occurrence.

This provides a more concise syntax using the + operator.

Example

val document = Metamodels.product

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

See also


operator fun BoolQueryDsl.MustNot.plus(block: QueryVariantDsl.() -> Unit)

Operator syntax for adding queries to the must_not occurrence.

This provides a more concise syntax using the + operator.

Example

val document = Metamodels.product

BoolQuery.of {
it.boolQueryDsl {
mustNot + {
document.category term "discontinued"
}
}
}

See also


operator fun BoolQueryDsl.Should.plus(block: QueryVariantDsl.() -> Unit)

Operator syntax for adding queries to the should occurrence.

This provides a more concise syntax using the + operator.

Example

val document = Metamodels.product

BoolQuery.of {
it.boolQueryDsl {
should + {
document.brand term "Dell"
}
}
}

See also


operator fun BoolQueryDsl.Filter.plus(block: QueryVariantDsl.() -> Unit)

Operator syntax for adding queries to the filter occurrence.

This provides a more concise syntax using the + operator.

Example

val document = Metamodels.product

BoolQuery.of {
it.boolQueryDsl {
filter + {
document.inStock term true
}
}
}

See also