ejsNumericRangeFilter

Filters documents with fields that have values within a certain numeric range. Similar to range filter, except that it works only with numeric values, and the filter execution works differently.

The numeric range filter works by loading all the relevant field values into memory, and checking for the relevant docs if they satisfy the range requirements. This requires more memory since the numeric range data are loaded to memory, but can provide a significant increase in performance.

Note, if the relevant field values have already been loaded to memory, for example because it was used in facets or was sorted on, then this filter should be used.

Module

 NumericRangeFilter

NumericRangeFilter ( fieldName )
A Filter that only accepts numeric values within a specified range.

Parameters
fieldName <String> The name of the field to filter on.

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.
Objectfield(field)Returns the field name used to create this object.
Objectfrom(startPoint)Sets the endpoint for the current range.
Objectgt(val)Greater than value. Same as setting from to the value, and include_lower to false,
Objectgte(val)Greater than or equal to value. Same as setting from to the value, and include_lower to true.
ObjectincludeLower(trueFalse)Should the first from (if set) be inclusive or not. Defaults to true
ObjectincludeUpper(trueFalse)Should the last to (if set) be inclusive or not. Defaults to true.
Objectlt(val)Less than value. Same as setting to to the value, and include_upper to false.
Objectlte(val)Less than or equal to value. Same as setting to to the value, and include_upper to true.
Objectname(name)Sets the filter name.
Objectto(endPoint)Sets the endpoint for the current range.
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.

 field

Object field ( field )
Returns the field name used to create this object.

Parameters
field <String> the field name
Returns
returns this so that calls can be chained. Returns {String}, field name when field is not specified.

 from

Object from ( startPoint )
Sets the endpoint for the current range.

Parameters
startPoint <Number> A numeric value representing the start of the range
Returns
returns this so that calls can be chained.

 gt

Object gt ( val )
Greater than value. Same as setting from to the value, and include_lower to false,

Parameters
val <*> the value, type depends on field type
Returns
returns this so that calls can be chained.

 gte

Object gte ( val )
Greater than or equal to value. Same as setting from to the value, and include_lower to true.

Parameters
val <*> the value, type depends on field type
Returns
returns this so that calls can be chained.

 includeLower

Object includeLower ( trueFalse )
Should the first from (if set) be inclusive or not. Defaults to true

Parameters
trueFalse <Boolean> true to include, false to exclude
Returns
returns this so that calls can be chained.

 includeUpper

Object includeUpper ( trueFalse )
Should the last to (if set) be inclusive or not. Defaults to true.

Parameters
trueFalse <Boolean> true to include, false to exclude
Returns
returns this so that calls can be chained.

 lt

Object lt ( val )
Less than value. Same as setting to to the value, and include_upper to false.

Parameters
val <*> the value, type depends on field type
Returns
returns this so that calls can be chained.

 lte

Object lte ( val )
Less than or equal to value. Same as setting to to the value, and include_upper to true.

Parameters
val <*> the value, type depends on field type
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.

 to

Object to ( endPoint )
Sets the endpoint for the current range.

Parameters
endPoint <Number> A numeric value representing the end of the range
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