Class BooleanQuery

java.lang.Object
com.couchbase.client.java.search.SearchQuery
com.couchbase.client.java.search.queries.BooleanQuery

public class BooleanQuery extends SearchQuery
A compound FTS query that allows various combinations of sub-queries.
Since:
2.3.0
  • Constructor Details

    • BooleanQuery

      public BooleanQuery()
  • Method Details

    • shouldMin

      public BooleanQuery shouldMin(int minForShould)
      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 as shouldMin = 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.
      In other words, if your 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 set shouldMin to a value greater than zero.
      See Also:
    • must

      public BooleanQuery must(SearchQuery... mustQueries)
    • mustNot

      public BooleanQuery mustNot(SearchQuery... mustNotQueries)
    • should

      public BooleanQuery should(SearchQuery... shouldQueries)
      See Also:
    • boost

      public BooleanQuery boost(double boost)
      Overrides:
      boost in class SearchQuery
    • toCore

      public CoreSearchQuery toCore()
      Specified by:
      toCore in class SearchQuery