plus
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
}
}
}Content copied to clipboard
See also
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"
}
}
}Content copied to clipboard
See also
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"
}
}
}Content copied to clipboard
See also
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
}
}
}Content copied to clipboard