ejsIndicesQuery

The indices query can be used when executed across multiple indices, allowing to have a query that executes only when executed on an index that matches a specific list of indices, and another query that executes when it is executed on an index that does not match the listed indices.

Module

 IndicesQuery

IndicesQuery ( qry, indices )
A configurable query that is dependent on the index name.

Parameters
qry <Query> A valid query object.
indices <String | String[]> a single index name or an array of index names.

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.
Objectindices(i)Sets the indicies the query should match. When passed a string, the index name is added to the current list of indices. When passed an array, it overwites all current indices.
ObjectnoMatchQuery(q)Sets the query to be used on an index that does not match an index name in the indices list. Can also be set to "none" to not match any documents or "all" to match all documents.
Objectquery(q)Sets the query to be executed against the indices specified.
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.

 indices

Object indices ( i )
Sets the indicies the query should match. When passed a string, the index name is added to the current list of indices. When passed an array, it overwites all current indices.

Parameters
i <String | String[]> A single index name or an array of index names.
Returns
returns this so that calls can be chained.

 noMatchQuery

Object noMatchQuery ( q )
Sets the query to be used on an index that does not match an index name in the indices list. Can also be set to "none" to not match any documents or "all" to match all documents.

Parameters
q <Query | String> A valid Query object or "none" or "all"
Returns
returns this so that calls can be chained.

 query

Object query ( q )
Sets the query to be executed against the indices specified.

Parameters
q <Query> 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