ejsBoolFilter

A BoolFilter allows you to build Boolean filter constructs from individual filters. Similar in concept to Boolean query, except that the clauses are other filters. Can be placed within queries that accept a filter.

Module

 BoolFilter

BoolFilter ( )
A Filter that matches documents matching boolean combinations of other filters.

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.
Objectmust(oFilter)Adds filter to boolean container. Given filter "must" appear in matching documents. If passed a single Filter it is added to the list of existing filters. If passed an array of Filters, they replace all existing filters.
ObjectmustNot(oFilter)Adds filter to boolean container. Given filter "must not" appear in matching documents. If passed a single Filter it is added to the list of existing filters. If passed an array of Filters, they replace all existing filters.
Objectname(name)Sets the filter name.
Objectshould(oFilter)Adds filter to boolean container. Given filter "should" appear in matching documents. If passed a single Filter it is added to the list of existing filters. If passed an array of Filters, they replace all existing filters.
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.

 must

Object must ( oFilter )
Adds filter to boolean container. Given filter "must" appear in matching documents. If passed a single Filter it is added to the list of existing filters. If passed an array of Filters, they replace all existing filters.

Parameters
oFilter <Filter | Filter[]> A valid Filter or array of Filter objects.
Returns
returns this so that calls can be chained.

 mustNot

Object mustNot ( oFilter )
Adds filter to boolean container. Given filter "must not" appear in matching documents. If passed a single Filter it is added to the list of existing filters. If passed an array of Filters, they replace all existing filters.

Parameters
oFilter <Filter | Filter[]> A valid Filter or array of Filter objects.
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.

 should

Object should ( oFilter )
Adds filter to boolean container. Given filter "should" appear in matching documents. If passed a single Filter it is added to the list of existing filters. If passed an array of Filters, they replace all existing filters.

Parameters
oFilter <Filter | Filter[]> A valid Filter or array of Filter objects.
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