ejsPrefixFilter

Filters documents that have fields containing terms with a specified prefix (not analyzed). Similar to phrase query, except that it acts as a filter. Can be placed within queries that accept a filter.

Module

 PrefixFilter

PrefixFilter ( fieldName, prefix )
Filters documents that have fields containing terms with a specified prefix.

Parameters
fieldName <String> the field name to be used during matching.
prefix <String> the prefix value.

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.
Objectname(name)Sets the filter name.
Objectprefix(value)Sets the prefix to search for.
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.

 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.

 prefix

Object prefix ( value )
Sets the prefix to search for.

Parameters
value <String> the prefix value to match
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