A newer version of this documentation is available.

View Latest

Conjunction & Disjunction Query

      +

      Conjunction Query (AND)

      A conjunction query contains multiple child queries. Its result documents must satisfy all of the child queries.

      {
       "conjuncts":[
         {"field":"reviews.content", "match": "location"},
         {"field":"free_breakfast", "bool": true}
       ]
      }

      A demonstration of a conjunction query using the Java SDK can be found in Searching from the SDK.

      Disjunction Query (OR)

      A disjunction query contains multiple child queries. Its result documents must satisfy a configurable min number of child queries. By default this min is set to 1. For example, if three child queries — A, B, and C — are specified, a min of 1 specifies that the result documents should be those returned uniquely for A (with all returned uniquely for B and C, and all returned commonly for A, B, and C, omitted).

      {
       "disjuncts":[
         {"field":"reviews.content", "match": "location"},
         {"field":"free_breakfast", "bool": true}
       ]
      }

      A demonstration of a disjunction query using the Java SDK can be found in Searching from the SDK.