ejsHasParentFilter

The has_parent results in child documents that have parent docs matching the query being returned.

Module

 HasParentFilter

HasParentFilter ( qryOrFltr, parentType )
Returns results that have parent documents matching the filter.

Parameters
qryOrFltr <Object> A valid query or filter object.
parentType <String> The child type

Method Summary

Returns Name Description
String_type()The type of ejs object. For internal use only.
Objectcache(trueFalse)Enable or disable caching of the filter
ObjectcacheKey(key)Sets the cache key.
Objectfilter(f)Sets the filter
ObjectinnerHits(i)Sets the inner hits options
Objectname(name)Sets the filter name.
ObjectparentType(t)Sets the child document type to search against
Objectquery(q)Sets the query
Objectscope(s)Sets the scope of the filter. A scope allows to run facets on the same scope name that will work against the parent documents.
ObjecttoJSON()Returns the filter object.

Method Detail

 _type

String _type ( )
The type of ejs object. For internal use only.

Returns
the type of object

 cache

Object cache ( trueFalse )
Enable or disable caching of the filter

Parameters
trueFalse <Boolean> True to cache the filter, false otherwise.
Returns
returns this so that calls can be chained.

 cacheKey

Object cacheKey ( key )
Sets the cache key.

Parameters
key <String> the cache key as a string.
Returns
returns this so that calls can be chained.

 filter

Object filter ( f )
Sets the filter

Since
elasticsearch 0.90
Parameters
f <Object> A valid Filter object
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.

 name

Object name ( name )
Sets the filter name.

Parameters
name <String> A name for the filter.
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 filter. 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.

 toJSON

Object toJSON ( )
Returns the filter object.

Returns
filter object

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo