ejsHasChildQuery

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

Module

 HasChildQuery

HasChildQuery ( qry, type )
Returns results that have child documents matching the query.

Parameters
qry <Object> A valid query object.
type <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
ObjectmaxChildren(max)Sets the max_children value.
ObjectmaxChildren(max)Sets the max_children value.
ObjectminChildren(min)Sets the min_children value.
ObjectminChildren(min)Sets the min_children value.
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 child documents.
ObjectscoreMode(s)Sets the scoring method. Valid values are: none - the default, no scoring max - the highest score of all matched child documents is used sum - the sum the all the matched child documents is used avg - the average of all matched child documents is used
ObjectscoreType(s)Sets the scoring method. Valid values are: none - the default, no scoring max - the highest score of all matched child documents is used sum - the sum the all the matched child documents is used avg - the average of all matched child documents is used
ObjectshortCircuitCutoff(cutoff)Sets the cutoff value to short circuit processing.
StringtoJSON()Retrieves the internal query object. This is typically used by internal API functions so use with caution.
Objecttype(t)Sets the child document type to search against

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.

 maxChildren

Object maxChildren ( max )
Sets the max_children value.

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

 maxChildren

Object maxChildren ( max )
Sets the max_children value.

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

 minChildren

Object minChildren ( min )
Sets the min_children value.

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

 minChildren

Object minChildren ( min )
Sets the min_children value.

Parameters
min <Integer> A positive integer value.
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 child 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 max - the highest score of all matched child documents is used sum - the sum the all the matched child documents is used avg - the average of all matched child documents is used

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 max - the highest score of all matched child documents is used sum - the sum the all the matched child documents is used avg - the average of all matched child documents is used

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.

 shortCircuitCutoff

Object shortCircuitCutoff ( cutoff )
Sets the cutoff value to short circuit processing.

Parameters
cutoff <Integer> A positive integer value.
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.

 type

Object type ( 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.

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo