OpenSearch/docs/java-api/query-dsl/boosting-query.asciidoc

17 lines
501 B
Plaintext

[[java-query-dsl-boosting-query]]
==== Boosting Query
See {ref}/query-dsl-boosting-query.html[Boosting Query]
[source,java]
--------------------------------------------------
QueryBuilder qb = boostingQuery()
.positive(termQuery("name","kimchy")) <1>
.negative(termQuery("name","dadoonet")) <2>
.negativeBoost(0.2f); <3>
--------------------------------------------------
<1> query that will promote documents
<2> query that will demote documents
<3> negative boost