ejsFilteredQuery

Filter queries allow you to restrict the results returned by a query. There are several different types of filters that can be applied (see filter module). A filterQuery takes a Query and a Filter object as arguments and constructs a new Query that is then used for the search.

Module

 FilteredQuery

FilteredQuery ( someQuery, someFilter )

A query that applies a filter to the results of another query.


Parameters
someQuery <Object> a valid Query object
someFilter <Object> a valid Filter object. This parameter is optional.

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.
Objectcache(trueFalse)

Enables caching of the filter.

ObjectcacheKey(k)

Set the cache key.

Objectfilter(oFilter)

Adds the filter to apply a constant score to.

Objectquery(oQuery)

Adds the query to apply a constant score to.

Objectstrategy(strategy)

Sets the filter strategy.

The strategy defines how the filter is applied during document collection. Valid values are:

query_first - advance query scorer first then filter
random_access_random - random access filter
leap_frog - query scorer and filter "leap-frog", query goes first
leap_frog_filter_first - same as leap_frog, but filter goes first
random_access_N - replace N with integer, same as random access except you can specify a custom threshold

This is an advanced setting, use with care.

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.

 cache

Object cache ( trueFalse )

Enables caching of the filter.


Parameters
trueFalse <Boolean> A boolean value.
Returns
returns this so that calls can be chained.

 cacheKey

Object cacheKey ( k )

Set the cache key.


Parameters
k <String> A string cache key.
Returns
returns this so that calls can be chained.

 filter

Object filter ( oFilter )

Adds the filter to apply a constant score to.


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

 query

Object query ( oQuery )

Adds the query to apply a constant score to.


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

 strategy

Object strategy ( strategy )

Sets the filter strategy.

The strategy defines how the filter is applied during document collection. Valid values are:

query_first - advance query scorer first then filter
random_access_random - random access filter
leap_frog - query scorer and filter "leap-frog", query goes first
leap_frog_filter_first - same as leap_frog, but filter goes first
random_access_N - replace N with integer, same as random access except you can specify a custom threshold

This is an advanced setting, use with care.


Parameters
strategy <String> The strategy 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