Class BoolQuery.Builder
- All Implemented Interfaces:
CopyableBuilder<BoolQuery.Builder,,BoolQuery> MutableBuilder<BoolQuery.Builder,,BoolQuery> ObjectBuilder<BoolQuery>
- Enclosing class:
BoolQuery
BoolQuery.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal BoolQuery.BuilderadjustPureNegative(Boolean value) Ensures correct behavior when a query contains onlymust_notclauses.build()Builds aBoolQuery.copy()Create a new builderCopyableBuilderthat is a copy of this one.final BoolQuery.BuilderThe clause (query) must appear in matching documents.final BoolQuery.BuilderThe clause (query) must appear in matching documents.final BoolQuery.BuilderThe clause (query) must appear in matching documents.final BoolQuery.BuilderminimumShouldMatch(String value) API name:minimum_should_matchfinal BoolQuery.BuilderThe clause (query) must appear in matching documents and will contribute to the score.final BoolQuery.BuilderThe clause (query) must appear in matching documents and will contribute to the score.final BoolQuery.BuilderThe clause (query) must appear in matching documents and will contribute to the score.final BoolQuery.BuilderThe clause (query) must not appear in the matching documents.final BoolQuery.BuilderThe clause (query) must not appear in the matching documents.final BoolQuery.BuilderThe clause (query) must not appear in the matching documents.protected BoolQuery.Builderself()final BoolQuery.BuilderThe clause (query) should appear in the matching document.final BoolQuery.BuilderThe clause (query) should appear in the matching document.final BoolQuery.BuilderThe clause (query) should appear in the matching document.Methods inherited from class org.opensearch.client.opensearch._types.query_dsl.QueryBase.AbstractBuilder
boost, queryNameMethods inherited from class org.opensearch.client.util.ObjectBuilderBase
_checkSingleUse, _listAdd, _listAddAll, _listCopy, _mapCopy, _mapPut, _mapPutAllMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.opensearch.client.util.MutableBuilder
applyMutation
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
copy
Description copied from interface:CopyableBuilderCreate a new builderCopyableBuilderthat is a copy of this one.- Specified by:
copyin interfaceCopyableBuilder<BoolQuery.Builder,BoolQuery> - Returns:
- a new builder instance.
-
self
- Specified by:
selfin classQueryBase.AbstractBuilder<BoolQuery.Builder>
-
adjustPureNegative
Ensures correct behavior when a query contains onlymust_notclauses. By default set to true, OpenSearch adds a match-all clause to ensure results are returned from Lucene, with themust_notconditions applied as filters. If set to false, the query may return no results, as Lucene typically requires at least one positive condition.API name:
adjust_pure_negative -
filter
The clause (query) must appear in matching documents. However, unlikemust, the score of the query will be ignored.API name:
filterAdds all elements of
listtofilter. -
filter
The clause (query) must appear in matching documents. However, unlikemust, the score of the query will be ignored.API name:
filterAdds one or more values to
filter. -
filter
The clause (query) must appear in matching documents. However, unlikemust, the score of the query will be ignored.API name:
filterAdds a value to
filterusing a builder lambda. -
minimumShouldMatch
API name:minimum_should_match -
must
The clause (query) must appear in matching documents and will contribute to the score.API name:
mustAdds all elements of
listtomust. -
must
The clause (query) must appear in matching documents and will contribute to the score.API name:
mustAdds one or more values to
must. -
must
The clause (query) must appear in matching documents and will contribute to the score.API name:
mustAdds a value to
mustusing a builder lambda. -
mustNot
The clause (query) must not appear in the matching documents. Because scoring is ignored, a score of0is returned for all documents.API name:
must_notAdds all elements of
listtomustNot. -
mustNot
The clause (query) must not appear in the matching documents. Because scoring is ignored, a score of0is returned for all documents.API name:
must_notAdds one or more values to
mustNot. -
mustNot
The clause (query) must not appear in the matching documents. Because scoring is ignored, a score of0is returned for all documents.API name:
must_notAdds a value to
mustNotusing a builder lambda. -
should
The clause (query) should appear in the matching document.API name:
shouldAdds all elements of
listtoshould. -
should
The clause (query) should appear in the matching document.API name:
shouldAdds one or more values to
should. -
should
The clause (query) should appear in the matching document.API name:
shouldAdds a value to
shouldusing a builder lambda. -
build
Builds aBoolQuery.- Specified by:
buildin interfaceObjectBuilder<BoolQuery>- Throws:
NullPointerException- if some of the required fields are null.
-