ejsTermsQuery

A query that match on any (configurable) of the provided terms. This is a simpler syntax query for using a bool query with several term queries in the should clauses.

Module

 TermsQuery

TermsQuery ( field, terms )
A Query that matches documents containing provided terms.

Parameters
field <String> the document field/key to query against
terms <String | String[]> a single term or array of "terms" to match

Method Summary

Returns Name Description
String_type()The type of ejs object. For internal use only.
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.
Objectfield(f)Sets the fields to query against.
ObjectminimumShouldMatch(minMatch)Sets the minimum number of terms that need to match in a document before that document is returned in the results.
Objectterms(t)Sets the terms. If you t is a String, it is added to the existing list of terms. If t is an array, the list of terms replaces the existing terms.
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

 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.

 field

Object field ( f )
Sets the fields to query against.

Parameters
f <String> A valid field name.
Returns
returns this so that calls can be chained.

 minimumShouldMatch

Object minimumShouldMatch ( minMatch )
Sets the minimum number of terms that need to match in a document before that document is returned in the results.

Parameters
minMatch <String> A min should match parameter.
Returns
returns this so that calls can be chained.

 terms

Object terms ( t )
Sets the terms. If you t is a String, it is added to the existing list of terms. If t is an array, the list of terms replaces the existing terms.

Parameters
t <String | String[]> A single term or an array or terms.
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