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

ElasticQuery

ElasticSearch Query. Top level object used to create an elasticsearch query object.

Kind: global class

elasticQuery.setQuery(query)

Sets the query to an instance of an Elastic query.

Kind: instance method of ElasticQuery

Param Type Description
query Filter instance of ./elasticsearch/queries query.

elasticQuery.setFilter(filter)

Sets the query filter to an instance of an Elastic Filter.

Kind: instance method of ElasticQuery

Param Type Description
filter Filter instance of ./elasticsearch/filters filter.

elasticQuery.setPostFilter(postFilter)

Sets the post_filter to an instance of an Elastic Filter.

Kind: instance method of ElasticQuery

Param Type Description
postFilter Filter instance of ./elasticsearch/filters filter.

elasticQuery.setSort()

Sets the sort to the specified field name (also supports _doc for natural sort).

Kind: instance method of ElasticQuery

elasticQuery.setIncludeFields(includes)

Tells which source fields to include.

Kind: instance method of ElasticQuery

Param Type Description
includes string | Array.<string> | boolean Fields to include in source. Set to false instead of array to not return _source.

elasticQuery.setExcludeFields(excludes)

Tells which source field or fields to exclude.

Kind: instance method of ElasticQuery

Param Type Description
excludes string | Array.<string> Fields to exclude in source.

elasticQuery.addAggregation(aggObject, [aggName])

Adds an Elasticsearch Aggregation object to the query.

Kind: instance method of ElasticQuery

Param Type Description
aggObject Aggregation Instance of Aggregation object.
[aggName] string Name of aggregation - optional.

elasticQuery.disableTermCaching()

Deprecated

Sets _cache = false on all term and terms filter params Only applied during serialization.

Kind: instance method of ElasticQuery