ejsBoolQuery

A boolQuery allows you to build Boolean query constructs from individual term or phrase queries. For example you might want to search for documents containing the terms javascript and python.

Module

 BoolQuery

BoolQuery ( )
A Query that matches documents matching boolean combinations of other queries, e.g. termQuerys, phraseQuerys or other boolQuerys.

Method Summary

Returns Name Description
String_type()The type of ejs object. For internal use only.
ObjectadjustPureNegative(trueFalse)Sets if the Query should be enhanced with a MatchAllQuery in order to act as a pure exclude when only negative (mustNot) clauses exist. Default: true.
Objectboost(boost)Sets the boost value for documents matching the Query.
ObjectdisableCoord(trueFalse)Enables or disables similarity coordinate scoring of documents matching the Query. Default: false.
ObjectminimumNumberShouldMatch(minMatch)

Sets the number of optional clauses that must match.

By default no optional clauses are necessary for a match (unless there are no required clauses). If this method is used, then the specified number of clauses is required.

Use of this method is totally independent of specifying that any specific clauses are required (or prohibited). This number will only be compared against the number of matching optional clauses.

Objectmust(oQuery)Adds query to boolean container. Given query "must" appear in matching documents.
ObjectmustNot(oQuery)Adds query to boolean container. Given query "must not" appear in matching documents.
Objectshould(oQuery)Adds query to boolean container. Given query "should" appear in matching documents.
StringtoJSON()Retrieves the internal query object. This is typically used by internal API functions so use with caution.

Method Detail

 _type

String _type ( )
The type of ejs object. For internal use only.

Returns
the type of object

 adjustPureNegative

Object adjustPureNegative ( trueFalse )
Sets if the Query should be enhanced with a MatchAllQuery in order to act as a pure exclude when only negative (mustNot) clauses exist. Default: true.

Parameters
trueFalse <String> A true/false
Returns
returns this so that calls can be chained.

 boost

Object boost ( boost )
Sets the boost value for documents matching the Query.

Parameters
boost <Double> A positive double value.
Returns
returns this so that calls can be chained.

 disableCoord

Object disableCoord ( trueFalse )
Enables or disables similarity coordinate scoring of documents matching the Query. Default: false.

Parameters
trueFalse <String> A true/false
Returns
returns this so that calls can be chained.

 minimumNumberShouldMatch

Object minimumNumberShouldMatch ( minMatch )

Sets the number of optional clauses that must match.

By default no optional clauses are necessary for a match (unless there are no required clauses). If this method is used, then the specified number of clauses is required.

Use of this method is totally independent of specifying that any specific clauses are required (or prohibited). This number will only be compared against the number of matching optional clauses.


Parameters
minMatch <Integer> A positive integer value.
Returns
returns this so that calls can be chained.

 must

Object must ( oQuery )
Adds query to boolean container. Given query "must" appear in matching documents.

Parameters
oQuery <Object> A valid Query object
Returns
returns this so that calls can be chained.

 mustNot

Object mustNot ( oQuery )
Adds query to boolean container. Given query "must not" appear in matching documents.

Parameters
oQuery <Object> A valid query object
Returns
returns this so that calls can be chained.

 should

Object should ( oQuery )
Adds query to boolean container. Given query "should" appear in matching documents.

Parameters
oQuery <Object> A valid query object
Returns
returns this so that calls can be chained.

 toJSON

String toJSON ( )
Retrieves the internal query object. This is typically used by internal API functions so use with caution.

Returns
returns this object's internal query property.

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo