Skip to content
Nathan Cooke edited this page Jan 3, 2019 · 1 revision

Classes

Functions

BoolFilter ⇐ Filter

ElasticSearch Bool filter.

Kind: global class
Extends: Filter
{@link: http://www.elastic.co/guide/en/elasticsearch/reference/1.x/query-dsl-bool-filter.html|link}

ElemMatchFilter ⇐ Filter

Abstraction that mimics mongoDB's $elemMatch.

Kind: global class
Extends: Filter

Filter

Base filter class. Placeholder.

Kind: global class

GeoBoundingBoxFilter ⇐ Filter

ElasticSearch geo bounding box filter.

Kind: global class
Extends: Filter
Todo

  • implement base filter with cache control Note: lon before lat, to match GeoJson spec.

If you have 2 points [Southwest, Northeast], pass lon1, lat1, lon2, lat2

new GeoBoundingBoxFilter(termPath, west, south, east, north)

Returns: Filter - Filter object constructed. Serializes to geo filter.

Param Type Description
termPath string document path to term containing location.
west string | number Longitude of WESTERN point.
south string | number Latitude of SOUTHERN point.
east string | number Longitude of EASTERN point.
north string | number Latitude of NORTHERN point.

GeoDistanceFilter ⇐ Filter

ElasticSearch geo distance filter.

Kind: global class
Extends: Filter

new GeoDistanceFilter(distanceValue, distanceUnit, geoJsonArry, termPath, [cache])

Param Type Description
distanceValue number Distance scalar.
distanceUnit string Distance unit: See bit.ly/1yjZaiy
geoJsonArry Array.<number> [lon, lat] to match GeoJson spec.
termPath string document path to term containing location.
[cache] bool Determine whether to cache the filter. Defaults to true.

MissingFilter ⇐ Filter

Deprecated

Elasticsearch Missing filter

Kind: global class
Extends: Filter

new MissingFilter(field)

Param Type Description
field string Field for missing filter.

NestedFilter ⇐ Filter

Elasticsearch Nested filter.

Kind: global class
Extends: Filter

new NestedFilter(path, filter)

Param Type Description
path string Nest path for document to filter.
filter Filter Elastic filter instance to filter on the path.

RangeFilter ⇐ Filter

ElasticSearch Range filter.

Kind: global class
Extends: Filter

new RangeFilter(field)

Param Type Description
field string Name of field to filter.

TermFilter ⇐ Filter

Elastic Term or Terms filter. Automatically handles nested term filters if necessary.

Kind: global class
Extends: Filter

new TermFilter(fieldPath, value, [doNotNest])

Param Type Description
fieldPath string Field property - can be nested [x.y].
value any Value to match property.
[doNotNest] bool If true, will not automatically create nested term.

createNested()

This filter automatically becomes a Nested filter if it detects depth.

Kind: global function

getPath()

Gets the path to the parent object of the desired property. EX: 'w.x.y.z' returns 'w.x.y' as a string.

Kind: global function