ejsNestedQuery

Nested queries allow you to search against content within objects that are embedded inside of other objects. It is similar to XPath expressions in XML both conceptually and syntactically.

The query is executed against the nested objects / docs as if they were indexed as separate docs and resulting in the rootparent doc (or parent nested mapping).

Module

 NestedQuery

NestedQuery ( path )

Constructs a query that is capable of executing a search against objects nested within a document.


Parameters
path <String> The nested object path.

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.
Objectfilter(oFilter)Sets the nested filter to be executed.
Objectpath(path)Sets the root context for the nested query.
Objectquery(oQuery)Sets the nested query to be executed.
Objectscope(s)Sets the scope of the query. A scope allows to run facets on the same scope name that will work against the nested documents.
ObjectscoreMode(mode)Sets how the inner (nested) matches affect scoring on the parent document.
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.

 filter

Object filter ( oFilter )
Sets the nested filter to be executed.

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

 path

Object path ( path )
Sets the root context for the nested query.

Parameters
path <String> The path defining the root context for the nested query.
Returns
returns this so that calls can be chained.

 query

Object query ( oQuery )
Sets the nested query to be executed.

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

 scope

Object scope ( s )
Sets the scope of the query. A scope allows to run facets on the same scope name that will work against the nested documents.

Deprecated
since elasticsearch 0.90
Parameters
s <String> The scope name as a string.
Returns
returns this so that calls can be chained.

 scoreMode

Object scoreMode ( mode )
Sets how the inner (nested) matches affect scoring on the parent document.

Parameters
mode <String> The mode of scoring to be used for nested matches. Options are avg, total, max, none - defaults to avg
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