ejsHasParentQuery

The has_parent query works the same as the has_parent filter, by automatically wrapping the filter with a constant_score. Results in child documents that have parent docs matching the query being returned.

Module

 HasParentQuery

HasParentQuery ( qry, parentType )
Returns results that have parent documents matching the query.

Parameters
qry <Object> A valid query object.
parentType <String> The child type

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.
ObjectinnerHits(i)Sets the inner hits options
ObjectparentType(t)Sets the child document type to search against
Objectquery(q)Sets the query
Objectscope(s)Sets the scope of the query. A scope allows to run facets on the same scope name that will work against the parent documents.
ObjectscoreMode(s)Sets the scoring method. Valid values are: none - the default, no scoring score - the score of the parent is used in all child documents.
ObjectscoreType(s)Sets the scoring method. Valid values are: none - the default, no scoring score - the score of the parent is used in all child 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

 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.

 innerHits

Object innerHits ( i )
Sets the inner hits options

Parameters
i <InnerHits> A valid InnerHits object
Returns
returns this so that calls can be chained.

 parentType

Object parentType ( t )
Sets the child document type to search against

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

 query

Object query ( q )
Sets the query

Parameters
q <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 parent 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 ( s )
Sets the scoring method. Valid values are: none - the default, no scoring score - the score of the parent is used in all child documents.

Parameters
s <String> The score type as a string.
Returns
returns this so that calls can be chained.

 scoreType

Object scoreType ( s )
Sets the scoring method. Valid values are: none - the default, no scoring score - the score of the parent is used in all child documents.

Deprecated
since elasticsearch 0.90.1 use scoreMode
Parameters
s <String> The score type as a string.
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