Class BooleanQuery
java.lang.Object
com.couchbase.client.java.search.SearchQuery
com.couchbase.client.java.search.queries.BooleanQuery
A compound FTS query that allows various combinations of sub-queries.
- Since:
- 2.3.0
-
Field Summary
Fields inherited from class com.couchbase.client.java.search.SearchQuery
boost
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboost
(double boost) must
(SearchQuery... mustQueries) mustNot
(SearchQuery... mustNotQueries) should
(SearchQuery... shouldQueries) shouldMin
(int minForShould) Specifies the minimum number of "should
" conditions a document has to meet in order to be included in the result set.toCore()
Methods inherited from class com.couchbase.client.java.search.SearchQuery
booleanField, booleans, conjuncts, dateRange, disjuncts, docId, export, geoBoundingBox, geoBoundingBox, geoDistance, geoDistance, geoPolygon, match, matchAll, matchNone, matchPhrase, numericRange, phrase, prefix, queryString, regexp, term, termRange, toString, wildcard
-
Constructor Details
-
BooleanQuery
public BooleanQuery()
-
-
Method Details
-
shouldMin
Specifies the minimum number of "should
" conditions a document has to meet in order to be included in the result set.The default is zero, a special value that means different things depending on whether a "
must
" condition is present:- If there is no "must" condition,
shouldMin = 0
is the same asshouldMin = 1
. In this case, a document has to meet at least one "should" condition (and none of the "mustNot
" conditions) in order to be included in the result set. - If there is a "must" condition,
shouldMin = 0
means the "should" conditions influence scoring but are not used as document selection criteria. In this case, only the "must" and "mustNot" conditions affect whether a document is included in the result set.
BooleanQuery
has "must" conditions as well as "should" conditions, and you want the "should" conditions to affect which documents are included in the result set, then call this method to setshouldMin
to a value greater than zero.- See Also:
- If there is no "must" condition,
-
must
-
mustNot
-
should
- See Also:
-
boost
- Overrides:
boost
in classSearchQuery
-
toCore
- Specified by:
toCore
in classSearchQuery
-