diff --git a/.gitignore b/.gitignore index f8a0a25..40b878d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ -dist/docs -node_modules/ +node_modules/ \ No newline at end of file diff --git a/README.md b/README.md index 13b3ca3..dab2b13 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,17 @@ +elastic.js can be used with elasticsearch 2.x and lower. +There were several [breaking changes](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/breaking_50_search_changes.html) in the 5.x release for the Query DSL. + +You can try [elastic-builder](https://github.com/sudo-suhas/elastic-builder) for elasticsearch version >= 5.x. + +doc is here : https://cdn.rawgit.com/ErwanPigneul/elastic.js/master/dist/docs/ejs.html + + + + + # elastic.js -A JavaScript implementation of the [ElasticSearch](http://www.elasticsearch.org/) DSL for use with the [official elasticsearch javascript client](http://www.elasticsearch.org/guide/en/elasticsearch/client/javascript-api/current/index.html). +A JavaScript implementation of the [ElasticSearch](http://www.elasticsearch.org/) DSL for use with the [official elasticsearch javascript client](http://www.elasticsearch.org/guide/en/elasticsearch/client/javascript-api/current/index.html). ## Documentation You can find the official documentation at the following locations: @@ -64,6 +75,12 @@ In lieu of a formal styleguide, take care to maintain the existing coding style. _Also, please don't edit elastic.js and elastic.min.js files as they are generated via grunt. You'll find source code in the "src" subdirectory!_ +## Some tips (memo) +cd docs/ +./build.sh + +## + ## License Copyright (c) 2012-2014 FullScale Labs, LLC Licensed under the MIT license. diff --git a/bower.json b/bower.json index 19dceeb..786ae16 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "elastic.js", - "version": "1.2.0", + "version": "1.3.8", "description": "Javascript API for ElasticSearch DSL", "license": "MIT", "keywords": [ diff --git a/dist/docs/ejs.AggregationMixin.html b/dist/docs/ejs.AggregationMixin.html new file mode 100644 index 0000000..31f7fbc --- /dev/null +++ b/dist/docs/ejs.AggregationMixin.html @@ -0,0 +1,504 @@ + + + + + elastic.js: Mixin: AggregationMixin + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsAggregationMixin
+

+ + +
+ +
+
+
+ + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectagg(agg)Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method.
Objectaggregation(agg)Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation.
StringtoJSON()

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.

+
+ +

Method Detail

+ + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 agg

+
+ + Object agg ( agg ) + + +
Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + agg + + + <Aggregation> + + + + + + Any valid Aggregation object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 aggregation

+
+ + Object aggregation ( agg ) + + +
Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + agg + + + <Aggregation> + + + + + + Any valid Aggregation object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal object. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.AndFilter.html b/dist/docs/ejs.AndFilter.html new file mode 100644 index 0000000..d17e21a --- /dev/null +++ b/dist/docs/ejs.AndFilter.html @@ -0,0 +1,705 @@ + + + + + elastic.js: Module: AndFilter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsAndFilter
+

+ +

A container Filter that allows Boolean AND composition of Filters.

+
+ +
+

Module

+
+
+ +

 AndFilter

+
+ + AndFilter ( f ) + + +
A container Filter that allows Boolean AND composition of Filters.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + f + + + <Filter | Filter[]> + + + + + + A single Filter object or an array of valid + Filter objects. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
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.
Objectfilters(fltr)Sets the filters for the filter. If fltr is a single + Filter, it is added to the current filters. If fltr is an array + of Filters, then they replace all existing filters.
Objectname(name)Sets the filter name.
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. + + + +
+ + + +
+ +
+
+
+ +

 filters

+
+ + Object filters ( fltr ) + + +
Sets the filters for the filter. If fltr is a single + Filter, it is added to the current filters. If fltr is an array + of Filters, then they replace all existing filters.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + fltr + + + <Filter | Filter[]> + + + + + + A valid filter object or an array of filters. +
+ + +
+ + + + + + +
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. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + Object toJSON ( ) + + +
Returns the filter object.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ filter object + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.AvgAggregation.html b/dist/docs/ejs.AvgAggregation.html new file mode 100644 index 0000000..c6b557c --- /dev/null +++ b/dist/docs/ejs.AvgAggregation.html @@ -0,0 +1,869 @@ + + + + + elastic.js: Module: AvgAggregation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsAvgAggregation
+

+ +

A single-value metrics aggregation that computes the average of numeric + values that are extracted from the aggregated documents. These values can be + extracted either from specific numeric fields in the documents, or be + generated by a provided script.

+
+ +
+

Module

+
+
+ +

 AvgAggregation

+
+ + AvgAggregation ( name ) + + +

Aggregation that computes the average of numeric values that are extracted + from the aggregated documents.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + name + + + <String> + + + + + + The name which be used to refer to this aggregation. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectfield(field)

Sets the field to operate on.

Objectlang(language)The script language being used.
Objectparams(p)Sets parameters that will be applied to the script. Overwrites + any existing params.
Objectscript(scriptCode)Allows you generate or modify the terms/values using a script.
ObjectscriptFile(scriptFile)Allows you generate or modify the terms/values using a script.
ObjectscriptId(scriptId)Allows you generate or modify the terms/values using a script.
StringtoJSON()

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.

+
+ +

Method Detail

+ + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( field ) + + +

Sets the field to operate on.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + field + + + <String> + + + + + + a valid field name.. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 lang

+
+ + Object lang ( language ) + + +
The script language being used.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + language + + + <String> + + + + + + The language of the script. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 params

+
+ + Object params ( p ) + + +
Sets parameters that will be applied to the script. Overwrites + any existing params.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + p + + + <Object> + + + + + + An object where the keys are the parameter name and + values are the parameter value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 script

+
+ + Object script ( scriptCode ) + + +
Allows you generate or modify the terms/values using a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptCode + + + <String> + + + + + + A valid script string to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scriptFile

+
+ + Object scriptFile ( scriptFile ) + + +
Allows you generate or modify the terms/values using a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptFile + + + <String> + + + + + + A valid script file to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scriptId

+
+ + Object scriptId ( scriptId ) + + +
Allows you generate or modify the terms/values using a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptId + + + <String> + + + + + + A valid script id to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal object. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.BoolFilter.html b/dist/docs/ejs.BoolFilter.html new file mode 100644 index 0000000..ba70806 --- /dev/null +++ b/dist/docs/ejs.BoolFilter.html @@ -0,0 +1,868 @@ + + + + + elastic.js: Module: BoolFilter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
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

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
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

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.BoolQuery.html b/dist/docs/ejs.BoolQuery.html new file mode 100644 index 0000000..58a1df8 --- /dev/null +++ b/dist/docs/ejs.BoolQuery.html @@ -0,0 +1,950 @@ + + + + + elastic.js: Module: BoolQuery + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsBoolQuery
+

+ +

A boolQuery allows you to build Boolean query constructs + from individual term or phrase queries. For example you might want to search + for documents containing the terms javascript and python.

+
+ +
+

Module

+
+
+ +

 BoolQuery

+
+ + BoolQuery ( ) + + +
A Query that matches documents matching boolean combinations of other + queries, e.g. termQuerys, phraseQuerys or other boolQuerys.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
ObjectadjustPureNegative(trueFalse)Sets if the Query should be enhanced with a + MatchAllQuery in order to act as a pure exclude when + only negative (mustNot) clauses exist. Default: true.
Objectboost(boost)Sets the boost value for documents matching the Query.
ObjectdisableCoord(trueFalse)Enables or disables similarity coordinate scoring of documents + matching the Query. Default: false.
ObjectminimumNumberShouldMatch(minMatch)

Sets the number of optional clauses that must match.

+ +

By default no optional clauses are necessary for a match + (unless there are no required clauses). If this method is used, + then the specified number of clauses is required.

+ +

Use of this method is totally independent of specifying that + any specific clauses are required (or prohibited). This number will + only be compared against the number of matching optional clauses.

Objectmust(oQuery)Adds query to boolean container. Given query "must" appear in matching documents.
ObjectmustNot(oQuery)Adds query to boolean container. Given query "must not" appear in matching documents.
Objectshould(oQuery)Adds query to boolean container. Given query "should" appear in matching documents.
StringtoJSON()Retrieves the internal query object. This is typically used by + internal API functions so use with caution.
+
+ +

Method Detail

+ + + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 adjustPureNegative

+
+ + Object adjustPureNegative ( trueFalse ) + + +
Sets if the Query should be enhanced with a + MatchAllQuery in order to act as a pure exclude when + only negative (mustNot) clauses exist. Default: true.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <String> + + + + + + A true/false +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 boost

+
+ + Object boost ( boost ) + + +
Sets the boost value for documents matching the Query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + boost + + + <Double> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 disableCoord

+
+ + Object disableCoord ( trueFalse ) + + +
Enables or disables similarity coordinate scoring of documents + matching the Query. Default: false.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <String> + + + + + + A true/false +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 minimumNumberShouldMatch

+
+ + Object minimumNumberShouldMatch ( minMatch ) + + +

Sets the number of optional clauses that must match.

+ +

By default no optional clauses are necessary for a match + (unless there are no required clauses). If this method is used, + then the specified number of clauses is required.

+ +

Use of this method is totally independent of specifying that + any specific clauses are required (or prohibited). This number will + only be compared against the number of matching optional clauses.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + minMatch + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 must

+
+ + Object must ( oQuery ) + + +
Adds query to boolean container. Given query "must" appear in matching documents.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + oQuery + + + <Object> + + + + + + A valid Query object +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 mustNot

+
+ + Object mustNot ( oQuery ) + + +
Adds query to boolean container. Given query "must not" appear in matching documents.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + oQuery + + + <Object> + + + + + + A valid query object +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 should

+
+ + Object should ( oQuery ) + + +
Adds query to boolean container. Given query "should" appear in matching documents.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + oQuery + + + <Object> + + + + + + A valid query object +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +
Retrieves the internal query object. This is typically used by + internal API functions so use with caution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal query property. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.BoostFactorScoreFunction.html b/dist/docs/ejs.BoostFactorScoreFunction.html new file mode 100644 index 0000000..bd03a3d --- /dev/null +++ b/dist/docs/ejs.BoostFactorScoreFunction.html @@ -0,0 +1,544 @@ + + + + + elastic.js: Module: BoostFactorScoreFunction + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsBoostFactorScoreFunction
+

+ +

The boost_factor score allows you to multiply the score by the provided + boost_factor. This can sometimes be desired since boost value set on specific + queries gets normalized, while for this score function it does not.

+
+ +
+

Module

+
+
+ +

 BoostFactorScoreFunction

+
+ + BoostFactorScoreFunction ( boostVal ) + + +

Multiply the score by the provided boost_factor.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + boostVal + + + <Float> + + + + + + the boost factor. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectboost(b)Sets the boost factor.
Objectfilter(oFilter)Adds a filter whose matching documents will have the score function applied.
StringtoJSON()

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.

+
+ +

Method Detail

+ + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 boost

+
+ + Object boost ( b ) + + +
Sets the boost factor.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + b + + + <Float> + + + + + + the boost factor. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 filter

+
+ + Object filter ( oFilter ) + + +
Adds a filter whose matching documents will have the score function applied.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + oFilter + + + <Filter> + + + + + + Any valid Filter object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal object. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.BoostingQuery.html b/dist/docs/ejs.BoostingQuery.html new file mode 100644 index 0000000..3f5a35a --- /dev/null +++ b/dist/docs/ejs.BoostingQuery.html @@ -0,0 +1,742 @@ + + + + + elastic.js: Module: BoostingQuery + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsBoostingQuery
+

+ +

The boosting query can be used to effectively demote results that match + a given query. Unlike the “NOT†clause in bool query, this still selects + documents that contain undesirable terms, but reduces their overall + score.

+
+ +
+

Module

+
+
+ +

 BoostingQuery

+
+ + BoostingQuery ( positiveQry, negativeQry, negativeBoost ) + + +

Constructs a query that can demote search results. A negative boost.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + positiveQry + + + <Object> + + + + + + Valid query object used to select all matching docs. +
+ + + + + negativeQry + + + <Object> + + + + + + Valid query object to match the undesirable docs + returned within the positiveQry result set. +
+ + + + + negativeBoost + + + <Double> + + + + + + A double value where 0 < n < 1. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectboost(boost)Sets the boost value for documents matching the Query.
Objectnegative(oQuery)Sets the query used to match documents in the positive + query that will be negatively boosted.
ObjectnegativeBoost(boost)Sets the negative boost value.
Objectpositive(oQuery)Sets the "master" query that determines which results are returned.
StringtoJSON()Retrieves the internal query object. This is typically used by + internal API functions so use with caution.
+
+ +

Method Detail

+ + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 boost

+
+ + Object boost ( boost ) + + +
Sets the boost value for documents matching the Query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + boost + + + <Double> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 negative

+
+ + Object negative ( oQuery ) + + +
Sets the query used to match documents in the positive + query that will be negatively boosted.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + oQuery + + + <Object> + + + + + + A valid Query object +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be + chained. Returns {Object} current negative query if oQuery is + not specified. + + + +
+ + + +
+ +
+
+
+ +

 negativeBoost

+
+ + Object negativeBoost ( boost ) + + +
Sets the negative boost value.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + boost + + + <Double> + + + + + + A positive double value where 0 < n < 1. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 positive

+
+ + Object positive ( oQuery ) + + +
Sets the "master" query that determines which results are returned.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + oQuery + + + <Object> + + + + + + A valid Query object +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be + chained. Returns {Object} current positive query if oQuery is + not specified. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +
Retrieves the internal query object. This is typically used by + internal API functions so use with caution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal query property. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.BucketsAggregationMixin.html b/dist/docs/ejs.BucketsAggregationMixin.html new file mode 100644 index 0000000..65afebf --- /dev/null +++ b/dist/docs/ejs.BucketsAggregationMixin.html @@ -0,0 +1,987 @@ + + + + + elastic.js: Mixin: BucketsAggregationMixin + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsBucketsAggregationMixin
+

+ + +
+ +
+
+
+ + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectagg(agg)Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method.
Objectaggregation(agg)Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation.
Objectfield(field)

Sets the field to operate on.

Objectlang(language)The script language being used.
Objectparams(p)Sets parameters that will be applied to the script. Overwrites + any existing params.
Objectscript(scriptCode)Allows you generate or modify the terms/values using a script.
ObjectscriptFile(scriptFile)Allows you generate or modify the terms/values using a script.
ObjectscriptId(scriptId)Allows you generate or modify the terms/values using a script.
StringtoJSON()

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.

+
+ +

Method Detail

+ + + + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 agg

+
+ + Object agg ( agg ) + + +
Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + agg + + + <Aggregation> + + + + + + Any valid Aggregation object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 aggregation

+
+ + Object aggregation ( agg ) + + +
Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + agg + + + <Aggregation> + + + + + + Any valid Aggregation object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( field ) + + +

Sets the field to operate on.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + field + + + <String> + + + + + + a valid field name.. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 lang

+
+ + Object lang ( language ) + + +
The script language being used.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + language + + + <String> + + + + + + The language of the script. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 params

+
+ + Object params ( p ) + + +
Sets parameters that will be applied to the script. Overwrites + any existing params.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + p + + + <Object> + + + + + + An object where the keys are the parameter name and + values are the parameter value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 script

+
+ + Object script ( scriptCode ) + + +
Allows you generate or modify the terms/values using a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptCode + + + <String> + + + + + + A valid script string to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scriptFile

+
+ + Object scriptFile ( scriptFile ) + + +
Allows you generate or modify the terms/values using a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptFile + + + <String> + + + + + + A valid script file to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scriptId

+
+ + Object scriptId ( scriptId ) + + +
Allows you generate or modify the terms/values using a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptId + + + <String> + + + + + + A valid script id to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal object. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.CardinalityAggregation.html b/dist/docs/ejs.CardinalityAggregation.html new file mode 100644 index 0000000..3007fa2 --- /dev/null +++ b/dist/docs/ejs.CardinalityAggregation.html @@ -0,0 +1,1039 @@ + + + + + elastic.js: Module: CardinalityAggregation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsCardinalityAggregation
+

+ +

A single-value metrics aggregation that calculates an approximate count of + distinct values. Values can be extracted either from specific fields in the + document or generated by a script.

+
+ +
+

Module

+
+
+ +

 CardinalityAggregation

+
+ + CardinalityAggregation ( name ) + + +

Aggregation that calculates an approximate count of distinct values.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + name + + + <String> + + + + + + The name which be used to refer to this aggregation. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectfield(field)

Sets the field to operate on.

Objectlang(language)The script language being used.
Objectparams(p)Sets parameters that will be applied to the script. Overwrites + any existing params.
ObjectprecisionThreshold(num)Allows to trade memory for accuracy, and defines a unique count below which + counts are expected to be close to accurate. Above this value, counts might + become a bit more fuzzy. The maximum supported value is 40000, thresholds + above this number will have the same effect as a threshold of 40000. + Default value depends on the number of parent aggregations that multiple + create buckets (such as terms or histograms).
Objectrehash(trueFalse)Set to false to disable rehashing of values. You must have computed a hash + on the client-side and stored it into your documents if you disable this.
Objectscript(scriptCode)Allows you generate or modify the terms/values using a script.
ObjectscriptFile(scriptFile)Allows you generate or modify the terms/values using a script.
ObjectscriptId(scriptId)Allows you generate or modify the terms/values using a script.
StringtoJSON()

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.

+
+ +

Method Detail

+ + + + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( field ) + + +

Sets the field to operate on.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + field + + + <String> + + + + + + a valid field name.. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 lang

+
+ + Object lang ( language ) + + +
The script language being used.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + language + + + <String> + + + + + + The language of the script. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 params

+
+ + Object params ( p ) + + +
Sets parameters that will be applied to the script. Overwrites + any existing params.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + p + + + <Object> + + + + + + An object where the keys are the parameter name and + values are the parameter value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 precisionThreshold

+
+ + Object precisionThreshold ( num ) + + +
Allows to trade memory for accuracy, and defines a unique count below which + counts are expected to be close to accurate. Above this value, counts might + become a bit more fuzzy. The maximum supported value is 40000, thresholds + above this number will have the same effect as a threshold of 40000. + Default value depends on the number of parent aggregations that multiple + create buckets (such as terms or histograms).

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + num + + + <Long> + + + + + + The threshold value +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 rehash

+
+ + Object rehash ( trueFalse ) + + +
Set to false to disable rehashing of values. You must have computed a hash + on the client-side and stored it into your documents if you disable this.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + set to false to disable rehashing +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 script

+
+ + Object script ( scriptCode ) + + +
Allows you generate or modify the terms/values using a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptCode + + + <String> + + + + + + A valid script string to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scriptFile

+
+ + Object scriptFile ( scriptFile ) + + +
Allows you generate or modify the terms/values using a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptFile + + + <String> + + + + + + A valid script file to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scriptId

+
+ + Object scriptId ( scriptId ) + + +
Allows you generate or modify the terms/values using a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptId + + + <String> + + + + + + A valid script id to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal object. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.ChildrenAggregation.html b/dist/docs/ejs.ChildrenAggregation.html new file mode 100644 index 0000000..6c8dd21 --- /dev/null +++ b/dist/docs/ejs.ChildrenAggregation.html @@ -0,0 +1,634 @@ + + + + + elastic.js: Module: ChildrenAggregation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsChildrenAggregation
+

+ +

A special single bucket aggregation that enables aggregating children + documents.

+
+ +
+

Module

+
+
+ +

 ChildrenAggregation

+
+ + ChildrenAggregation ( name ) + + +

A special single bucket aggregation that enables aggregating children + documents.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + name + + + <String> + + + + + + The name which be used to refer to this aggregation. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectagg(agg)Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method.
Objectaggregation(agg)Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation.
Objectchildren(children)

Sets the children type.

StringtoJSON()

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.

+
+ +

Method Detail

+ + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 agg

+
+ + Object agg ( agg ) + + +
Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + agg + + + <Aggregation> + + + + + + Any valid Aggregation object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 aggregation

+
+ + Object aggregation ( agg ) + + +
Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + agg + + + <Aggregation> + + + + + + Any valid Aggregation object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 children

+
+ + Object children ( children ) + + +

Sets the children type.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + children + + + <String> + + + + + + The children type value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal object. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.CommonTermsQuery.html b/dist/docs/ejs.CommonTermsQuery.html new file mode 100644 index 0000000..79696c8 --- /dev/null +++ b/dist/docs/ejs.CommonTermsQuery.html @@ -0,0 +1,1220 @@ + + + + + elastic.js: Module: CommonTermsQuery + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsCommonTermsQuery
+

+ +

A query that executes high-frequency terms in a optional sub-query to + prevent slow queries due to "common" terms like stopwords.

+ +

This query basically builds two queries out of the terms in the query + string where low-frequency terms are added to a required boolean clause and + high-frequency terms are added to an optional boolean clause. The optional + clause is only executed if the required "low-frequency' clause matches.

+ +

CommonTermsQuery has several advantages over stopword + filtering at index or query time since a term can be "classified" based on + the actual document frequency in the index and can prevent slow queries even + across domains without specialized stopword files.

+
+ +
+

Module

+
+
+ +

 CommonTermsQuery

+
+ + CommonTermsQuery ( field, qstr ) + + +
A query that executes high-frequency terms in a optional sub-query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + field + + + <String> + + + + + + the document field/key to query against +
+ + + + + qstr + + + <String> + + + + + + the query string +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectanalyzer(analyzer)Sets the analyzer name used to analyze the Query object.
Objectboost(boost)Sets the boost value for documents commoning the Query.
ObjectcutoffFrequency(freq)Sets the maximum threshold/frequency to be considered a low + frequency term. Set to a value between 0 and 1.
ObjectdisableCoord(trueFalse)Enables or disables similarity coordinate scoring of documents + commoning the Query. Default: false.
Objectfield(f)Sets the field to query against.
ObjecthighFreqOperator(op)Sets the boolean operator to be used for high frequency terms. + Default: AND
ObjectlowFreqOperator(op)Sets the boolean operator to be used for low frequency terms. + Default: AND
ObjectminimumShouldMatchHighFreq(min)Sets the minimum number of high freq matches that need to match in + a document before that document is returned in the results.
ObjectminimumShouldMatchLowFreq(min)Sets the minimum number of low freq matches that need to match in + a document before that document is returned in the results.
Objectquery(qstr)Sets the query string.
StringtoJSON()Retrieves the internal query object. This is typically used by + internal API functions so use with caution.
+
+ +

Method Detail

+ + + + + + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 analyzer

+
+ + Object analyzer ( analyzer ) + + +
Sets the analyzer name used to analyze the Query object.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + analyzer + + + <String> + + + + + + A valid analyzer name. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 boost

+
+ + Object boost ( boost ) + + +
Sets the boost value for documents commoning the Query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + boost + + + <Number> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 cutoffFrequency

+
+ + Object cutoffFrequency ( freq ) + + +
Sets the maximum threshold/frequency to be considered a low + frequency term. Set to a value between 0 and 1.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + freq + + + <Number> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 disableCoord

+
+ + Object disableCoord ( trueFalse ) + + +
Enables or disables similarity coordinate scoring of documents + commoning the Query. Default: false.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <String> + + + + + + A true/false +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( f ) + + +
Sets the field to query against.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + f + + + <String> + + + + + + A valid field name. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 highFreqOperator

+
+ + Object highFreqOperator ( op ) + + +
Sets the boolean operator to be used for high frequency terms. + Default: AND

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + op + + + <String> + + + + + + Any of "and" or "or", no quote characters. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 lowFreqOperator

+
+ + Object lowFreqOperator ( op ) + + +
Sets the boolean operator to be used for low frequency terms. + Default: AND

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + op + + + <String> + + + + + + Any of "and" or "or", no quote characters. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 minimumShouldMatchHighFreq

+
+ + Object minimumShouldMatchHighFreq ( min ) + + +
Sets the minimum number of high freq matches that need to match in + a document before that document is returned in the results.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + min + + + <Integer> + + + + + + A positive integer. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 minimumShouldMatchLowFreq

+
+ + Object minimumShouldMatchLowFreq ( min ) + + +
Sets the minimum number of low freq matches that need to match in + a document before that document is returned in the results.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + min + + + <Integer> + + + + + + A positive integer. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 query

+
+ + Object query ( qstr ) + + +
Sets the query string.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + qstr + + + <String> + + + + + + The query string. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +
Retrieves the internal query object. This is typically used by + internal API functions so use with caution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal query property. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.CompletionSuggester.html b/dist/docs/ejs.CompletionSuggester.html new file mode 100644 index 0000000..b257632 --- /dev/null +++ b/dist/docs/ejs.CompletionSuggester.html @@ -0,0 +1,1285 @@ + + + + + elastic.js: Module: CompletionSuggester + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsCompletionSuggester
+

+ + +
+ +
+

Module

+
+
+ +

 CompletionSuggester

+
+ + CompletionSuggester ( name ) + + +

A suggester that allows basic auto-complete functionality.


+ +
+
+ + + +
Since
+
elasticsearch 0.90.4
+ + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + name + + + <String> + + + + + + The name which be used to refer to this suggester. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectanalyzer(analyzer)

Sets analyzer used to analyze the suggest text.

ObjecteditDistance(d)

Maximum edit distance (fuzziness), defaults to 1. Automatically + enables fuzzy suggestions when set to any value.

Objectfield(field)

Sets the field used to generate suggestions from.

Objectfuzzy(trueFalse)

Enable fuzzy completions which means a can spell a word + incorrectly and still get a suggestion.

ObjectminLength(m)

Minimum length of the input before fuzzy suggestions are returned, defaults + to 3. Automatically enables fuzzy suggestions when set to any value.

ObjectprefixLength(l)

Minimum length of the input, which is not checked for fuzzy alternatives, defaults + to 1. Automatically enables fuzzy suggestions when set to any value.

ObjectshardSize(s)

Sets the maximum number of suggestions to be retrieved from + each individual shard.

Objectsize(s)

Sets the number of suggestions returned for each token.

Objecttext(txt)

Sets the text to get suggestions for. If not set, the global + suggestion text will be used.

StringtoJSON()

Retrieves the internal suggest object. This is typically used by + internal API functions so use with caution.

Objecttranspositions(trueFalse)

Sets if transpositions should be counted as one or two changes, defaults + to true when fuzzy is enabled. Automatically enables fuzzy suggestions + when set to any value.

ObjectunicodeAware(trueFalse)

Sets all are measurements (like edit distance, transpositions and lengths) + in unicode code points (actual letters) instead of bytes. Automatically + enables fuzzy suggestions when set to any value.

+
+ +

Method Detail

+ + + + + + + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 analyzer

+
+ + Object analyzer ( analyzer ) + + +

Sets analyzer used to analyze the suggest text.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + analyzer + + + <String> + + + + + + A valid analyzer name. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 editDistance

+
+ + Object editDistance ( d ) + + +

Maximum edit distance (fuzziness), defaults to 1. Automatically + enables fuzzy suggestions when set to any value.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + d + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( field ) + + +

Sets the field used to generate suggestions from.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + field + + + <String> + + + + + + A valid field name. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 fuzzy

+
+ + Object fuzzy ( trueFalse ) + + +

Enable fuzzy completions which means a can spell a word + incorrectly and still get a suggestion.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + true to enable fuzzy completions, false to disable. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 minLength

+
+ + Object minLength ( m ) + + +

Minimum length of the input before fuzzy suggestions are returned, defaults + to 3. Automatically enables fuzzy suggestions when set to any value.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + m + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 prefixLength

+
+ + Object prefixLength ( l ) + + +

Minimum length of the input, which is not checked for fuzzy alternatives, defaults + to 1. Automatically enables fuzzy suggestions when set to any value.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + l + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 shardSize

+
+ + Object shardSize ( s ) + + +

Sets the maximum number of suggestions to be retrieved from + each individual shard.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + s + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 size

+
+ + Object size ( s ) + + +

Sets the number of suggestions returned for each token.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + s + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 text

+
+ + Object text ( txt ) + + +

Sets the text to get suggestions for. If not set, the global + suggestion text will be used.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + txt + + + <String> + + + + + + A string to get suggestions for. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal suggest object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal suggest property. + + + +
+ + + +
+ +
+
+
+ +

 transpositions

+
+ + Object transpositions ( trueFalse ) + + +

Sets if transpositions should be counted as one or two changes, defaults + to true when fuzzy is enabled. Automatically enables fuzzy suggestions + when set to any value.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + true to enable transpositions. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 unicodeAware

+
+ + Object unicodeAware ( trueFalse ) + + +

Sets all are measurements (like edit distance, transpositions and lengths) + in unicode code points (actual letters) instead of bytes. Automatically + enables fuzzy suggestions when set to any value.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + true to set unicode aware, false to disable. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.ConstantScoreQuery.html b/dist/docs/ejs.ConstantScoreQuery.html new file mode 100644 index 0000000..81156eb --- /dev/null +++ b/dist/docs/ejs.ConstantScoreQuery.html @@ -0,0 +1,775 @@ + + + + + elastic.js: Module: ConstantScoreQuery + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsConstantScoreQuery
+

+ +

A constant score query wraps another Query or + Filter and returns a constant score for each + result that is equal to the query boost.

+ +

Note that lucene's query normalization (queryNorm) attempts + to make scores between different queries comparable. It does not + change the relevance of your query, but it might confuse you when + you look at the score of your documents and they are not equal to + the query boost value as expected. The scores were normalized by + queryNorm, but maintain the same relevance.

+
+ +
+

Module

+
+
+ +

 ConstantScoreQuery

+
+ + ConstantScoreQuery ( ) + + +

Constructs a query where each documents returned by the internal + query or filter have a constant score equal to the boost factor.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectboost(boost)Sets the boost value for documents matching the Query.
Objectcache(trueFalse)Enables caching of the filter.
ObjectcacheKey(k)Set the cache key.
Objectfilter(oFilter)Adds the filter to apply a constant score to.
Objectquery(oQuery)Adds the query to apply a constant score to.
StringtoJSON()Retrieves the internal query object. This is typically used by + internal API functions so use with caution.
+
+ +

Method Detail

+ + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 boost

+
+ + Object boost ( boost ) + + +
Sets the boost value for documents matching the Query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + boost + + + <Double> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 cache

+
+ + Object cache ( trueFalse ) + + +
Enables caching of the filter.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + A boolean value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 cacheKey

+
+ + Object cacheKey ( k ) + + +
Set the cache key.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + k + + + <String> + + + + + + A string cache key. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 filter

+
+ + Object filter ( oFilter ) + + +
Adds the filter to apply a constant score to.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + oFilter + + + <Object> + + + + + + A valid Filter object +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 query

+
+ + Object query ( oQuery ) + + +
Adds the query to apply a constant score to.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + oQuery + + + <Object> + + + + + + A valid Query object +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +
Retrieves the internal query object. This is typically used by + internal API functions so use with caution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal query property. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.DateHistogramAggregation.html b/dist/docs/ejs.DateHistogramAggregation.html new file mode 100644 index 0000000..c491cf1 --- /dev/null +++ b/dist/docs/ejs.DateHistogramAggregation.html @@ -0,0 +1,1561 @@ + + + + + elastic.js: Module: DateHistogramAggregation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsDateHistogramAggregation
+

+ +

A multi-bucket aggregation similar to the histogram except it can only be + applied on date values. Since dates are represented in elasticsearch + internally as long values, it is possible to use the normal histogram on + dates as well, though accuracy will be compromised. The reason for this is + in the fact that time based intervals are not fixed (think of leap years and + on the number of days in a month). For this reason, we need a special + support for time based data. From a functionality perspective, this + histogram supports the same features as the normal histogram. The main + difference is that the interval can be specified by date/time expressions.

+
+ +
+

Module

+
+
+ +

 DateHistogramAggregation

+
+ + DateHistogramAggregation ( name ) + + +

Aggregation similar to the histogram except it can only be applied on + date values.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + name + + + <String> + + + + + + The name which be used to refer to this aggregation. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectagg(agg)Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method.
Objectaggregation(agg)Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation.
ObjectextendedBounds(min,max)Set's the range/bounds for the histogram aggregation. Useful when you + want to include buckets that might be outside the bounds of indexed + documents.
Objectformat(f)Sets the format expression for the terms. Use for number or date + formatting
Objectinterval(i)Sets the histogram interval. Buckets are generated based on this interval + value.
Objectkeyed(trueFalse)Enable the response to be returned as a keyed object where the key is the + bucket interval.
ObjectminDocCount(num)Only return terms that match more than a configured number of hits.
Objectorder(order,direction)Sets order for the aggregated values.
ObjectpostOffset(offset)Set the post-rouding offset.
ObjectpostZone(tz)Set the post-rouding date time zone.
ObjectpreOffset(offset)Set the pre-rouding offset.
ObjectpreZone(tz)Set the pre-rouding date time zone.
ObjectpreZoneAdjustLargeInterval(trueFalse)Set to true to apply interval adjusts to day and above intervals.
ObjecttimeZone(tz)Set the date time zone.
StringtoJSON()

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.

+
+ +

Method Detail

+ + + + + + + + + + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 agg

+
+ + Object agg ( agg ) + + +
Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + agg + + + <Aggregation> + + + + + + Any valid Aggregation object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 aggregation

+
+ + Object aggregation ( agg ) + + +
Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + agg + + + <Aggregation> + + + + + + Any valid Aggregation object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 extendedBounds

+
+ + Object extendedBounds ( min, max ) + + +
Set's the range/bounds for the histogram aggregation. Useful when you + want to include buckets that might be outside the bounds of indexed + documents.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + min + + + <String | Long> + + + + + + The start bound / minimum bound value +
+ + + + + max + + + <String | Long> + + + + + + The end bound / maximum bound value +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 format

+
+ + Object format ( f ) + + +
Sets the format expression for the terms. Use for number or date + formatting

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + f + + + <String> + + + + + + the format string +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 interval

+
+ + Object interval ( i ) + + +
Sets the histogram interval. Buckets are generated based on this interval + value.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + i + + + <String> + + + + + + The interval +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 keyed

+
+ + Object keyed ( trueFalse ) + + +
Enable the response to be returned as a keyed object where the key is the + bucket interval.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + to enable keyed response or not +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 minDocCount

+
+ + Object minDocCount ( num ) + + +
Only return terms that match more than a configured number of hits.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + num + + + <Integer> + + + + + + The numer of minimum number of hits. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 order

+
+ + Object order ( order, direction ) + + +
Sets order for the aggregated values.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + order + + + <String> + + + + + + The order string. +
+ + + + + direction + + + <String> + + + + + + The sort direction, asc or desc. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 postOffset

+
+ + Object postOffset ( offset ) + + +
Set the post-rouding offset.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + offset + + + <String> + + + + + + the offset. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 postZone

+
+ + Object postZone ( tz ) + + +
Set the post-rouding date time zone.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + tz + + + <String> + + + + + + the time zone. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 preOffset

+
+ + Object preOffset ( offset ) + + +
Set the pre-rouding offset.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + offset + + + <String> + + + + + + the offset. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 preZone

+
+ + Object preZone ( tz ) + + +
Set the pre-rouding date time zone.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + tz + + + <String> + + + + + + the time zone. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 preZoneAdjustLargeInterval

+
+ + Object preZoneAdjustLargeInterval ( trueFalse ) + + +
Set to true to apply interval adjusts to day and above intervals.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + adjust large intervals or not +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 timeZone

+
+ + Object timeZone ( tz ) + + +
Set the date time zone.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + tz + + + <String> + + + + + + the time zone. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal object. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.DateHistogramFacet.html b/dist/docs/ejs.DateHistogramFacet.html new file mode 100644 index 0000000..b51bd36 --- /dev/null +++ b/dist/docs/ejs.DateHistogramFacet.html @@ -0,0 +1,2179 @@ + + + + + elastic.js: Module: DateHistogramFacet + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsDateHistogramFacet
+

+ +

The DateHistogram facet works with time-based values by building a histogram across time + intervals of the value field. Each value is rounded into an interval (or + placed in a bucket), and statistics are provided per interval/bucket (count and total).

+ +

Facets are similar to SQL GROUP BY statements but perform much + better. You can also construct several "groups" at once by simply + specifying multiple facets.

+ +
+

+ Tip: + For more information on faceted navigation, see + this + Wikipedia article on Faceted Classification. +

+

+
+ +
+

Module

+
+
+ +

 DateHistogramFacet

+
+ + DateHistogramFacet ( name ) + + +

A facet which returns the N most frequent terms within a collection + or set of collections.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + name + + + <String> + + + + + + The name which be used to refer to this facet. For instance, + the facet itself might utilize a field named doc_authors. Setting + name to Authors would allow you to refer to the + facet by that name, possibly simplifying some of the display logic. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
ObjectcacheFilter(trueFalse)

Enables caching of the facetFilter

ObjectfacetFilter(oFilter)

Allows you to reduce the documents used for computing facet results.

Objectfactor(f)

The date histogram works on numeric values (since time is stored + in milliseconds since the epoch in UTC).

+ +

But, sometimes, systems will store a different resolution (like seconds since UTC) + in a numeric field. The factor parameter can be used to change the value in the field + to milliseconds to actual do the relevant rounding, and then be applied again to get to + the original unit.

+ +

For example, when storing in a numeric field seconds resolution, + the factor can be set to 1000.

Objectfield(fieldName)Sets the field to be used to construct the this facet.
Objectglobal(trueFalse)

Computes values across the entire index

Objectinterval(timeInterval)Sets the bucket interval used to calculate the distribution.
ObjectkeyField(fieldName)Allows you to specify a different key field to be used to group intervals.
Objectlang(language)The script language being used. Currently supported values are + javascript, groovy, and mvel.
Objectmode(m)

Sets the mode the facet will use.

+ +

+
collector
+
post
+
Objectnested(path)

Sets the path to the nested document if faceting against a + nested field.

Objectorder(o)

Sets the type of ordering that will be performed on the date + buckets. Valid values are:

+ +

+
time - the default, sort by the buckets start time in milliseconds.
+
count - sort by the number of items in the bucket
+
total - sort by the sum/total of the items in the bucket
+
Objectparams(p)Sets parameters that will be applied to the script. Overwrites + any existing params.
ObjectpostOffset(offset)Set's a specific post-rounding offset. Format is 1d, 1h, etc.
ObjectpostZone(tz)

By default, time values are stored in UTC format.

+ +

This method allows users to set a time zone value that is then used to compute + intervals after rounding on the interval value. The value is an offset from UTC. + The tz offset value is simply added to the resulting bucket's date value.

+ +

For example, to use EST you would set the value to -5.

ObjectpreOffset(offset)Set's a specific pre-rounding offset. Format is 1d, 1h, etc.
ObjectpreZone(tz)

By default, time values are stored in UTC format.

+ +

This method allows users to set a time zone value that is then used to + compute intervals before rounding on the interval value. The value is an + offset from UTC.

+ +

For example, to use EST you would set the value to -5.

ObjectpreZoneAdjustLargeInterval(trueFalse)

Enables large date interval conversions (day and up).

+ +

Set to true to enable and then set the interval to an + interval greater than a day.

Objectscope(scope)

Computes values across the the specified scope

ObjecttimeZone(tz)

By default, time values are stored in UTC format.

+ +

This method allows users to set a time zone value that is then used + to compute intervals before rounding on the interval value. Equalivent to + preZone. Use preZone if possible. The + value is an offset from UTC.

+ +

For example, to use EST you would set the value to -5.

StringtoJSON()

Retrieves the internal facet object. This is typically used by + internal API functions so use with caution.

ObjectvalueField(fieldName)Allows you to specify a different value field to aggrerate over.
ObjectvalueScript(scriptCode)Allows you modify the value field using a script. The modified value + is then used to compute the statistical data.
+
+ +

Method Detail

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 cacheFilter

+
+ + Object cacheFilter ( trueFalse ) + + +

Enables caching of the facetFilter


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + If the facetFilter should be cached or not +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 facetFilter

+
+ + Object facetFilter ( oFilter ) + + +

Allows you to reduce the documents used for computing facet results.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + oFilter + + + <Object> + + + + + + A valid Filter object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 factor

+
+ + Object factor ( f ) + + +

The date histogram works on numeric values (since time is stored + in milliseconds since the epoch in UTC).

+ +

But, sometimes, systems will store a different resolution (like seconds since UTC) + in a numeric field. The factor parameter can be used to change the value in the field + to milliseconds to actual do the relevant rounding, and then be applied again to get to + the original unit.

+ +

For example, when storing in a numeric field seconds resolution, + the factor can be set to 1000.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + f + + + <Integer> + + + + + + The conversion factor. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( fieldName ) + + +
Sets the field to be used to construct the this facet.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + fieldName + + + <String> + + + + + + The field name whose data will be used to construct the facet. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 global

+
+ + Object global ( trueFalse ) + + +

Computes values across the entire index


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + Calculate facet counts globally or not. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 interval

+
+ + Object interval ( timeInterval ) + + +
Sets the bucket interval used to calculate the distribution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + timeInterval + + + <String> + + + + + + The bucket interval. Valid values are year, month, week, day, hour, and minute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 keyField

+
+ + Object keyField ( fieldName ) + + +
Allows you to specify a different key field to be used to group intervals.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + fieldName + + + <String> + + + + + + The name of the field to be used. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 lang

+
+ + Object lang ( language ) + + +
The script language being used. Currently supported values are + javascript, groovy, and mvel.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + language + + + <String> + + + + + + The language of the script. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 mode

+
+ + Object mode ( m ) + + +

Sets the mode the facet will use.

+ +

+
collector
+
post
+

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + m + + + <String> + + + + + + The mode: collector or post. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 nested

+
+ + Object nested ( path ) + + +

Sets the path to the nested document if faceting against a + nested field.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + path + + + <String> + + + + + + The nested path +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 order

+
+ + Object order ( o ) + + +

Sets the type of ordering that will be performed on the date + buckets. Valid values are:

+ +

+
time - the default, sort by the buckets start time in milliseconds.
+
count - sort by the number of items in the bucket
+
total - sort by the sum/total of the items in the bucket
+

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + o + + + <String> + + + + + + The ordering method: time, count, or total. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 params

+
+ + Object params ( p ) + + +
Sets parameters that will be applied to the script. Overwrites + any existing params.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + p + + + <Object> + + + + + + An object where the keys are the parameter name and + values are the parameter value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 postOffset

+
+ + Object postOffset ( offset ) + + +
Set's a specific post-rounding offset. Format is 1d, 1h, etc.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + offset + + + <String> + + + + + + The offset as a string (1d, 1h, etc) +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 postZone

+
+ + Object postZone ( tz ) + + +

By default, time values are stored in UTC format.

+ +

This method allows users to set a time zone value that is then used to compute + intervals after rounding on the interval value. The value is an offset from UTC. + The tz offset value is simply added to the resulting bucket's date value.

+ +

For example, to use EST you would set the value to -5.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + tz + + + <Integer> + + + + + + An offset value from UTC. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 preOffset

+
+ + Object preOffset ( offset ) + + +
Set's a specific pre-rounding offset. Format is 1d, 1h, etc.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + offset + + + <String> + + + + + + The offset as a string (1d, 1h, etc) +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 preZone

+
+ + Object preZone ( tz ) + + +

By default, time values are stored in UTC format.

+ +

This method allows users to set a time zone value that is then used to + compute intervals before rounding on the interval value. The value is an + offset from UTC.

+ +

For example, to use EST you would set the value to -5.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + tz + + + <Integer> + + + + + + An offset value from UTC. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 preZoneAdjustLargeInterval

+
+ + Object preZoneAdjustLargeInterval ( trueFalse ) + + +

Enables large date interval conversions (day and up).

+ +

Set to true to enable and then set the interval to an + interval greater than a day.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + A valid boolean value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scope

+
+ + Object scope ( scope ) + + +

Computes values across the the specified scope


+ +
+
+ + + + + +
Deprecated
since elasticsearch 0.90
+ + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scope + + + <String> + + + + + + The scope name to calculate facet counts with. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 timeZone

+
+ + Object timeZone ( tz ) + + +

By default, time values are stored in UTC format.

+ +

This method allows users to set a time zone value that is then used + to compute intervals before rounding on the interval value. Equalivent to + preZone. Use preZone if possible. The + value is an offset from UTC.

+ +

For example, to use EST you would set the value to -5.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + tz + + + <Integer> + + + + + + An offset value from UTC. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal facet object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal facet property. + + + +
+ + + +
+ +
+
+
+ +

 valueField

+
+ + Object valueField ( fieldName ) + + +
Allows you to specify a different value field to aggrerate over.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + fieldName + + + <String> + + + + + + The name of the field to be used. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 valueScript

+
+ + Object valueScript ( scriptCode ) + + +
Allows you modify the value field using a script. The modified value + is then used to compute the statistical data.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptCode + + + <String> + + + + + + A valid script string to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.DateRangeAggregation.html b/dist/docs/ejs.DateRangeAggregation.html new file mode 100644 index 0000000..5e66530 --- /dev/null +++ b/dist/docs/ejs.DateRangeAggregation.html @@ -0,0 +1,1315 @@ + + + + + elastic.js: Module: DateRangeAggregation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsDateRangeAggregation
+

+ +

A range aggregation that is dedicated for date values. The main difference + between this aggregation and the normal range aggregation is that the from + and to values can be expressed in Date Math expressions, and it is also + possible to specify a date format by which the from and to response fields + will be returned. Note that this aggregration includes the from value and + excludes the to value for each range.

+ +

Note that this aggregration includes the from value and excludes the to + value for each range.

+
+ +
+

Module

+
+
+ +

 DateRangeAggregation

+
+ + DateRangeAggregation ( name ) + + +

Aggregation that is dedicated for date value ranges.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + name + + + <String> + + + + + + The name which be used to refer to this aggregation. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectagg(agg)Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method.
Objectaggregation(agg)Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation.
Objectfield(field)

Sets the field to operate on.

Objectformat(f)Sets the date format expression.
Objectkeyed(trueFalse)Enable the response to be returned as a keyed object where the key is the + bucket interval.
Objectlang(language)The script language being used.
Objectparams(p)Sets parameters that will be applied to the script. Overwrites + any existing params.
Objectrange(from,to,key)Adds a range to the list of exsiting range expressions.
Objectscript(scriptCode)Allows you generate or modify the terms/values using a script.
ObjectscriptFile(scriptFile)Allows you generate or modify the terms/values using a script.
ObjectscriptId(scriptId)Allows you generate or modify the terms/values using a script.
StringtoJSON()

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.

+
+ +

Method Detail

+ + + + + + + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 agg

+
+ + Object agg ( agg ) + + +
Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + agg + + + <Aggregation> + + + + + + Any valid Aggregation object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 aggregation

+
+ + Object aggregation ( agg ) + + +
Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + agg + + + <Aggregation> + + + + + + Any valid Aggregation object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( field ) + + +

Sets the field to operate on.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + field + + + <String> + + + + + + a valid field name.. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 format

+
+ + Object format ( f ) + + +
Sets the date format expression.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + f + + + <String> + + + + + + the format string +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 keyed

+
+ + Object keyed ( trueFalse ) + + +
Enable the response to be returned as a keyed object where the key is the + bucket interval.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + to enable keyed response or not +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 lang

+
+ + Object lang ( language ) + + +
The script language being used.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + language + + + <String> + + + + + + The language of the script. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 params

+
+ + Object params ( p ) + + +
Sets parameters that will be applied to the script. Overwrites + any existing params.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + p + + + <Object> + + + + + + An object where the keys are the parameter name and + values are the parameter value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 range

+
+ + Object range ( from, to, key ) + + +
Adds a range to the list of exsiting range expressions.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + from + + + <String> + + + + + + The start value, use null to ignore +
+ + + + + to + + + <String> + + + + + + The end value, use null to ignore. +
+ + + + + key + + + <String> + + + + + + Optional key/bucket name for keyed responses. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 script

+
+ + Object script ( scriptCode ) + + +
Allows you generate or modify the terms/values using a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptCode + + + <String> + + + + + + A valid script string to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scriptFile

+
+ + Object scriptFile ( scriptFile ) + + +
Allows you generate or modify the terms/values using a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptFile + + + <String> + + + + + + A valid script file to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scriptId

+
+ + Object scriptId ( scriptId ) + + +
Allows you generate or modify the terms/values using a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptId + + + <String> + + + + + + A valid script id to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal object. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.DecayScoreFunction.html b/dist/docs/ejs.DecayScoreFunction.html new file mode 100644 index 0000000..8f13e10 --- /dev/null +++ b/dist/docs/ejs.DecayScoreFunction.html @@ -0,0 +1,1065 @@ + + + + + elastic.js: Module: DecayScoreFunction + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsDecayScoreFunction
+

+ +

Decay functions score a document with a function that decays depending on + the distance of a numeric field value of the document from a user given + origin. This is similar to a range query, but with smooth edges instead of + boxes.

+ +

Supported decay functions are: linear, exp, and gauss.

+
+ +
+

Module

+
+
+ +

 DecayScoreFunction

+
+ + DecayScoreFunction ( field ) + + +

Score a document with a function that decays depending on the distance + of a numeric field value of the document from given origin.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + field + + + <String> + + + + + + the document field to run decay function against. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectdecay(d)Sets the decay value which defines how documents are scored at the distance + given at scale.
Objectexp()Use the exp decay function. Exponential decay.
Objectfield(f)Sets the fields to run the decay function against.
Objectfilter(oFilter)Adds a filter whose matching documents will have the score function applied.
Objectgauss()Use the gauss decay function. Normal decay.
Objectlinear()Use the linear decay function. Linear decay.
Objectoffset(o)Sets the decay offset. The decay function will only compute a the decay + function for documents with a distance greater that the defined offset. + The default is 0.
Objectorigin(o)Sets the origin which is the “central point†from which the distance is + calculated.
Objectscale(s)Sets the scale/rate of decay.
StringtoJSON()

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.

+
+ +

Method Detail

+ + + + + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 decay

+
+ + Object decay ( d ) + + +
Sets the decay value which defines how documents are scored at the distance + given at scale.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + d + + + <Double> + + + + + + A decay value as a double. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 exp

+
+ + Object exp ( ) + + +
Use the exp decay function. Exponential decay.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( f ) + + +
Sets the fields to run the decay function against.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + f + + + <String> + + + + + + A valid field name. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 filter

+
+ + Object filter ( oFilter ) + + +
Adds a filter whose matching documents will have the score function applied.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + oFilter + + + <Filter> + + + + + + Any valid Filter object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 gauss

+
+ + Object gauss ( ) + + +
Use the gauss decay function. Normal decay.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 linear

+
+ + Object linear ( ) + + +
Use the linear decay function. Linear decay.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 offset

+
+ + Object offset ( o ) + + +
Sets the decay offset. The decay function will only compute a the decay + function for documents with a distance greater that the defined offset. + The default is 0.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + o + + + <String> + + + + + + A valid offset value for the field type. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 origin

+
+ + Object origin ( o ) + + +
Sets the origin which is the “central point†from which the distance is + calculated.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + o + + + <String> + + + + + + A valid origin value for the field type. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scale

+
+ + Object scale ( s ) + + +
Sets the scale/rate of decay.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + s + + + <String> + + + + + + A valid scale value for the field type. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal object. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.DirectGenerator.html b/dist/docs/ejs.DirectGenerator.html new file mode 100644 index 0000000..a7c711b --- /dev/null +++ b/dist/docs/ejs.DirectGenerator.html @@ -0,0 +1,1468 @@ + + + + + elastic.js: Module: DirectGenerator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsDirectGenerator
+

+ +

DirectGenerator is a candidate generator for PhraseSuggester. + It generates terms based on edit distance and operators much like the + TermSuggester.

+
+ +
+

Module

+
+
+ +

 DirectGenerator

+
+ + DirectGenerator ( ) + + +

A candidate generator that generates terms based on edit distance.


+ +
+
+ + + +
Since
+
elasticsearch 0.90
+ + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectaccuracy(a)

Sets the accuracy. How similar the suggested terms at least + need to be compared to the original suggest text.

Objectfield(field)

Sets the field used to generate suggestions from.

ObjectmaxEdits(max)

Sets the maximum edit distance candidate suggestions can have + in order to be considered as a suggestion.

ObjectmaxInspections(max)

The factor that is used to multiply with the size in order + to inspect more candidate suggestions.

ObjectmaxTermFreq(max)

Sets a maximum threshold in number of documents a suggest text + token can exist in order to be corrected.

ObjectminDocFreq(min)

Sets a minimal threshold of the number of documents a suggested + term should appear in.

ObjectminWordLen(len)

Sets the minimum length a suggest text term must have in order + to be corrected.

ObjectpostFilter(analyzer)

Sets an analyzer that is applied to each of the generated tokens + before they are passed to the actual phrase scorer.

ObjectpreFilter(analyzer)

Sets an analyzer that is applied to each of the tokens passed to + this generator. The analyzer is applied to the original tokens, + not the generated tokens.

Objectsize(s)

Sets the number of suggestions returned for each token.

Objectsort(s)

Sets the sort mode. Valid values are:

+ +
+
score - Sort by score first, then document frequency, and then the term itself
+
frequency - Sort by document frequency first, then simlarity score and then the term itself
+
ObjectstringDistance(s)

Sets what string distance implementation to use for comparing + how similar suggested terms are. Valid values are:

+ +
+
internal - based on damerau_levenshtein but but highly optimized for comparing string distance for terms inside the index
+
damerau_levenshtein - String distance algorithm based on Damerau-Levenshtein algorithm
+
levenstein - String distance algorithm based on Levenstein edit distance algorithm
+
jarowinkler - String distance algorithm based on Jaro-Winkler algorithm
+
ngram - String distance algorithm based on character n-grams
+
ObjectsuggestMode(m)

Sets the suggest mode. Valid values are:

+ +
+
missing - Only suggest terms in the suggest text that aren't in the index
+
popular - Only suggest suggestions that occur in more docs then the original suggest text term
+
always - Suggest any matching suggestions based on terms in the suggest text
+
StringtoJSON()

Retrieves the internal generator object. This is typically used by + internal API functions so use with caution.

+
+ +

Method Detail

+ + + + + + + + + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 accuracy

+
+ + Object accuracy ( a ) + + +

Sets the accuracy. How similar the suggested terms at least + need to be compared to the original suggest text.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + a + + + <Double> + + + + + + A positive double value between 0 and 1. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( field ) + + +

Sets the field used to generate suggestions from.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + field + + + <String> + + + + + + A valid field name. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 maxEdits

+
+ + Object maxEdits ( max ) + + +

Sets the maximum edit distance candidate suggestions can have + in order to be considered as a suggestion.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + max + + + <Integer> + + + + + + An integer value greater than 0. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 maxInspections

+
+ + Object maxInspections ( max ) + + +

The factor that is used to multiply with the size in order + to inspect more candidate suggestions.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + max + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 maxTermFreq

+
+ + Object maxTermFreq ( max ) + + +

Sets a maximum threshold in number of documents a suggest text + token can exist in order to be corrected.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + max + + + <Double> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 minDocFreq

+
+ + Object minDocFreq ( min ) + + +

Sets a minimal threshold of the number of documents a suggested + term should appear in.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + min + + + <Double> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 minWordLen

+
+ + Object minWordLen ( len ) + + +

Sets the minimum length a suggest text term must have in order + to be corrected.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + len + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 postFilter

+
+ + Object postFilter ( analyzer ) + + +

Sets an analyzer that is applied to each of the generated tokens + before they are passed to the actual phrase scorer.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + analyzer + + + <String> + + + + + + A valid analyzer name. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 preFilter

+
+ + Object preFilter ( analyzer ) + + +

Sets an analyzer that is applied to each of the tokens passed to + this generator. The analyzer is applied to the original tokens, + not the generated tokens.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + analyzer + + + <String> + + + + + + A valid analyzer name. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 size

+
+ + Object size ( s ) + + +

Sets the number of suggestions returned for each token.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + s + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 sort

+
+ + Object sort ( s ) + + +

Sets the sort mode. Valid values are:

+ +
+
score - Sort by score first, then document frequency, and then the term itself
+
frequency - Sort by document frequency first, then simlarity score and then the term itself
+

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + s + + + <String> + + + + + + The score type of score or frequency. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 stringDistance

+
+ + Object stringDistance ( s ) + + +

Sets what string distance implementation to use for comparing + how similar suggested terms are. Valid values are:

+ +
+
internal - based on damerau_levenshtein but but highly optimized for comparing string distance for terms inside the index
+
damerau_levenshtein - String distance algorithm based on Damerau-Levenshtein algorithm
+
levenstein - String distance algorithm based on Levenstein edit distance algorithm
+
jarowinkler - String distance algorithm based on Jaro-Winkler algorithm
+
ngram - String distance algorithm based on character n-grams
+

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + s + + + <String> + + + + + + The string distance algorithm name. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 suggestMode

+
+ + Object suggestMode ( m ) + + +

Sets the suggest mode. Valid values are:

+ +
+
missing - Only suggest terms in the suggest text that aren't in the index
+
popular - Only suggest suggestions that occur in more docs then the original suggest text term
+
always - Suggest any matching suggestions based on terms in the suggest text
+

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + m + + + <String> + + + + + + The mode of missing, popular, or always. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal generator object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal generator property. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.DirectSettingsMixin.html b/dist/docs/ejs.DirectSettingsMixin.html new file mode 100644 index 0000000..0e086b6 --- /dev/null +++ b/dist/docs/ejs.DirectSettingsMixin.html @@ -0,0 +1,1060 @@ + + + + + elastic.js: Mixin: DirectSettingsMixin + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsDirectSettingsMixin
+

+ + +
+ +
+
+
+ + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
Objectaccuracy(a)

Sets the accuracy. How similar the suggested terms at least + need to be compared to the original suggest text.

ObjectmaxEdits(max)

Sets the maximum edit distance candidate suggestions can have + in order to be considered as a suggestion.

ObjectmaxInspections(max)

The factor that is used to multiply with the size in order + to inspect more candidate suggestions.

ObjectmaxTermFreq(max)

Sets a maximum threshold in number of documents a suggest text + token can exist in order to be corrected.

ObjectminDocFreq(min)

Sets a minimal threshold of the number of documents a suggested + term should appear in.

ObjectminWordLen(len)

Sets the minimum length a suggest text term must have in order + to be corrected.

ObjectprefixLen(len)

Sets the number of minimal prefix characters that must match in + order be a candidate suggestion.

Objectsort(s)

Sets the sort mode. Valid values are:

+ +
+
score - Sort by score first, then document frequency, and then the term itself
+
frequency - Sort by document frequency first, then simlarity score and then the term itself
+
ObjectstringDistance(s)

Sets what string distance implementation to use for comparing + how similar suggested terms are. Valid values are:

+ +
+
internal - based on damerau_levenshtein but but highly optimized for comparing string distance for terms inside the index
+
damerau_levenshtein - String distance algorithm based on Damerau-Levenshtein algorithm
+
levenstein - String distance algorithm based on Levenstein edit distance algorithm
+
jarowinkler - String distance algorithm based on Jaro-Winkler algorithm
+
ngram - String distance algorithm based on character n-grams
+
ObjectsuggestMode(m)

Sets the suggest mode. Valid values are:

+ +
+
missing - Only suggest terms in the suggest text that aren't in the index
+
popular - Only suggest suggestions that occur in more docs then the original suggest text term
+
always - Suggest any matching suggestions based on terms in the suggest text
+
+
+ +

Method Detail

+ + + + + + + + + + + + + + + +
+
+ +

 accuracy

+
+ + Object accuracy ( a ) + + +

Sets the accuracy. How similar the suggested terms at least + need to be compared to the original suggest text.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + a + + + <Double> + + + + + + A positive double value between 0 and 1. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 maxEdits

+
+ + Object maxEdits ( max ) + + +

Sets the maximum edit distance candidate suggestions can have + in order to be considered as a suggestion.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + max + + + <Integer> + + + + + + An integer value greater than 0. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 maxInspections

+
+ + Object maxInspections ( max ) + + +

The factor that is used to multiply with the size in order + to inspect more candidate suggestions.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + max + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 maxTermFreq

+
+ + Object maxTermFreq ( max ) + + +

Sets a maximum threshold in number of documents a suggest text + token can exist in order to be corrected.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + max + + + <Double> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 minDocFreq

+
+ + Object minDocFreq ( min ) + + +

Sets a minimal threshold of the number of documents a suggested + term should appear in.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + min + + + <Double> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 minWordLen

+
+ + Object minWordLen ( len ) + + +

Sets the minimum length a suggest text term must have in order + to be corrected.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + len + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 prefixLen

+
+ + Object prefixLen ( len ) + + +

Sets the number of minimal prefix characters that must match in + order be a candidate suggestion.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + len + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 sort

+
+ + Object sort ( s ) + + +

Sets the sort mode. Valid values are:

+ +
+
score - Sort by score first, then document frequency, and then the term itself
+
frequency - Sort by document frequency first, then simlarity score and then the term itself
+

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + s + + + <String> + + + + + + The score type of score or frequency. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 stringDistance

+
+ + Object stringDistance ( s ) + + +

Sets what string distance implementation to use for comparing + how similar suggested terms are. Valid values are:

+ +
+
internal - based on damerau_levenshtein but but highly optimized for comparing string distance for terms inside the index
+
damerau_levenshtein - String distance algorithm based on Damerau-Levenshtein algorithm
+
levenstein - String distance algorithm based on Levenstein edit distance algorithm
+
jarowinkler - String distance algorithm based on Jaro-Winkler algorithm
+
ngram - String distance algorithm based on character n-grams
+

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + s + + + <String> + + + + + + The string distance algorithm name. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 suggestMode

+
+ + Object suggestMode ( m ) + + +

Sets the suggest mode. Valid values are:

+ +
+
missing - Only suggest terms in the suggest text that aren't in the index
+
popular - Only suggest suggestions that occur in more docs then the original suggest text term
+
always - Suggest any matching suggestions based on terms in the suggest text
+

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + m + + + <String> + + + + + + The mode of missing, popular, or always. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.DisMaxQuery.html b/dist/docs/ejs.DisMaxQuery.html new file mode 100644 index 0000000..f0f78a7 --- /dev/null +++ b/dist/docs/ejs.DisMaxQuery.html @@ -0,0 +1,627 @@ + + + + + elastic.js: Module: DisMaxQuery + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsDisMaxQuery
+

+ +

A query that generates the union of documents produced by its subqueries, and + that scores each document with the maximum score for that document as produced + by any subquery, plus a tie breaking increment for any additional matching + subqueries.

+
+ +
+

Module

+
+
+ +

 DisMaxQuery

+
+ + DisMaxQuery ( ) + + +
A query that generates the union of documents produced by its subqueries such + as termQuerys, phraseQuerys, boolQuerys, etc.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectboost(boost)Sets the boost value for documents matching the Query.
Objectqueries(qs)Updates the queries. If passed a single Query, it is added to the + list of existing queries. If passed an array of Queries, it + replaces all existing values.
ObjecttieBreaker(tieBreaker)

The tie breaker value.

+ +

The tie breaker capability allows results that include the same term in multiple + fields to be judged better than results that include this term in only the best of those + multiple fields, without confusing this with the better case of two different terms in + the multiple fields.

+ +

Default: 0.0.

StringtoJSON()Retrieves the internal query object. This is typically used by + internal API functions so use with caution.
+
+ +

Method Detail

+ + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 boost

+
+ + Object boost ( boost ) + + +
Sets the boost value for documents matching the Query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + boost + + + <Double> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 queries

+
+ + Object queries ( qs ) + + +
Updates the queries. If passed a single Query, it is added to the + list of existing queries. If passed an array of Queries, it + replaces all existing values.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + qs + + + <Query | Query[]> + + + + + + A single Query or an array of Queries +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 tieBreaker

+
+ + Object tieBreaker ( tieBreaker ) + + +

The tie breaker value.

+ +

The tie breaker capability allows results that include the same term in multiple + fields to be judged better than results that include this term in only the best of those + multiple fields, without confusing this with the better case of two different terms in + the multiple fields.

+ +

Default: 0.0.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + tieBreaker + + + <Double> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +
Retrieves the internal query object. This is typically used by + internal API functions so use with caution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal query property. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.ExistsFilter.html b/dist/docs/ejs.ExistsFilter.html new file mode 100644 index 0000000..1187924 --- /dev/null +++ b/dist/docs/ejs.ExistsFilter.html @@ -0,0 +1,701 @@ + + + + + elastic.js: Module: ExistsFilter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsExistsFilter
+

+ +

An existsFilter matches documents where the specified field is present + and the field contains a legitimate value.

+
+ +
+

Module

+
+
+ +

 ExistsFilter

+
+ + ExistsFilter ( fieldName ) + + +
Filters documents where a specified field exists and contains a value.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + fieldName + + + <String> + + + + + + the field name that must exists and contain a value. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
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(name)Sets the field to check for missing values.
Objectname(name)Sets the filter name.
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 ( name ) + + +
Sets the field to check for missing values.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + name + + + <String> + + + + + + A name of the field. +
+ + +
+ + + + + + +
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. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + Object toJSON ( ) + + +
Returns the filter object.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ filter object + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.ExtendedStatsAggregation.html b/dist/docs/ejs.ExtendedStatsAggregation.html new file mode 100644 index 0000000..bd9881e --- /dev/null +++ b/dist/docs/ejs.ExtendedStatsAggregation.html @@ -0,0 +1,873 @@ + + + + + elastic.js: Module: ExtendedStatsAggregation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsExtendedStatsAggregation
+

+ +

A multi-value metrics aggregation that computes stats over numeric values + extracted from the aggregated documents. These values can be extracted either + from specific numeric fields in the documents, or be generated by a provided + script.

+ +

The extended_stats aggregations is an extended version of the + StatsAggregation, where additional metrics are added such as + sum_of_squares, variance and std_deviation.

+
+ +
+

Module

+
+
+ +

 ExtendedStatsAggregation

+
+ + ExtendedStatsAggregation ( name ) + + +

Aggregation that computes extra stats over numeric values extracted from + the aggregated documents.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + name + + + <String> + + + + + + The name which be used to refer to this aggregation. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectfield(field)

Sets the field to operate on.

Objectlang(language)The script language being used.
Objectparams(p)Sets parameters that will be applied to the script. Overwrites + any existing params.
Objectscript(scriptCode)Allows you generate or modify the terms/values using a script.
ObjectscriptFile(scriptFile)Allows you generate or modify the terms/values using a script.
ObjectscriptId(scriptId)Allows you generate or modify the terms/values using a script.
StringtoJSON()

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.

+
+ +

Method Detail

+ + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( field ) + + +

Sets the field to operate on.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + field + + + <String> + + + + + + a valid field name.. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 lang

+
+ + Object lang ( language ) + + +
The script language being used.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + language + + + <String> + + + + + + The language of the script. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 params

+
+ + Object params ( p ) + + +
Sets parameters that will be applied to the script. Overwrites + any existing params.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + p + + + <Object> + + + + + + An object where the keys are the parameter name and + values are the parameter value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 script

+
+ + Object script ( scriptCode ) + + +
Allows you generate or modify the terms/values using a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptCode + + + <String> + + + + + + A valid script string to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scriptFile

+
+ + Object scriptFile ( scriptFile ) + + +
Allows you generate or modify the terms/values using a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptFile + + + <String> + + + + + + A valid script file to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scriptId

+
+ + Object scriptId ( scriptId ) + + +
Allows you generate or modify the terms/values using a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptId + + + <String> + + + + + + A valid script id to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal object. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.FacetMixin.html b/dist/docs/ejs.FacetMixin.html new file mode 100644 index 0000000..e66b78d --- /dev/null +++ b/dist/docs/ejs.FacetMixin.html @@ -0,0 +1,829 @@ + + + + + elastic.js: Mixin: FacetMixin + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsFacetMixin
+

+ + +
+ +
+
+
+ + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
ObjectcacheFilter(trueFalse)

Enables caching of the facetFilter

ObjectfacetFilter(oFilter)

Allows you to reduce the documents used for computing facet results.

Objectglobal(trueFalse)

Computes values across the entire index

Objectmode(m)

Sets the mode the facet will use.

+ +

+
collector
+
post
+
Objectnested(path)

Sets the path to the nested document if faceting against a + nested field.

Objectscope(scope)

Computes values across the the specified scope

StringtoJSON()

Retrieves the internal facet object. This is typically used by + internal API functions so use with caution.

+
+ +

Method Detail

+ + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 cacheFilter

+
+ + Object cacheFilter ( trueFalse ) + + +

Enables caching of the facetFilter


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + If the facetFilter should be cached or not +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 facetFilter

+
+ + Object facetFilter ( oFilter ) + + +

Allows you to reduce the documents used for computing facet results.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + oFilter + + + <Object> + + + + + + A valid Filter object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 global

+
+ + Object global ( trueFalse ) + + +

Computes values across the entire index


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + Calculate facet counts globally or not. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 mode

+
+ + Object mode ( m ) + + +

Sets the mode the facet will use.

+ +

+
collector
+
post
+

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + m + + + <String> + + + + + + The mode: collector or post. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 nested

+
+ + Object nested ( path ) + + +

Sets the path to the nested document if faceting against a + nested field.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + path + + + <String> + + + + + + The nested path +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scope

+
+ + Object scope ( scope ) + + +

Computes values across the the specified scope


+ +
+
+ + + + + +
Deprecated
since elasticsearch 0.90
+ + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scope + + + <String> + + + + + + The scope name to calculate facet counts with. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal facet object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal facet property. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.FieldMaskingSpanQuery.html b/dist/docs/ejs.FieldMaskingSpanQuery.html new file mode 100644 index 0000000..46a6825 --- /dev/null +++ b/dist/docs/ejs.FieldMaskingSpanQuery.html @@ -0,0 +1,641 @@ + + + + + elastic.js: Module: FieldMaskingSpanQuery + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsFieldMaskingSpanQuery
+

+ +

Wrapper to allow SpanQuery objects participate in composite single-field + SpanQueries by 'lying' about their search field. That is, the masked + SpanQuery will function as normal, but when asked for the field it + queries against, it will return the value specified as the masked field vs. + the real field used in the wrapped span query.

+
+ +
+

Module

+
+
+ +

 FieldMaskingSpanQuery

+
+ + FieldMaskingSpanQuery ( spanQry, field ) + + +
Wraps a SpanQuery and hides the real field being searched across.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + spanQry + + + <Query> + + + + + + A valid SpanQuery +
+ + + + + field + + + <Integer> + + + + + + the maximum field position in a match. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectboost(boost)Sets the boost value for documents matching the Query.
Objectfield(f)Sets the value of the "masked" field.
Objectquery(spanQuery)Sets the span query to wrap.
StringtoJSON()Retrieves the internal query object. This is typically used by + internal API functions so use with caution.
+
+ +

Method Detail

+ + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 boost

+
+ + Object boost ( boost ) + + +
Sets the boost value for documents matching the Query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + boost + + + <Double> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( f ) + + +
Sets the value of the "masked" field.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + f + + + <String> + + + + + + A field name the wrapped span query should use +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 query

+
+ + Object query ( spanQuery ) + + +
Sets the span query to wrap.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + spanQuery + + + <Query> + + + + + + Any valid span type query. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +
Retrieves the internal query object. This is typically used by + internal API functions so use with caution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal query property. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.FieldValueFactorFunction.html b/dist/docs/ejs.FieldValueFactorFunction.html new file mode 100644 index 0000000..e49fb34 --- /dev/null +++ b/dist/docs/ejs.FieldValueFactorFunction.html @@ -0,0 +1,625 @@ + + + + + elastic.js: Module: FieldValueFactorFunction + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsFieldValueFactorFunction
+

+ +

The field_value_factor function allows you to use a field from a document to + influence the score. It’s similar to using the script_score function, however, + it avoids the overhead of scripting. If used on a multi-valued field, only the + first value of the field is used in calculations.

+
+ +
+

Module

+
+
+ +

 FieldValueFactorFunction

+
+ + FieldValueFactorFunction ( field ) + + +

Multiply the score by the value of the field, multiplied by the factor.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + field + + + <String> + + + + + + the field to apply the function to. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectfactor(factor)Sets the factor.
Objectfilter(oFilter)Adds a filter whose matching documents will have the score function applied.
Objectmodifier(modifier)Sets the modifier.
StringtoJSON()

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.

+
+ +

Method Detail

+ + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 factor

+
+ + Object factor ( factor ) + + +
Sets the factor.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + factor + + + <Float> + + + + + + the factor. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 filter

+
+ + Object filter ( oFilter ) + + +
Adds a filter whose matching documents will have the score function applied.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + oFilter + + + <Filter> + + + + + + Any valid Filter object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 modifier

+
+ + Object modifier ( modifier ) + + +
Sets the modifier.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + modifier + + + <Float> + + + + + + the modifier, one of none, log, log1p, log2p, ln, ln1p, ln2p, square, sqrt or reciprocal +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal object. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.FilterAggregation.html b/dist/docs/ejs.FilterAggregation.html new file mode 100644 index 0000000..60759ab --- /dev/null +++ b/dist/docs/ejs.FilterAggregation.html @@ -0,0 +1,634 @@ + + + + + elastic.js: Module: FilterAggregation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsFilterAggregation
+

+ +

Defines a single bucket of all the documents in the current document set + context that match a specified filter. Often this will be used to narrow down + the current aggregation context to a specific set of documents.

+
+ +
+

Module

+
+
+ +

 FilterAggregation

+
+ + FilterAggregation ( name ) + + +

Defines a single bucket of all the documents that match a given filter.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + name + + + <String> + + + + + + The name which be used to refer to this aggregation. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectagg(agg)Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method.
Objectaggregation(agg)Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation.
Objectfilter(oFilter)

Sets the filter to be used for this aggregation.

StringtoJSON()

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.

+
+ +

Method Detail

+ + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 agg

+
+ + Object agg ( agg ) + + +
Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + agg + + + <Aggregation> + + + + + + Any valid Aggregation object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 aggregation

+
+ + Object aggregation ( agg ) + + +
Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + agg + + + <Aggregation> + + + + + + Any valid Aggregation object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 filter

+
+ + Object filter ( oFilter ) + + +

Sets the filter to be used for this aggregation.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + oFilter + + + <Filter> + + + + + + A valid Filter object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal object. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.FilterFacet.html b/dist/docs/ejs.FilterFacet.html new file mode 100644 index 0000000..d7c7724 --- /dev/null +++ b/dist/docs/ejs.FilterFacet.html @@ -0,0 +1,974 @@ + + + + + elastic.js: Module: FilterFacet + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsFilterFacet
+

+ +

The FilterFacet allows you to specify any valid Filter and + have the number of matching hits returned as the value.

+ +

Facets are similar to SQL GROUP BY statements but perform much + better. You can also construct several "groups" at once by simply + specifying multiple facets.

+ +
+

+ Tip: + For more information on faceted navigation, see + this + Wikipedia article on Faceted Classification. +

+

+
+ +
+

Module

+
+
+ +

 FilterFacet

+
+ + FilterFacet ( name ) + + +

A facet that return a count of the hits matching the given filter.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + name + + + <String> + + + + + + The name which be used to refer to this facet. For instance, + the facet itself might utilize a field named doc_authors. Setting + name to Authors would allow you to refer to the + facet by that name, possibly simplifying some of the display logic. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
ObjectcacheFilter(trueFalse)

Enables caching of the facetFilter

ObjectfacetFilter(oFilter)

Allows you to reduce the documents used for computing facet results.

Objectfilter(oFilter)

Sets the filter to be used for this facet.

Objectglobal(trueFalse)

Computes values across the entire index

Objectmode(m)

Sets the mode the facet will use.

+ +

+
collector
+
post
+
Objectnested(path)

Sets the path to the nested document if faceting against a + nested field.

Objectscope(scope)

Computes values across the the specified scope

StringtoJSON()

Retrieves the internal facet object. This is typically used by + internal API functions so use with caution.

+
+ +

Method Detail

+ + + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 cacheFilter

+
+ + Object cacheFilter ( trueFalse ) + + +

Enables caching of the facetFilter


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + If the facetFilter should be cached or not +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 facetFilter

+
+ + Object facetFilter ( oFilter ) + + +

Allows you to reduce the documents used for computing facet results.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + oFilter + + + <Object> + + + + + + A valid Filter object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 filter

+
+ + Object filter ( oFilter ) + + +

Sets the filter to be used for this facet.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + oFilter + + + <Object> + + + + + + A valid Query object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 global

+
+ + Object global ( trueFalse ) + + +

Computes values across the entire index


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + Calculate facet counts globally or not. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 mode

+
+ + Object mode ( m ) + + +

Sets the mode the facet will use.

+ +

+
collector
+
post
+

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + m + + + <String> + + + + + + The mode: collector or post. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 nested

+
+ + Object nested ( path ) + + +

Sets the path to the nested document if faceting against a + nested field.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + path + + + <String> + + + + + + The nested path +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scope

+
+ + Object scope ( scope ) + + +

Computes values across the the specified scope


+ +
+
+ + + + + +
Deprecated
since elasticsearch 0.90
+ + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scope + + + <String> + + + + + + The scope name to calculate facet counts with. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal facet object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal facet property. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.FilterMixin.html b/dist/docs/ejs.FilterMixin.html new file mode 100644 index 0000000..cebabdb --- /dev/null +++ b/dist/docs/ejs.FilterMixin.html @@ -0,0 +1,572 @@ + + + + + elastic.js: Mixin: FilterMixin + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsFilterMixin
+

+ + +
+ +
+
+
+ + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
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.
Objectname(name)Sets the filter name.
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. + + + +
+ + + +
+ +
+
+
+ +

 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. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + Object toJSON ( ) + + +
Returns the filter object.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ filter object + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.FilteredQuery.html b/dist/docs/ejs.FilteredQuery.html new file mode 100644 index 0000000..4fc8488 --- /dev/null +++ b/dist/docs/ejs.FilteredQuery.html @@ -0,0 +1,910 @@ + + + + + elastic.js: Module: FilteredQuery + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsFilteredQuery
+

+ +

Filter queries allow you to restrict the results returned by a query. There are + several different types of filters that can be applied + (see filter module). A filterQuery + takes a Query and a Filter object as arguments and constructs + a new Query that is then used for the search.

+
+ +
+

Module

+
+
+ +

 FilteredQuery

+
+ + FilteredQuery ( someQuery, someFilter ) + + +

A query that applies a filter to the results of another query.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + someQuery + + + <Object> + + + + + + a valid Query object +
+ + + + + someFilter + + + <Object> + + + + + + a valid Filter object. This parameter + is optional. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectboost(boost)Sets the boost value for documents matching the Query.
Objectcache(trueFalse)

Enables caching of the filter.

ObjectcacheKey(k)

Set the cache key.

Objectfilter(oFilter)

Adds the filter to apply a constant score to.

Objectquery(oQuery)

Adds the query to apply a constant score to.

Objectstrategy(strategy)

Sets the filter strategy.

+ +

The strategy defines how the filter is applied during document collection. + Valid values are:

+ +
+
query_first - advance query scorer first then filter
+
random_access_random - random access filter
+
leap_frog - query scorer and filter "leap-frog", query goes first
+
leap_frog_filter_first - same as leap_frog, but filter goes first
+
random_access_N - replace N with integer, same as random access + except you can specify a custom threshold
+
+ +

This is an advanced setting, use with care.

StringtoJSON()Retrieves the internal query object. This is typically used by + internal API functions so use with caution.
+
+ +

Method Detail

+ + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 boost

+
+ + Object boost ( boost ) + + +
Sets the boost value for documents matching the Query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + boost + + + <Double> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 cache

+
+ + Object cache ( trueFalse ) + + +

Enables caching of the filter.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + A boolean value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 cacheKey

+
+ + Object cacheKey ( k ) + + +

Set the cache key.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + k + + + <String> + + + + + + A string cache key. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 filter

+
+ + Object filter ( oFilter ) + + +

Adds the filter to apply a constant score to.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + oFilter + + + <Object> + + + + + + A valid Filter object +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 query

+
+ + Object query ( oQuery ) + + +

Adds the query to apply a constant score to.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + oQuery + + + <Object> + + + + + + A valid Query object +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 strategy

+
+ + Object strategy ( strategy ) + + +

Sets the filter strategy.

+ +

The strategy defines how the filter is applied during document collection. + Valid values are:

+ +
+
query_first - advance query scorer first then filter
+
random_access_random - random access filter
+
leap_frog - query scorer and filter "leap-frog", query goes first
+
leap_frog_filter_first - same as leap_frog, but filter goes first
+
random_access_N - replace N with integer, same as random access + except you can specify a custom threshold
+
+ +

This is an advanced setting, use with care.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + strategy + + + <String> + + + + + + The strategy as a string. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +
Retrieves the internal query object. This is typically used by + internal API functions so use with caution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal query property. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.FiltersAggregation.html b/dist/docs/ejs.FiltersAggregation.html new file mode 100644 index 0000000..3e2e14b --- /dev/null +++ b/dist/docs/ejs.FiltersAggregation.html @@ -0,0 +1,651 @@ + + + + + elastic.js: Module: FiltersAggregation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsFiltersAggregation
+

+ +

Defines a multi bucket aggregations where each bucket is + associated with a filter. Each bucket will collect all documents + that match its associated filter.

+
+ +
+

Module

+
+
+ +

 FiltersAggregation

+
+ + FiltersAggregation ( name ) + + +

Defines a multi bucket aggregations where each bucket is + associated with a filter. Each bucket will collect all documents + that match its associated filter.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + name + + + <String> + + + + + + The name which be used to refer to this aggregation. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectagg(agg)Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method.
Objectaggregation(agg)Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation.
Objectfilter(oFilter,id)

Sets the filters to be used for this aggregation.

StringtoJSON()

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.

+
+ +

Method Detail

+ + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 agg

+
+ + Object agg ( agg ) + + +
Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + agg + + + <Aggregation> + + + + + + Any valid Aggregation object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 aggregation

+
+ + Object aggregation ( agg ) + + +
Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + agg + + + <Aggregation> + + + + + + Any valid Aggregation object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 filter

+
+ + Object filter ( oFilter, id ) + + +

Sets the filters to be used for this aggregation.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + oFilter + + + <Filter> + + + + + + A valid Filter object. +
+ + + + + id + + + <string> + + + + + + A name for the filter. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal object. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.FunctionScoreQuery.html b/dist/docs/ejs.FunctionScoreQuery.html new file mode 100644 index 0000000..0eb920c --- /dev/null +++ b/dist/docs/ejs.FunctionScoreQuery.html @@ -0,0 +1,1174 @@ + + + + + elastic.js: Module: FunctionScoreQuery + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsFunctionScoreQuery
+

+ +

The function_score allows you to modify the score of documents that are + retrieved by a query. This can be useful if, for example, a score function is + computationally expensive and it is sufficient to compute the score on a + filtered set of documents.

+
+ +
+

Module

+
+
+ +

 FunctionScoreQuery

+
+ + FunctionScoreQuery ( ) + + +

A query that allows you to modify the score of matching documents.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectboost(boost)Sets the boost value for documents matching the Query.
Objectboost(boost)Sets the boost value for all documents matching the query.
ObjectboostMode(mode)Set the setermines how the new calculated score is combined with the + score from the original query. Valid values are: multiply, replace, sum, + avg, max, and min.
Objectfilter(oFilter)Set the source filter.
Objectfunction(func)Add a single score function to the list of existing functions.
Objectfunctions(funcs)Sets the score functions. Replaces any existing score functions.
ObjectmaxBoost(maxBoost)Sets the maximum boost value.
ObjectminScore(minScore)Sets the minimum score a document should have to be included.
Objectquery(oQuery)Set the source query.
ObjectscoreMode(mode)Set the scoring mode which specifies how the computed scores are combined. + Valid values are: avg, max, min, sum, multiply, and first.
StringtoJSON()Retrieves the internal query object. This is typically used by + internal API functions so use with caution.
+
+ +

Method Detail

+ + + + + + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 boost

+
+ + Object boost ( boost ) + + +
Sets the boost value for documents matching the Query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + boost + + + <Double> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 boost

+
+ + Object boost ( boost ) + + +
Sets the boost value for all documents matching the query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + boost + + + <Float> + + + + + + A positive float value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 boostMode

+
+ + Object boostMode ( mode ) + + +
Set the setermines how the new calculated score is combined with the + score from the original query. Valid values are: multiply, replace, sum, + avg, max, and min.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + mode + + + <String> + + + + + + A boosting mode. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 filter

+
+ + Object filter ( oFilter ) + + +
Set the source filter.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + oFilter + + + <Filter> + + + + + + A valid Filter object +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 function

+
+ + Object function ( func ) + + +
Add a single score function to the list of existing functions.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + func + + + <ScoreFunction> + + + + + + A valid ScoreFunction object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 functions

+
+ + Object functions ( funcs ) + + +
Sets the score functions. Replaces any existing score functions.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + funcs + + + <ScoreFunction[]> + + + + + + A array of ScoreFunctions. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 maxBoost

+
+ + Object maxBoost ( maxBoost ) + + +
Sets the maximum boost value.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + maxBoost + + + <Float> + + + + + + A positive float value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 minScore

+
+ + Object minScore ( minScore ) + + +
Sets the minimum score a document should have to be included.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + minScore + + + <Float> + + + + + + A positive float value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 query

+
+ + Object query ( oQuery ) + + +
Set the source query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + oQuery + + + <Query> + + + + + + A valid Query object +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scoreMode

+
+ + Object scoreMode ( mode ) + + +
Set the scoring mode which specifies how the computed scores are combined. + Valid values are: avg, max, min, sum, multiply, and first.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + mode + + + <String> + + + + + + A scoring mode. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +
Retrieves the internal query object. This is typically used by + internal API functions so use with caution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal query property. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.FuzzyLikeThisFieldQuery.html b/dist/docs/ejs.FuzzyLikeThisFieldQuery.html new file mode 100644 index 0000000..2302025 --- /dev/null +++ b/dist/docs/ejs.FuzzyLikeThisFieldQuery.html @@ -0,0 +1,1143 @@ + + + + + elastic.js: Module: FuzzyLikeThisFieldQuery + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsFuzzyLikeThisFieldQuery
+

+ +

The fuzzy_like_this_field query is the same as the fuzzy_like_this + query, except that it runs against a single field. It provides nicer query + DSL over the generic fuzzy_like_this query, and support typed fields + query (automatically wraps typed fields with type filter to match only on + the specific type).

+ +

Fuzzifies ALL terms provided as strings and then picks the best n + differentiating terms. In effect this mixes the behaviour of FuzzyQuery and + MoreLikeThis but with special consideration of fuzzy scoring factors. This + generally produces good results for queries where users may provide details + in a number of fields and have no knowledge of boolean query syntax and + also want a degree of fuzzy matching and a fast query.

+ +

For each source term the fuzzy variants are held in a BooleanQuery with + no coord factor (because we are not looking for matches on multiple variants + in any one doc). Additionally, a specialized TermQuery is used for variants + and does not use that variant term’s IDF because this would favour rarer + terms eg misspellings. Instead, all variants use the same IDF + ranking (the one for the source query term) and this is factored into the + variant’s boost. If the source query term does not exist in the index the + average IDF of the variants is used.

+
+ +
+

Module

+
+
+ +

 FuzzyLikeThisFieldQuery

+
+ + FuzzyLikeThisFieldQuery ( field, likeText ) + + +

Constructs a query where each documents returned are “like†provided text


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + field + + + <String> + + + + + + The field to run the query against. +
+ + + + + likeText + + + <String> + + + + + + The text to find documents like it. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectanalyzer(analyzerName)The analyzer that will be used to analyze the text. Defaults to the + analyzer associated with the field.
Objectboost(boost)Sets the boost value of the Query.
ObjectfailOnUnsupportedField(trueFalse)Should the Query fail when an unsupported field + is specified. Defaults to true.
Objectfield(f)The field to run the query against.
ObjectignoreTf(trueFalse)Should term frequency be ignored. Defaults to false.
ObjectlikeText(s)The text to find documents like
ObjectmaxQueryTerms(max)The maximum number of query terms that will be included in any + generated query. Defaults to 25.
ObjectminSimilarity(min)The minimum similarity of the term variants. Defaults to 0.5.
ObjectprefixLength(len)Length of required common prefix on variant terms. Defaults to 0..
StringtoJSON()Retrieves the internal query object. This is typically used by + internal API functions so use with caution.
+
+ +

Method Detail

+ + + + + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 analyzer

+
+ + Object analyzer ( analyzerName ) + + +
The analyzer that will be used to analyze the text. Defaults to the + analyzer associated with the field.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + analyzerName + + + <String> + + + + + + The name of the analyzer. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 boost

+
+ + Object boost ( boost ) + + +
Sets the boost value of the Query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + boost + + + <Double> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 failOnUnsupportedField

+
+ + Object failOnUnsupportedField ( trueFalse ) + + +
Should the Query fail when an unsupported field + is specified. Defaults to true.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + A boolean value +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( f ) + + +
The field to run the query against.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + f + + + <String> + + + + + + A single field name. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 ignoreTf

+
+ + Object ignoreTf ( trueFalse ) + + +
Should term frequency be ignored. Defaults to false.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + A boolean value +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 likeText

+
+ + Object likeText ( s ) + + +
The text to find documents like

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + s + + + <String> + + + + + + A text string. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 maxQueryTerms

+
+ + Object maxQueryTerms ( max ) + + +
The maximum number of query terms that will be included in any + generated query. Defaults to 25.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + max + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 minSimilarity

+
+ + Object minSimilarity ( min ) + + +
The minimum similarity of the term variants. Defaults to 0.5.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + min + + + <Double> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 prefixLength

+
+ + Object prefixLength ( len ) + + +
Length of required common prefix on variant terms. Defaults to 0..

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + len + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +
Retrieves the internal query object. This is typically used by + internal API functions so use with caution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal query property. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.FuzzyLikeThisQuery.html b/dist/docs/ejs.FuzzyLikeThisQuery.html new file mode 100644 index 0000000..4539e7e --- /dev/null +++ b/dist/docs/ejs.FuzzyLikeThisQuery.html @@ -0,0 +1,1129 @@ + + + + + elastic.js: Module: FuzzyLikeThisQuery + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsFuzzyLikeThisQuery
+

+ +

Fuzzy like this query find documents that are “like†provided text by + running it against one or more fields.

+ +

Fuzzifies ALL terms provided as strings and then picks the best n + differentiating terms. In effect this mixes the behaviour of FuzzyQuery and + MoreLikeThis but with special consideration of fuzzy scoring factors. This + generally produces good results for queries where users may provide details + in a number of fields and have no knowledge of boolean query syntax and + also want a degree of fuzzy matching and a fast query.

+ +

For each source term the fuzzy variants are held in a BooleanQuery with + no coord factor (because we are not looking for matches on multiple variants + in any one doc). Additionally, a specialized TermQuery is used for variants + and does not use that variant term’s IDF because this would favour rarer + terms eg misspellings. Instead, all variants use the same IDF + ranking (the one for the source query term) and this is factored into the + variant’s boost. If the source query term does not exist in the index the + average IDF of the variants is used.

+
+ +
+

Module

+
+
+ +

 FuzzyLikeThisQuery

+
+ + FuzzyLikeThisQuery ( likeText ) + + +

Constructs a query where each documents returned are “like†provided text


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + likeText + + + <String> + + + + + + The text to find documents like it. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectanalyzer(analyzerName)The analyzer that will be used to analyze the text. Defaults to the + analyzer associated with the field.
Objectboost(boost)Sets the boost value for documents matching the Query.
ObjectfailOnUnsupportedField(trueFalse)Should the Query fail when an unsupported field + is specified. Defaults to true.
Objectfields(f)The fields to run the query against. If you call with a single field, + it is added to the existing list of fields. If called with an array + of field names, it replaces any existing values with the new array.
ObjectignoreTf(trueFalse)Should term frequency be ignored. Defaults to false.
ObjectlikeText(s)The text to find documents like
ObjectmaxQueryTerms(max)The maximum number of query terms that will be included in any + generated query. Defaults to 25.
ObjectminSimilarity(min)The minimum similarity of the term variants. Defaults to 0.5.
ObjectprefixLength(len)Length of required common prefix on variant terms. Defaults to 0..
StringtoJSON()Retrieves the internal query object. This is typically used by + internal API functions so use with caution.
+
+ +

Method Detail

+ + + + + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 analyzer

+
+ + Object analyzer ( analyzerName ) + + +
The analyzer that will be used to analyze the text. Defaults to the + analyzer associated with the field.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + analyzerName + + + <String> + + + + + + The name of the analyzer. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 boost

+
+ + Object boost ( boost ) + + +
Sets the boost value for documents matching the Query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + boost + + + <Double> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 failOnUnsupportedField

+
+ + Object failOnUnsupportedField ( trueFalse ) + + +
Should the Query fail when an unsupported field + is specified. Defaults to true.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + A boolean value +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 fields

+
+ + Object fields ( f ) + + +
The fields to run the query against. If you call with a single field, + it is added to the existing list of fields. If called with an array + of field names, it replaces any existing values with the new array.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + f + + + <String | String[]> + + + + + + A single field name or a list of field names. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 ignoreTf

+
+ + Object ignoreTf ( trueFalse ) + + +
Should term frequency be ignored. Defaults to false.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + A boolean value +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 likeText

+
+ + Object likeText ( s ) + + +
The text to find documents like

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + s + + + <String> + + + + + + A text string. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 maxQueryTerms

+
+ + Object maxQueryTerms ( max ) + + +
The maximum number of query terms that will be included in any + generated query. Defaults to 25.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + max + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 minSimilarity

+
+ + Object minSimilarity ( min ) + + +
The minimum similarity of the term variants. Defaults to 0.5.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + min + + + <Double> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 prefixLength

+
+ + Object prefixLength ( len ) + + +
Length of required common prefix on variant terms. Defaults to 0..

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + len + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +
Retrieves the internal query object. This is typically used by + internal API functions so use with caution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal query property. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.FuzzyQuery.html b/dist/docs/ejs.FuzzyQuery.html new file mode 100644 index 0000000..243a6a2 --- /dev/null +++ b/dist/docs/ejs.FuzzyQuery.html @@ -0,0 +1,1098 @@ + + + + + elastic.js: Module: FuzzyQuery + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsFuzzyQuery
+

+ +

A fuzzy search query based on the Damerau-Levenshtein (optimal string + alignment) algorithm, though you can explicitly choose classic Levenshtein + by passing false to the transpositions parameter./p> + +

fuzzy query on a numeric field will result in a range query “around†+ the value using the min_similarity value. As an example, if you perform a + fuzzy query against a field value of "12" with a min similarity setting + of "2", the query will search for values between "10" and "14".

+
+ +
+

Module

+
+
+ +

 FuzzyQuery

+
+ + FuzzyQuery ( field, value ) + + +

Constructs a query where each documents returned are “like†provided text


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + field + + + <String> + + + + + + The field to run the fuzzy query against. +
+ + + + + value + + + <String> + + + + + + The value to fuzzify. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectboost(boost)

Sets the boost value of the Query.

Objectfield(f)

The field to run the query against.

ObjectmaxExpansions(max)

The maximum number of query terms that will be included in any + generated query. Defaults to 50.

ObjectminSimilarity(min)

The minimum similarity of the term variants. Defaults to 0.5.

ObjectprefixLength(len)

Length of required common prefix on variant terms. Defaults to 0.

Objectrewrite(m)

Sets rewrite method. Valid values are:

+ +
+
constant_score_auto - tries to pick the best constant-score rewrite + method based on term and document counts from the query
+ +
scoring_boolean - translates each term into boolean should and + keeps the scores as computed by the query
+ +
constant_score_boolean - same as scoring_boolean, expect no scores + are computed.
+ +
constant_score_filter - first creates a private Filter, by visiting + each term in sequence and marking all docs for that term
+ +
top_terms_boost_N - first translates each term into boolean should + and scores are only computed as the boost using the top N + scoring terms. Replace N with an integer value.
+ +
top_terms_N - first translates each term into boolean should + and keeps the scores as computed by the query. Only the top N + scoring terms are used. Replace N with an integer value.
+
+ +

Default is constant_score_auto.

+ +

This is an advanced option, use with care.

StringtoJSON()Retrieves the internal query object. This is typically used by + internal API functions so use with caution.
Objecttranspositions(trueFalse)

Set to false to use classic Levenshtein edit distance.

Objectvalue(s)

The query text to fuzzify.

+
+ +

Method Detail

+ + + + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 boost

+
+ + Object boost ( boost ) + + +

Sets the boost value of the Query.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + boost + + + <Double> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( f ) + + +

The field to run the query against.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + f + + + <String> + + + + + + A single field name. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 maxExpansions

+
+ + Object maxExpansions ( max ) + + +

The maximum number of query terms that will be included in any + generated query. Defaults to 50.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + max + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 minSimilarity

+
+ + Object minSimilarity ( min ) + + +

The minimum similarity of the term variants. Defaults to 0.5.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + min + + + <Double> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 prefixLength

+
+ + Object prefixLength ( len ) + + +

Length of required common prefix on variant terms. Defaults to 0.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + len + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 rewrite

+
+ + Object rewrite ( m ) + + +

Sets rewrite method. Valid values are:

+ +
+
constant_score_auto - tries to pick the best constant-score rewrite + method based on term and document counts from the query
+ +
scoring_boolean - translates each term into boolean should and + keeps the scores as computed by the query
+ +
constant_score_boolean - same as scoring_boolean, expect no scores + are computed.
+ +
constant_score_filter - first creates a private Filter, by visiting + each term in sequence and marking all docs for that term
+ +
top_terms_boost_N - first translates each term into boolean should + and scores are only computed as the boost using the top N + scoring terms. Replace N with an integer value.
+ +
top_terms_N - first translates each term into boolean should + and keeps the scores as computed by the query. Only the top N + scoring terms are used. Replace N with an integer value.
+
+ +

Default is constant_score_auto.

+ +

This is an advanced option, use with care.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + m + + + <String> + + + + + + The rewrite method as a string. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +
Retrieves the internal query object. This is typically used by + internal API functions so use with caution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal query property. + + + +
+ + + +
+ +
+
+
+ +

 transpositions

+
+ + Object transpositions ( trueFalse ) + + +

Set to false to use classic Levenshtein edit distance.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + A boolean value +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 value

+
+ + Object value ( s ) + + +

The query text to fuzzify.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + s + + + <String> + + + + + + A text string. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.GeoBboxFilter.html b/dist/docs/ejs.GeoBboxFilter.html new file mode 100644 index 0000000..f745182 --- /dev/null +++ b/dist/docs/ejs.GeoBboxFilter.html @@ -0,0 +1,1033 @@ + + + + + elastic.js: Module: GeoBboxFilter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsGeoBboxFilter
+

+ +

A filter that restricts matched results/docs to a geographic bounding box described by + the specified lon and lat coordinates. The format conforms with the GeoJSON specification.

+
+ +
+

Module

+
+
+ +

 GeoBboxFilter

+
+ + GeoBboxFilter ( fieldName ) + + +
Filter results to those which are contained within the defined bounding box.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + fieldName + + + <String> + + + + + + the document property/field containing the Geo Point (lon/lat). +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
ObjectbottomRight(p)Sets the bottom-right coordinate of the bounding box
Objectcache(trueFalse)Enable or disable caching of the filter
ObjectcacheKey(key)Sets the cache key.
Objectfield(f)Sets the fields to filter against.
Objectname(name)Sets the filter name.
Objectnormalize(trueFalse)If the lat/long points should be normalized to lie within their + respective normalized ranges. + + Normalized ranges are: + lon = -180 (exclusive) to 180 (inclusive) range + lat = -90 to 90 (both inclusive) range
ObjecttoJSON()Returns the filter object.
ObjecttopLeft(p)Sets the top-left coordinate of the bounding box
Objecttype(type)Sets the type of the bounding box execution. Valid values are + "memory" and "indexed". Default is memory.
+
+ +

Method Detail

+ + + + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 bottomRight

+
+ + Object bottomRight ( p ) + + +
Sets the bottom-right coordinate of the bounding box

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + p + + + <GeoPoint> + + + + + + A valid GeoPoint object +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 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 ( f ) + + +
Sets the fields to filter against.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + f + + + <String> + + + + + + A valid field name. +
+ + +
+ + + + + + +
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. + + + +
+ + + +
+ +
+
+
+ +

 normalize

+
+ + Object normalize ( trueFalse ) + + +
If the lat/long points should be normalized to lie within their + respective normalized ranges. + + Normalized ranges are: + lon = -180 (exclusive) to 180 (inclusive) range + lat = -90 to 90 (both inclusive) range

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <String> + + + + + + True if the coordinates should be normalized. False otherwise. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + Object toJSON ( ) + + +
Returns the filter object.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ filter object + + + +
+ + + +
+ +
+
+
+ +

 topLeft

+
+ + Object topLeft ( p ) + + +
Sets the top-left coordinate of the bounding box

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + p + + + <GeoPoint> + + + + + + A valid GeoPoint object +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 type

+
+ + Object type ( type ) + + +
Sets the type of the bounding box execution. Valid values are + "memory" and "indexed". Default is memory.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + type + + + <String> + + + + + + The execution type as a string. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.GeoBoundsAggregation.html b/dist/docs/ejs.GeoBoundsAggregation.html new file mode 100644 index 0000000..edc0efc --- /dev/null +++ b/dist/docs/ejs.GeoBoundsAggregation.html @@ -0,0 +1,542 @@ + + + + + elastic.js: Module: GeoBoundsAggregation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsGeoBoundsAggregation
+

+ +

A metric aggregation that computes the bounding box containing all geo_point values for a field.

+
+ +
+

Module

+
+
+ +

 GeoBoundsAggregation

+
+ + GeoBoundsAggregation ( name ) + + +

Aggregation that computes the bounding box containing all geo_point values for a field.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + name + + + <String> + + + + + + The name which be used to refer to this aggregation. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectfield(field)

Sets the field to operate on.

StringtoJSON()

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.

ObjectwrapLongitude(trueFalse)Optional parameter which specifies whether the bounding box should be allowed to overlap the international date line. The default value is true
+
+ +

Method Detail

+ + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( field ) + + +

Sets the field to operate on.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + field + + + <String> + + + + + + a valid field name.. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal object. + + + +
+ + + +
+ +
+
+
+ +

 wrapLongitude

+
+ + Object wrapLongitude ( trueFalse ) + + +
Optional parameter which specifies whether the bounding box should be allowed to overlap the international date line. The default value is true

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + to overlap the international date line. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.GeoDistanceAggregation.html b/dist/docs/ejs.GeoDistanceAggregation.html new file mode 100644 index 0000000..3491a2d --- /dev/null +++ b/dist/docs/ejs.GeoDistanceAggregation.html @@ -0,0 +1,1239 @@ + + + + + elastic.js: Module: GeoDistanceAggregation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsGeoDistanceAggregation
+

+ +

A multi-bucket aggregation that works on geo_point fields and conceptually + works very similar to the range aggregation. The user can define a point of + origin and a set of distance range buckets. The aggregation evaluate the + distance of each document value from the origin point and determines the + buckets it belongs to based on the ranges (a document belongs to a bucket + if the distance between the document and the origin falls within the distance + range of the bucket).

+
+ +
+

Module

+
+
+ +

 GeoDistanceAggregation

+
+ + GeoDistanceAggregation ( name ) + + +

Aggregation that works on geo_point fields and conceptually works very + similar to the range aggregation.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + name + + + <String> + + + + + + The name which be used to refer to this aggregation. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectagg(agg)Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method.
Objectaggregation(agg)Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation.
Objectcenter(p)Sets the point of origin from where distances will be measured. Same as + origin.
ObjectdistanceType(type)How to compute the distance. Valid values are: + plane, arc, sloppy_arc, and factor.
Objectfield(field)

Sets the field to gather terms from.

Objectkeyed(trueFalse)Enable the response to be returned as a keyed object where the key is the + bucket interval.
Objectorigin(p)Sets the point of origin from where distances will be measured.
Objectpoint(p)Sets the point of origin from where distances will be measured. Same as + origin.
Objectrange(from,to,key)Adds a range to the list of exsiting range expressions.
StringtoJSON()

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.

Objectunit(unit)Sets the distance unit. Valid values are: + in, yd, ft, km, NM, mm, cm, mi, and m.
+
+ +

Method Detail

+ + + + + + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 agg

+
+ + Object agg ( agg ) + + +
Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + agg + + + <Aggregation> + + + + + + Any valid Aggregation object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 aggregation

+
+ + Object aggregation ( agg ) + + +
Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + agg + + + <Aggregation> + + + + + + Any valid Aggregation object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 center

+
+ + Object center ( p ) + + +
Sets the point of origin from where distances will be measured. Same as + origin.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + p + + + <GeoPoint> + + + + + + A valid GeoPoint object +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 distanceType

+
+ + Object distanceType ( type ) + + +
How to compute the distance. Valid values are: + plane, arc, sloppy_arc, and factor.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + type + + + <String> + + + + + + The execution type as a string. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( field ) + + +

Sets the field to gather terms from.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + field + + + <String> + + + + + + a valid field name.. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 keyed

+
+ + Object keyed ( trueFalse ) + + +
Enable the response to be returned as a keyed object where the key is the + bucket interval.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + to enable keyed response or not +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 origin

+
+ + Object origin ( p ) + + +
Sets the point of origin from where distances will be measured.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + p + + + <GeoPoint> + + + + + + A valid GeoPoint object +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 point

+
+ + Object point ( p ) + + +
Sets the point of origin from where distances will be measured. Same as + origin.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + p + + + <GeoPoint> + + + + + + A valid GeoPoint object +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 range

+
+ + Object range ( from, to, key ) + + +
Adds a range to the list of exsiting range expressions.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + from + + + <String> + + + + + + The start value, use null to ignore +
+ + + + + to + + + <String> + + + + + + The end value, use null to ignore. +
+ + + + + key + + + <String> + + + + + + Optional key/bucket name for keyed responses. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal object. + + + +
+ + + +
+ +
+
+
+ +

 unit

+
+ + Object unit ( unit ) + + +
Sets the distance unit. Valid values are: + in, yd, ft, km, NM, mm, cm, mi, and m.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + unit + + + <Number> + + + + + + the unit of distance measure. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.GeoDistanceFacet.html b/dist/docs/ejs.GeoDistanceFacet.html new file mode 100644 index 0000000..a3fa9b9 --- /dev/null +++ b/dist/docs/ejs.GeoDistanceFacet.html @@ -0,0 +1,1893 @@ + + + + + elastic.js: Module: GeoDistanceFacet + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsGeoDistanceFacet
+

+ +

The geoDistanceFacet facet provides information over a range of distances from a + provided point. This includes the number of hits that fall within each range, + along with aggregate information (like total).

+ +

Facets are similar to SQL GROUP BY statements but perform much + better. You can also construct several "groups" at once by simply + specifying multiple facets.

+ +
+

+ Tip: + For more information on faceted navigation, see + this + Wikipedia article on Faceted Classification. +

+

+
+ +
+

Module

+
+
+ +

 GeoDistanceFacet

+
+ + GeoDistanceFacet ( name ) + + +

A facet which provides information over a range of distances from a provided point.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + name + + + <String> + + + + + + The name which be used to refer to this facet. For instance, + the facet itself might utilize a field named doc_authors. Setting + name to Authors would allow you to refer to the + facet by that name, possibly simplifying some of the display logic. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
ObjectaddRange(from,to)Adds a new bounded range.
ObjectaddUnboundedFrom(from)Adds a new unbounded lower limit.
ObjectaddUnboundedTo(to)Adds a new unbounded upper limit.
ObjectcacheFilter(trueFalse)

Enables caching of the facetFilter

ObjectdistanceType(type)How to compute the distance. Can either be arc (better precision) + or plane (faster). Defaults to arc.
ObjectfacetFilter(oFilter)

Allows you to reduce the documents used for computing facet results.

Objectfield(fieldName)Sets the document field containing the geo-coordinate to be used + to calculate the distance. Defaults to "location".
Objectglobal(trueFalse)

Computes values across the entire index

Objectlang(language)The script language being used. Currently supported values are + javascript, groovy, and mvel.
Objectmode(m)

Sets the mode the facet will use.

+ +

+
collector
+
post
+
Objectnested(path)

Sets the path to the nested document if faceting against a + nested field.

Objectnormalize(trueFalse)If the lat/long points should be normalized to lie within their + respective normalized ranges. + + Normalized ranges are: + lon = -180 (exclusive) to 180 (inclusive) range + lat = -90 to 90 (both inclusive) range
Objectparams(p)Sets parameters that will be applied to the script. Overwrites + any existing params.
Objectpoint(p)Sets the point of origin from where distances will be measured.
Objectscope(scope)

Computes values across the the specified scope

StringtoJSON()

Retrieves the internal facet object. This is typically used by + internal API functions so use with caution.

Objectunit(unit)Sets the distance unit. Valid values are "mi" for miles or "km" + for kilometers. Defaults to "km".
ObjectvalueField(fieldName)Allows you to specify a different value field to aggrerate over.
ObjectvalueScript(scriptCode)Allows you modify the value field using a script. The modified value + is then used to compute the statistical data.
+
+ +

Method Detail

+ + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 addRange

+
+ + Object addRange ( from, to ) + + +
Adds a new bounded range.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + from + + + <Number> + + + + + + The lower bound of the range +
+ + + + + to + + + <Number> + + + + + + The upper bound of the range +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 addUnboundedFrom

+
+ + Object addUnboundedFrom ( from ) + + +
Adds a new unbounded lower limit.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + from + + + <Number> + + + + + + The lower limit of the unbounded range +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 addUnboundedTo

+
+ + Object addUnboundedTo ( to ) + + +
Adds a new unbounded upper limit.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + to + + + <Number> + + + + + + The upper limit of the unbounded range +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 cacheFilter

+
+ + Object cacheFilter ( trueFalse ) + + +

Enables caching of the facetFilter


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + If the facetFilter should be cached or not +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 distanceType

+
+ + Object distanceType ( type ) + + +
How to compute the distance. Can either be arc (better precision) + or plane (faster). Defaults to arc.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + type + + + <String> + + + + + + The execution type as a string. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 facetFilter

+
+ + Object facetFilter ( oFilter ) + + +

Allows you to reduce the documents used for computing facet results.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + oFilter + + + <Object> + + + + + + A valid Filter object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( fieldName ) + + +
Sets the document field containing the geo-coordinate to be used + to calculate the distance. Defaults to "location".

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + fieldName + + + <String> + + + + + + The field name whose data will be used to construct the facet. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 global

+
+ + Object global ( trueFalse ) + + +

Computes values across the entire index


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + Calculate facet counts globally or not. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 lang

+
+ + Object lang ( language ) + + +
The script language being used. Currently supported values are + javascript, groovy, and mvel.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + language + + + <String> + + + + + + The language of the script. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 mode

+
+ + Object mode ( m ) + + +

Sets the mode the facet will use.

+ +

+
collector
+
post
+

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + m + + + <String> + + + + + + The mode: collector or post. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 nested

+
+ + Object nested ( path ) + + +

Sets the path to the nested document if faceting against a + nested field.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + path + + + <String> + + + + + + The nested path +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 normalize

+
+ + Object normalize ( trueFalse ) + + +
If the lat/long points should be normalized to lie within their + respective normalized ranges. + + Normalized ranges are: + lon = -180 (exclusive) to 180 (inclusive) range + lat = -90 to 90 (both inclusive) range

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <String> + + + + + + True if the coordinates should be normalized. False otherwise. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 params

+
+ + Object params ( p ) + + +
Sets parameters that will be applied to the script. Overwrites + any existing params.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + p + + + <Object> + + + + + + An object where the keys are the parameter name and + values are the parameter value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 point

+
+ + Object point ( p ) + + +
Sets the point of origin from where distances will be measured.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + p + + + <GeoPoint> + + + + + + A valid GeoPoint object +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scope

+
+ + Object scope ( scope ) + + +

Computes values across the the specified scope


+ +
+
+ + + + + +
Deprecated
since elasticsearch 0.90
+ + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scope + + + <String> + + + + + + The scope name to calculate facet counts with. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal facet object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal facet property. + + + +
+ + + +
+ +
+
+
+ +

 unit

+
+ + Object unit ( unit ) + + +
Sets the distance unit. Valid values are "mi" for miles or "km" + for kilometers. Defaults to "km".

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + unit + + + <Number> + + + + + + the unit of distance measure. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 valueField

+
+ + Object valueField ( fieldName ) + + +
Allows you to specify a different value field to aggrerate over.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + fieldName + + + <String> + + + + + + The name of the field to be used. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 valueScript

+
+ + Object valueScript ( scriptCode ) + + +
Allows you modify the value field using a script. The modified value + is then used to compute the statistical data.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptCode + + + <String> + + + + + + A valid script string to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.GeoDistanceFilter.html b/dist/docs/ejs.GeoDistanceFilter.html new file mode 100644 index 0000000..abd12c4 --- /dev/null +++ b/dist/docs/ejs.GeoDistanceFilter.html @@ -0,0 +1,1205 @@ + + + + + elastic.js: Module: GeoDistanceFilter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsGeoDistanceFilter
+

+ +

A filter that restricts matched results/docs to a given distance from the + point of origin. The format conforms with the GeoJSON specification.

+
+ +
+

Module

+
+
+ +

 GeoDistanceFilter

+
+ + GeoDistanceFilter ( fieldName ) + + +
Filter results to those which fall within the given distance of the point of origin.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + fieldName + + + <String> + + + + + + the document property/field containing the Geo Point (lon/lat). +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
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.
Objectdistance(numericDistance)Sets the numeric distance to be used. The distance can be a + numeric value, and then the unit (either mi or km can be set) + controlling the unit. Or a single string with the unit as well.
ObjectdistanceType(type)How to compute the distance. Can either be arc (better precision) + or plane (faster). Defaults to arc.
Objectfield(f)Sets the fields to filter against.
Objectname(name)Sets the filter name.
Objectnormalize(trueFalse)If the lat/long points should be normalized to lie within their + respective normalized ranges. + + Normalized ranges are: + lon = -180 (exclusive) to 180 (inclusive) range + lat = -90 to 90 (both inclusive) range
ObjectoptimizeBbox(t)Will an optimization of using first a bounding box check will be + used. Defaults to memory which will do in memory checks. Can also + have values of indexed to use indexed value check, or none which + disables bounding box optimization.
Objectpoint(p)Sets the point of origin in which distance will be measured from
ObjecttoJSON()Returns the filter object.
Objectunit(unit)Sets the distance unit. Valid values are "mi" for miles or "km" + for kilometers. Defaults to "km".
+
+ +

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. + + + +
+ + + +
+ +
+
+
+ +

 distance

+
+ + Object distance ( numericDistance ) + + +
Sets the numeric distance to be used. The distance can be a + numeric value, and then the unit (either mi or km can be set) + controlling the unit. Or a single string with the unit as well.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + numericDistance + + + <Number> + + + + + + the numeric distance +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 distanceType

+
+ + Object distanceType ( type ) + + +
How to compute the distance. Can either be arc (better precision) + or plane (faster). Defaults to arc.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + type + + + <String> + + + + + + The execution type as a string. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( f ) + + +
Sets the fields to filter against.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + f + + + <String> + + + + + + A valid field name. +
+ + +
+ + + + + + +
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. + + + +
+ + + +
+ +
+
+
+ +

 normalize

+
+ + Object normalize ( trueFalse ) + + +
If the lat/long points should be normalized to lie within their + respective normalized ranges. + + Normalized ranges are: + lon = -180 (exclusive) to 180 (inclusive) range + lat = -90 to 90 (both inclusive) range

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <String> + + + + + + True if the coordinates should be normalized. False otherwise. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 optimizeBbox

+
+ + Object optimizeBbox ( t ) + + +
Will an optimization of using first a bounding box check will be + used. Defaults to memory which will do in memory checks. Can also + have values of indexed to use indexed value check, or none which + disables bounding box optimization.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + t + + + <String> + + + + + + optimization type of memory, indexed, or none. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 point

+
+ + Object point ( p ) + + +
Sets the point of origin in which distance will be measured from

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + p + + + <GeoPoint> + + + + + + A valid GeoPoint object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + Object toJSON ( ) + + +
Returns the filter object.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ filter object + + + +
+ + + +
+ +
+
+
+ +

 unit

+
+ + Object unit ( unit ) + + +
Sets the distance unit. Valid values are "mi" for miles or "km" + for kilometers. Defaults to "km".

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + unit + + + <Number> + + + + + + the unit of distance measure. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.GeoDistanceRangeFilter.html b/dist/docs/ejs.GeoDistanceRangeFilter.html new file mode 100644 index 0000000..107d547 --- /dev/null +++ b/dist/docs/ejs.GeoDistanceRangeFilter.html @@ -0,0 +1,1771 @@ + + + + + elastic.js: Module: GeoDistanceRangeFilter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsGeoDistanceRangeFilter
+

+ +

A filter that restricts matched results/docs to a given distance range from the + point of origin. The format conforms with the GeoJSON specification.

+
+ +
+

Module

+
+
+ +

 GeoDistanceRangeFilter

+
+ + GeoDistanceRangeFilter ( fieldName ) + + +
Filter results to those which fall within the given distance range of the point of origin.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + fieldName + + + <String> + + + + + + the document property/field containing the Geo Point (lon/lat). +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
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.
ObjectdistanceType(type)How to compute the distance. Can either be arc (better precision) + or plane (faster). Defaults to arc.
Objectfield(f)Sets the fields to filter against.
Objectfrom(numericDistance)Sets the start point of the distance 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.
Objectnormalize(trueFalse)If the lat/long points should be normalized to lie within their + respective normalized ranges. + + Normalized ranges are: + lon = -180 (exclusive) to 180 (inclusive) range + lat = -90 to 90 (both inclusive) range
ObjectoptimizeBbox(t)Will an optimization of using first a bounding box check will be + used. Defaults to memory which will do in memory checks. Can also + have values of indexed to use indexed value check, or none which + disables bounding box optimization.
Objectpoint(p)Sets the point of origin in which distance will be measured from
Objectto(numericDistance)Sets the end point of the distance range
ObjecttoJSON()Returns the filter object.
Objectunit(unit)Sets the distance unit. Valid values are "mi" for miles or "km" + for kilometers. Defaults to "km".
+
+ +

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. + + + +
+ + + +
+ +
+
+
+ +

 distanceType

+
+ + Object distanceType ( type ) + + +
How to compute the distance. Can either be arc (better precision) + or plane (faster). Defaults to arc.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + type + + + <String> + + + + + + The execution type as a string. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( f ) + + +
Sets the fields to filter against.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + f + + + <String> + + + + + + A valid field name. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 from

+
+ + Object from ( numericDistance ) + + +
Sets the start point of the distance range

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + numericDistance + + + <Number> + + + + + + the numeric distance +
+ + +
+ + + + + + +
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 + + + <Number> + + + + + + the numeric distance +
+ + +
+ + + + + + +
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 + + + <Number> + + + + + + the numeric distance +
+ + +
+ + + + + + +
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 + + + <Number> + + + + + + the numeric distance +
+ + +
+ + + + + + +
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 + + + <Number> + + + + + + the numeric distance +
+ + +
+ + + + + + +
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. + + + +
+ + + +
+ +
+
+
+ +

 normalize

+
+ + Object normalize ( trueFalse ) + + +
If the lat/long points should be normalized to lie within their + respective normalized ranges. + + Normalized ranges are: + lon = -180 (exclusive) to 180 (inclusive) range + lat = -90 to 90 (both inclusive) range

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <String> + + + + + + True if the coordinates should be normalized. False otherwise. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 optimizeBbox

+
+ + Object optimizeBbox ( t ) + + +
Will an optimization of using first a bounding box check will be + used. Defaults to memory which will do in memory checks. Can also + have values of indexed to use indexed value check, or none which + disables bounding box optimization.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + t + + + <String> + + + + + + optimization type of memory, indexed, or none. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 point

+
+ + Object point ( p ) + + +
Sets the point of origin in which distance will be measured from

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + p + + + <GeoPoint> + + + + + + A valid GeoPoint object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 to

+
+ + Object to ( numericDistance ) + + +
Sets the end point of the distance range

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + numericDistance + + + <Number> + + + + + + the numeric distance +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + Object toJSON ( ) + + +
Returns the filter object.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ filter object + + + +
+ + + +
+ +
+
+
+ +

 unit

+
+ + Object unit ( unit ) + + +
Sets the distance unit. Valid values are "mi" for miles or "km" + for kilometers. Defaults to "km".

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + unit + + + <Number> + + + + + + the unit of distance measure. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.GeoHashGridAggregation.html b/dist/docs/ejs.GeoHashGridAggregation.html new file mode 100644 index 0000000..a047950 --- /dev/null +++ b/dist/docs/ejs.GeoHashGridAggregation.html @@ -0,0 +1,880 @@ + + + + + elastic.js: Module: GeoHashGridAggregation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsGeoHashGridAggregation
+

+ +

A multi-bucket aggregation that works on geo_point fields and groups points + into buckets that represent cells in a grid. The resulting grid can be sparse + and only contains cells that have matching data. Each cell is labeled using a + geohash which is of user-definable precision.

+
+ +
+

Module

+
+
+ +

 GeoHashGridAggregation

+
+ + GeoHashGridAggregation ( name ) + + +

Aggregation that works on geo_point fields and groups points into buckets + that represent cells in a grid.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + name + + + <String> + + + + + + The name which be used to refer to this aggregation. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectagg(agg)Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method.
Objectaggregation(agg)Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation.
Objectfield(field)Sets the geo field to perform calculations from.
Objectprecision(p)Sets the Geo Hash precision. The precision value can be between 1 and 12 + where 12 is the highest precision.
ObjectshardSize(shardSize)Determines how many geohash_grid the coordinating node will request from + each shard.
Objectsize(size)Sets the number of aggregation entries that will be returned.
StringtoJSON()

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.

+
+ +

Method Detail

+ + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 agg

+
+ + Object agg ( agg ) + + +
Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + agg + + + <Aggregation> + + + + + + Any valid Aggregation object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 aggregation

+
+ + Object aggregation ( agg ) + + +
Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + agg + + + <Aggregation> + + + + + + Any valid Aggregation object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( field ) + + +
Sets the geo field to perform calculations from.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + field + + + <String> + + + + + + a valid field name. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 precision

+
+ + Object precision ( p ) + + +
Sets the Geo Hash precision. The precision value can be between 1 and 12 + where 12 is the highest precision.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + p + + + <Integer> + + + + + + The precision. Integer between 1 and 12. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 shardSize

+
+ + Object shardSize ( shardSize ) + + +
Determines how many geohash_grid the coordinating node will request from + each shard.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + shardSize + + + <Integer> + + + + + + The numer of geohash_grid to fetch from each shard. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 size

+
+ + Object size ( size ) + + +
Sets the number of aggregation entries that will be returned.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + size + + + <Integer> + + + + + + The numer of aggregation entries to be returned. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal object. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.GeoPoint.html b/dist/docs/ejs.GeoPoint.html new file mode 100644 index 0000000..f23e125 --- /dev/null +++ b/dist/docs/ejs.GeoPoint.html @@ -0,0 +1,753 @@ + + + + + elastic.js: Module: GeoPoint + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsGeoPoint
+

+ +

A GeoPoint object that can be used in queries and filters that + take a GeoPoint. GeoPoint supports various input formats.

+ +

See http://www.elasticsearch.org/guide/reference/mapping/geo-point-type.html

+
+ +
+

Module

+
+
+ +

 GeoPoint

+
+ + GeoPoint ( p ) + + +

Defines a point


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + p + + + <Array> + + + + + + An optional point as an array in [lat, lon] format. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectarray(a)Sets the GeoPoint from an array point. The array must contain only + 2 values. The first value is the lat and the 2nd value is the lon. + + Example: + [41.12, -71.34]
Objectgeohash(hash,precision)Sets the GeoPoint as a GeoHash. The hash is a string of + alpha-numeric characters with a precision length that defaults to 12. + + Example: + "drm3btev3e86"
Objectproperties(obj)Sets the GeoPoint as properties on an object. The object must have + a 'lat' and 'lon' or a 'geohash' property. + + Example: + {lat: 41.12, lon: -71.34} or {geohash: "drm3btev3e86"}
Objectstring(s)Sets the GeoPoint as a string. The format is "lat,lon". + + Example: + + "41.12,-71.34"
StringtoJSON()Retrieves the internal script object. This is typically used by + internal API functions so use with caution.
+
+ +

Method Detail

+ + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 array

+
+ + Object array ( a ) + + +
Sets the GeoPoint from an array point. The array must contain only + 2 values. The first value is the lat and the 2nd value is the lon. + + Example: + [41.12, -71.34]

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + a + + + <Array> + + + + + + an array of length 2. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 geohash

+
+ + Object geohash ( hash, precision ) + + +
Sets the GeoPoint as a GeoHash. The hash is a string of + alpha-numeric characters with a precision length that defaults to 12. + + Example: + "drm3btev3e86"

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + hash + + + <String> + + + + + + an GeoHash as a string +
+ + + + + precision + + + <Integer> + + + + + + an optional precision length, defaults + to 12 if not specified. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 properties

+
+ + Object properties ( obj ) + + +
Sets the GeoPoint as properties on an object. The object must have + a 'lat' and 'lon' or a 'geohash' property. + + Example: + {lat: 41.12, lon: -71.34} or {geohash: "drm3btev3e86"}

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + obj + + + <Object> + + + + + + an object with a lat and lon or geohash property. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 string

+
+ + Object string ( s ) + + +
Sets the GeoPoint as a string. The format is "lat,lon". + + Example: + + "41.12,-71.34"

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + s + + + <String> + + + + + + a String point in "lat,lon" format. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +
Retrieves the internal script object. This is typically used by + internal API functions so use with caution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal object representation. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.GeoPolygonFilter.html b/dist/docs/ejs.GeoPolygonFilter.html new file mode 100644 index 0000000..53729da --- /dev/null +++ b/dist/docs/ejs.GeoPolygonFilter.html @@ -0,0 +1,877 @@ + + + + + elastic.js: Module: GeoPolygonFilter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsGeoPolygonFilter
+

+ +

A filter for locating documents that fall within a polygon of points. Simply provide a lon/lat + for each document as a Geo Point type. The format conforms with the GeoJSON specification.

+
+ +
+

Module

+
+
+ +

 GeoPolygonFilter

+
+ + GeoPolygonFilter ( fieldName ) + + +
Filter results to those which are contained within the polygon of points.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + fieldName + + + <String> + + + + + + the document property/field containing the Geo Point (lon/lat). +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
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(f)Sets the fields to filter against.
Objectname(name)Sets the filter name.
Objectnormalize(trueFalse)If the lat/long points should be normalized to lie within their + respective normalized ranges. + + Normalized ranges are: + lon = -180 (exclusive) to 180 (inclusive) range + lat = -90 to 90 (both inclusive) range
Objectpoints(pointsArray)Sets a series of points that represent a polygon. If passed a + single GeoPoint object, it is added to the current + list of points. If passed an array of GeoPoint + objects it replaces all current values.
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 ( f ) + + +
Sets the fields to filter against.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + f + + + <String> + + + + + + A valid field name. +
+ + +
+ + + + + + +
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. + + + +
+ + + +
+ +
+
+
+ +

 normalize

+
+ + Object normalize ( trueFalse ) + + +
If the lat/long points should be normalized to lie within their + respective normalized ranges. + + Normalized ranges are: + lon = -180 (exclusive) to 180 (inclusive) range + lat = -90 to 90 (both inclusive) range

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <String> + + + + + + True if the coordinates should be normalized. False otherwise. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 points

+
+ + Object points ( pointsArray ) + + +
Sets a series of points that represent a polygon. If passed a + single GeoPoint object, it is added to the current + list of points. If passed an array of GeoPoint + objects it replaces all current values.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + pointsArray + + + <Array> + + + + + + the array of points that represent the polygon +
+ + +
+ + + + + + +
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

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.GeoShapeFilter.html b/dist/docs/ejs.GeoShapeFilter.html new file mode 100644 index 0000000..ce4eea8 --- /dev/null +++ b/dist/docs/ejs.GeoShapeFilter.html @@ -0,0 +1,1045 @@ + + + + + elastic.js: Module: GeoShapeFilter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsGeoShapeFilter
+

+ +

Efficient filtering of documents containing shapes indexed using the + geo_shape type.

+ +

Much like the geo_shape type, the geo_shape filter uses a grid square + representation of the filter shape to find those documents which have shapes + that relate to the filter shape in a specified way. In order to do this, the + field being queried must be of geo_shape type. The filter will use the same + PrefixTree configuration as defined for the field.

+
+ +
+

Module

+
+
+ +

 GeoShapeFilter

+
+ + GeoShapeFilter ( ) + + +
A Filter to find documents with a geo_shapes matching a specific shape.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
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(f)Sets the field to filter against.
ObjectindexedShape(indexedShape)Sets the indexed shape. Use this if you already have shape definitions + already indexed.
Objectname(name)Sets the filter name.
Objectrelation(indexedShape)Sets the shape relation type. A relationship between a Query Shape + and indexed Shapes that will be used to determine if a Document + should be matched or not. Valid values are: intersects, disjoint, + and within.
Objectshape(shape)Sets the shape
Objectstrategy(strategy)

Sets the spatial strategy.

+

Valid values are:

+ +
+
recursive - default, recursively traverse nodes in + the spatial prefix tree. This strategy has support for + searching non-point shapes.
+
term - uses a large TermsFilter on each node + in the spatial prefix tree. It only supports the search of + indexed Point shapes.
+
+ +

This is an advanced setting, use with care.

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 ( f ) + + +
Sets the field to filter against.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + f + + + <String> + + + + + + A valid field name. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 indexedShape

+
+ + Object indexedShape ( indexedShape ) + + +
Sets the indexed shape. Use this if you already have shape definitions + already indexed.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + indexedShape + + + <String> + + + + + + A valid IndexedShape object. +
+ + +
+ + + + + + +
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. + + + +
+ + + +
+ +
+
+
+ +

 relation

+
+ + Object relation ( indexedShape ) + + +
Sets the shape relation type. A relationship between a Query Shape + and indexed Shapes that will be used to determine if a Document + should be matched or not. Valid values are: intersects, disjoint, + and within.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + indexedShape + + + <String> + + + + + + A valid IndexedShape object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 shape

+
+ + Object shape ( shape ) + + +
Sets the shape

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + shape + + + <String> + + + + + + A valid Shape object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 strategy

+
+ + Object strategy ( strategy ) + + +

Sets the spatial strategy.

+

Valid values are:

+ +
+
recursive - default, recursively traverse nodes in + the spatial prefix tree. This strategy has support for + searching non-point shapes.
+
term - uses a large TermsFilter on each node + in the spatial prefix tree. It only supports the search of + indexed Point shapes.
+
+ +

This is an advanced setting, use with care.


+ +
+
+ + + +
Since
+
elasticsearch 0.90
+ + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + strategy + + + <String> + + + + + + The strategy as a string. +
+ + +
+ + + + + + +
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

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.GeoShapeQuery.html b/dist/docs/ejs.GeoShapeQuery.html new file mode 100644 index 0000000..4c2d07f --- /dev/null +++ b/dist/docs/ejs.GeoShapeQuery.html @@ -0,0 +1,887 @@ + + + + + elastic.js: Module: GeoShapeQuery + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsGeoShapeQuery
+

+ +

Efficient querying of documents containing shapes indexed using the + geo_shape type.

+ +

Much like the geo_shape type, the geo_shape query uses a grid square + representation of the query shape to find those documents which have shapes + that relate to the query shape in a specified way. In order to do this, the + field being queried must be of geo_shape type. The query will use the same + PrefixTree configuration as defined for the field.

+
+ +
+

Module

+
+
+ +

 GeoShapeQuery

+
+ + GeoShapeQuery ( ) + + +
A Query to find documents with a geo_shapes matching a specific shape.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectboost(boost)Sets the boost value for documents matching the Query.
Objectfield(f)Sets the field to query against.
ObjectindexedShape(indexedShape)Sets the indexed shape. Use this if you already have shape definitions + already indexed.
Objectrelation(indexedShape)Sets the shape relation type. A relationship between a Query Shape + and indexed Shapes that will be used to determine if a Document + should be matched or not. Valid values are: intersects, disjoint, + and within.
Objectshape(shape)Sets the shape
Objectstrategy(strategy)

Sets the spatial strategy.

+

Valid values are:

+ +
+
recursive - default, recursively traverse nodes in + the spatial prefix tree. This strategy has support for + searching non-point shapes.
+
term - uses a large TermsFilter on each node + in the spatial prefix tree. It only supports the search of + indexed Point shapes.
+
+ +

This is an advanced setting, use with care.

StringtoJSON()Retrieves the internal query object. This is typically used by + internal API functions so use with caution.
+
+ +

Method Detail

+ + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 boost

+
+ + Object boost ( boost ) + + +
Sets the boost value for documents matching the Query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + boost + + + <Number> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( f ) + + +
Sets the field to query against.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + f + + + <String> + + + + + + A valid field name. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 indexedShape

+
+ + Object indexedShape ( indexedShape ) + + +
Sets the indexed shape. Use this if you already have shape definitions + already indexed.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + indexedShape + + + <String> + + + + + + A valid IndexedShape object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 relation

+
+ + Object relation ( indexedShape ) + + +
Sets the shape relation type. A relationship between a Query Shape + and indexed Shapes that will be used to determine if a Document + should be matched or not. Valid values are: intersects, disjoint, + and within.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + indexedShape + + + <String> + + + + + + A valid IndexedShape object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 shape

+
+ + Object shape ( shape ) + + +
Sets the shape

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + shape + + + <String> + + + + + + A valid Shape object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 strategy

+
+ + Object strategy ( strategy ) + + +

Sets the spatial strategy.

+

Valid values are:

+ +
+
recursive - default, recursively traverse nodes in + the spatial prefix tree. This strategy has support for + searching non-point shapes.
+
term - uses a large TermsFilter on each node + in the spatial prefix tree. It only supports the search of + indexed Point shapes.
+
+ +

This is an advanced setting, use with care.


+ +
+
+ + + +
Since
+
elasticsearch 0.90
+ + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + strategy + + + <String> + + + + + + The strategy as a string. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +
Retrieves the internal query object. This is typically used by + internal API functions so use with caution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal query property. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.GlobalAggregation.html b/dist/docs/ejs.GlobalAggregation.html new file mode 100644 index 0000000..5ef274f --- /dev/null +++ b/dist/docs/ejs.GlobalAggregation.html @@ -0,0 +1,554 @@ + + + + + elastic.js: Module: GlobalAggregation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsGlobalAggregation
+

+ +

Defines a single bucket of all the documents within the search execution + context. This context is defined by the indices and the document types you’re + searching on, but is not influenced by the search query itself.

+
+ +
+

Module

+
+
+ +

 GlobalAggregation

+
+ + GlobalAggregation ( name ) + + +

Defines a single bucket of all the documents within the search context.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + name + + + <String> + + + + + + The name which be used to refer to this aggregation. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectagg(agg)Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method.
Objectaggregation(agg)Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation.
StringtoJSON()

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.

+
+ +

Method Detail

+ + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 agg

+
+ + Object agg ( agg ) + + +
Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + agg + + + <Aggregation> + + + + + + Any valid Aggregation object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 aggregation

+
+ + Object aggregation ( agg ) + + +
Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + agg + + + <Aggregation> + + + + + + Any valid Aggregation object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal object. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.HasChildFilter.html b/dist/docs/ejs.HasChildFilter.html new file mode 100644 index 0000000..9a1e110 --- /dev/null +++ b/dist/docs/ejs.HasChildFilter.html @@ -0,0 +1,1124 @@ + + + + + elastic.js: Module: HasChildFilter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsHasChildFilter
+

+ +

The has_child filter results in parent documents that have child docs + matching the query being returned.

+
+ +
+

Module

+
+
+ +

 HasChildFilter

+
+ + HasChildFilter ( qryOrFltr, type ) + + +
Returns results that have child documents matching the filter.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + qryOrFltr + + + <Object> + + + + + + A valid query or filter object. +
+ + + + + type + + + <String> + + + + + + The child type +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
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.
Objectfilter(f)Sets the filter
ObjectinnerHits(i)Sets the inner hits options
Objectname(name)Sets the filter name.
Objectquery(q)Sets the query
Objectscope(s)Sets the scope of the filter. A scope allows to run facets on the + same scope name that will work against the child documents.
ObjectshortCircuitCutoff(cutoff)Sets the cutoff value to short circuit processing.
ObjecttoJSON()Returns the filter object.
Objecttype(t)Sets the child document type to search against
+
+ +

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. + + + +
+ + + +
+ +
+
+
+ +

 filter

+
+ + Object filter ( f ) + + +
Sets the filter

+ +
+
+ + + +
Since
+
elasticsearch 0.90
+ + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + f + + + <Query> + + + + + + A valid Filter object +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 innerHits

+
+ + Object innerHits ( i ) + + +
Sets the inner hits options

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + i + + + <InnerHits> + + + + + + A valid InnerHits object +
+ + +
+ + + + + + +
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. + + + +
+ + + +
+ +
+
+
+ +

 query

+
+ + Object query ( q ) + + +
Sets the query

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + q + + + <Query> + + + + + + A valid Query object +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scope

+
+ + Object scope ( s ) + + +
Sets the scope of the filter. A scope allows to run facets on the + same scope name that will work against the child documents.

+ +
+
+ + + + + +
Deprecated
since elasticsearch 0.90
+ + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + s + + + <String> + + + + + + The scope name as a string. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 shortCircuitCutoff

+
+ + Object shortCircuitCutoff ( cutoff ) + + +
Sets the cutoff value to short circuit processing.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + cutoff + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + Object toJSON ( ) + + +
Returns the filter object.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ filter object + + + +
+ + + +
+ +
+
+
+ +

 type

+
+ + Object type ( t ) + + +
Sets the child document type to search against

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + t + + + <String> + + + + + + A valid type name +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.HasChildQuery.html b/dist/docs/ejs.HasChildQuery.html new file mode 100644 index 0000000..bb5a816 --- /dev/null +++ b/dist/docs/ejs.HasChildQuery.html @@ -0,0 +1,1387 @@ + + + + + elastic.js: Module: HasChildQuery + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsHasChildQuery
+

+ +

The has_child query works the same as the has_child filter, + by automatically wrapping the filter with a constant_score. Results in + parent documents that have child docs matching the query being returned.

+
+ +
+

Module

+
+
+ +

 HasChildQuery

+
+ + HasChildQuery ( qry, type ) + + +
Returns results that have child documents matching the query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + qry + + + <Object> + + + + + + A valid query object. +
+ + + + + type + + + <String> + + + + + + The child type +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectboost(boost)Sets the boost value for documents matching the Query.
ObjectinnerHits(i)Sets the inner hits options
ObjectmaxChildren(max)Sets the max_children value.
ObjectmaxChildren(max)Sets the max_children value.
ObjectminChildren(min)Sets the min_children value.
ObjectminChildren(min)Sets the min_children value.
Objectquery(q)Sets the query
Objectscope(s)Sets the scope of the query. A scope allows to run facets on the + same scope name that will work against the child documents.
ObjectscoreMode(s)Sets the scoring method. Valid values are: + + none - the default, no scoring + max - the highest score of all matched child documents is used + sum - the sum the all the matched child documents is used + avg - the average of all matched child documents is used
ObjectscoreType(s)Sets the scoring method. Valid values are: + + none - the default, no scoring + max - the highest score of all matched child documents is used + sum - the sum the all the matched child documents is used + avg - the average of all matched child documents is used
ObjectshortCircuitCutoff(cutoff)Sets the cutoff value to short circuit processing.
StringtoJSON()Retrieves the internal query object. This is typically used by + internal API functions so use with caution.
Objecttype(t)Sets the child document type to search against
+
+ +

Method Detail

+ + + + + + + + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 boost

+
+ + Object boost ( boost ) + + +
Sets the boost value for documents matching the Query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + boost + + + <Double> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 innerHits

+
+ + Object innerHits ( i ) + + +
Sets the inner hits options

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + i + + + <InnerHits> + + + + + + A valid InnerHits object +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 maxChildren

+
+ + Object maxChildren ( max ) + + +
Sets the max_children value.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + max + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 maxChildren

+
+ + Object maxChildren ( max ) + + +
Sets the max_children value.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + max + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 minChildren

+
+ + Object minChildren ( min ) + + +
Sets the min_children value.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + min + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 minChildren

+
+ + Object minChildren ( min ) + + +
Sets the min_children value.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + min + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 query

+
+ + Object query ( q ) + + +
Sets the query

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + q + + + <Object> + + + + + + A valid Query object +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scope

+
+ + Object scope ( s ) + + +
Sets the scope of the query. A scope allows to run facets on the + same scope name that will work against the child documents.

+ +
+
+ + + + + +
Deprecated
since elasticsearch 0.90
+ + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + s + + + <String> + + + + + + The scope name as a string. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scoreMode

+
+ + Object scoreMode ( s ) + + +
Sets the scoring method. Valid values are: + + none - the default, no scoring + max - the highest score of all matched child documents is used + sum - the sum the all the matched child documents is used + avg - the average of all matched child documents is used

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + s + + + <String> + + + + + + The score type as a string. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scoreType

+
+ + Object scoreType ( s ) + + +
Sets the scoring method. Valid values are: + + none - the default, no scoring + max - the highest score of all matched child documents is used + sum - the sum the all the matched child documents is used + avg - the average of all matched child documents is used

+ +
+
+ + + + + +
Deprecated
since elasticsearch 0.90.1, use scoreMode
+ + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + s + + + <String> + + + + + + The score type as a string. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 shortCircuitCutoff

+
+ + Object shortCircuitCutoff ( cutoff ) + + +
Sets the cutoff value to short circuit processing.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + cutoff + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +
Retrieves the internal query object. This is typically used by + internal API functions so use with caution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal query property. + + + +
+ + + +
+ +
+
+
+ +

 type

+
+ + Object type ( t ) + + +
Sets the child document type to search against

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + t + + + <String> + + + + + + A valid type name +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.HasParentFilter.html b/dist/docs/ejs.HasParentFilter.html new file mode 100644 index 0000000..4a15121 --- /dev/null +++ b/dist/docs/ejs.HasParentFilter.html @@ -0,0 +1,1044 @@ + + + + + elastic.js: Module: HasParentFilter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsHasParentFilter
+

+ +

The has_parent results in child documents that have parent docs matching + the query being returned.

+
+ +
+

Module

+
+
+ +

 HasParentFilter

+
+ + HasParentFilter ( qryOrFltr, parentType ) + + +
Returns results that have parent documents matching the filter.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + qryOrFltr + + + <Object> + + + + + + A valid query or filter object. +
+ + + + + parentType + + + <String> + + + + + + The child type +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
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.
Objectfilter(f)Sets the filter
ObjectinnerHits(i)Sets the inner hits options
Objectname(name)Sets the filter name.
ObjectparentType(t)Sets the child document type to search against
Objectquery(q)Sets the query
Objectscope(s)Sets the scope of the filter. A scope allows to run facets on the + same scope name that will work against the parent documents.
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. + + + +
+ + + +
+ +
+
+
+ +

 filter

+
+ + Object filter ( f ) + + +
Sets the filter

+ +
+
+ + + +
Since
+
elasticsearch 0.90
+ + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + f + + + <Object> + + + + + + A valid Filter object +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 innerHits

+
+ + Object innerHits ( i ) + + +
Sets the inner hits options

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + i + + + <InnerHits> + + + + + + A valid InnerHits object +
+ + +
+ + + + + + +
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. + + + +
+ + + +
+ +
+
+
+ +

 parentType

+
+ + Object parentType ( t ) + + +
Sets the child document type to search against

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + t + + + <String> + + + + + + A valid type name +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 query

+
+ + Object query ( q ) + + +
Sets the query

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + q + + + <Object> + + + + + + A valid Query object +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scope

+
+ + Object scope ( s ) + + +
Sets the scope of the filter. A scope allows to run facets on the + same scope name that will work against the parent documents.

+ +
+
+ + + + + +
Deprecated
since elasticsearch 0.90
+ + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + s + + + <String> + + + + + + The scope name as a string. +
+ + +
+ + + + + + +
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

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.HasParentQuery.html b/dist/docs/ejs.HasParentQuery.html new file mode 100644 index 0000000..683c9c6 --- /dev/null +++ b/dist/docs/ejs.HasParentQuery.html @@ -0,0 +1,979 @@ + + + + + elastic.js: Module: HasParentQuery + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsHasParentQuery
+

+ +

The has_parent query works the same as the has_parent filter, by + automatically wrapping the filter with a constant_score. Results in + child documents that have parent docs matching the query being returned.

+
+ +
+

Module

+
+
+ +

 HasParentQuery

+
+ + HasParentQuery ( qry, parentType ) + + +
Returns results that have parent documents matching the query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + qry + + + <Object> + + + + + + A valid query object. +
+ + + + + parentType + + + <String> + + + + + + The child type +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectboost(boost)Sets the boost value for documents matching the Query.
ObjectinnerHits(i)Sets the inner hits options
ObjectparentType(t)Sets the child document type to search against
Objectquery(q)Sets the query
Objectscope(s)Sets the scope of the query. A scope allows to run facets on the + same scope name that will work against the parent documents.
ObjectscoreMode(s)Sets the scoring method. Valid values are: + + none - the default, no scoring + score - the score of the parent is used in all child documents.
ObjectscoreType(s)Sets the scoring method. Valid values are: + + none - the default, no scoring + score - the score of the parent is used in all child documents.
StringtoJSON()Retrieves the internal query object. This is typically used by + internal API functions so use with caution.
+
+ +

Method Detail

+ + + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 boost

+
+ + Object boost ( boost ) + + +
Sets the boost value for documents matching the Query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + boost + + + <Double> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 innerHits

+
+ + Object innerHits ( i ) + + +
Sets the inner hits options

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + i + + + <InnerHits> + + + + + + A valid InnerHits object +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 parentType

+
+ + Object parentType ( t ) + + +
Sets the child document type to search against

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + t + + + <String> + + + + + + A valid type name +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 query

+
+ + Object query ( q ) + + +
Sets the query

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + q + + + <Object> + + + + + + A valid Query object +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scope

+
+ + Object scope ( s ) + + +
Sets the scope of the query. A scope allows to run facets on the + same scope name that will work against the parent documents.

+ +
+
+ + + + + +
Deprecated
since elasticsearch 0.90
+ + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + s + + + <String> + + + + + + The scope name as a string. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scoreMode

+
+ + Object scoreMode ( s ) + + +
Sets the scoring method. Valid values are: + + none - the default, no scoring + score - the score of the parent is used in all child documents.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + s + + + <String> + + + + + + The score type as a string. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scoreType

+
+ + Object scoreType ( s ) + + +
Sets the scoring method. Valid values are: + + none - the default, no scoring + score - the score of the parent is used in all child documents.

+ +
+
+ + + + + +
Deprecated
since elasticsearch 0.90.1 use scoreMode
+ + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + s + + + <String> + + + + + + The score type as a string. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +
Retrieves the internal query object. This is typically used by + internal API functions so use with caution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal query property. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.Highlight.html b/dist/docs/ejs.Highlight.html new file mode 100644 index 0000000..471d19b --- /dev/null +++ b/dist/docs/ejs.Highlight.html @@ -0,0 +1,1873 @@ + + + + + elastic.js: Module: Highlight + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsHighlight
+

+ +

Allows to highlight search results on one or more fields. In order to + perform highlighting, the actual content of the field is required. If the + field in question is stored (has store set to yes in the mapping), it will + be used, otherwise, the actual _source will be loaded and the relevant + field will be extracted from it.

+ +

If no term_vector information is provided (by setting it to + with_positions_offsets in the mapping), then the plain highlighter will be + used. If it is provided, then the fast vector highlighter will be used. + When term vectors are available, highlighting will be performed faster at + the cost of bigger index size.

+ +

See http://www.elasticsearch.org/guide/reference/api/search/highlighting.html

+
+ +
+

Module

+
+
+ +

 Highlight

+
+ + Highlight ( fields ) + + +

Allows to highlight search results on one or more fields.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + fields + + + <String | String[]> + + + + + + An optional field or array of fields to highlight. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
ObjectboundaryChars(charStr,oField)Set's the boundary characters. When highlighting a field that is + mapped with term vectors, boundary_chars can be configured to + define what constitutes a boundary for highlighting. It’s a single + string with each boundary character defined in it. You can apply + the option to a specific field by passing the field name in to + the oField parameter. It defaults to ".,!? \t\n".
ObjectboundaryMaxScan(cnt,oField)Sets the max number of characters to scan while looking for the + start of a boundary character. You can apply the option to a + specific field by passing the field name in to the + oField parameter. Default: 20
Objectencoder(e)Sets highlight encoder. Valid values are: + + default - the default, no encoding + html - to encode html characters if you use html tags
Objectfields(vals)Allows you to set the fields that will be highlighted. You can + specify a single field or an array of fields. All fields are + added to the current list of fields.
Objectfragmenter(f,oField)Sets the fragmenter type. You can apply the option + to a specific field by passing the field name in to the + oField parameter. Valid values for order are: + + simple - breaks text up into same-size fragments with no concerns + over spotting sentence boundaries. + span - breaks text up into same-size fragments but does not split + up Spans.
ObjectfragmentSize(size,oField)Sets the size of each highlight fragment in characters. + You can apply the option to a specific field by passing the field + name in to the oField parameter. Default: 100
ObjecthighlightFilter(trueFalse,oField)Enables highlights in documents matched by a filter. + You can apply the option to a specific field by passing the field + name in to the oField parameter. Defaults to false.
ObjectnumberOfFragments(cnt,oField)Sets the number of highlight fragments. + You can apply the option to a specific field by passing the field + name in to the oField parameter. Default: 5
Objectoptions(opts,oField)Sets arbitrary options that can be passed to the highlighter + implementation in use.
Objectorder(o,oField)Sets the order of highlight fragments. You can apply the option + to a specific field by passing the field name in to the + oField parameter. Valid values for order are: + + score - the score calculated by Lucene's highlighting framework.
ObjectpostTags(tags,oField)Sets the post tags for highlighted fragments. You can apply the + tags to a specific field by passing the field name in to the + oField parameter.
ObjectpreTags(tags,oField)Sets the pre tags for highlighted fragments. You can apply the + tags to a specific field by passing the field name in to the + oField parameter.
ObjectrequireFieldMatch(trueFalse,oField)When enabled it will cause a field to be highlighted only if a + query matched that field. false means that terms are highlighted + on all requested fields regardless if the query matches + specifically on them. You can apply the option to a specific + field by passing the field name in to the oField + parameter. Defaults to false.
ObjecttagsSchema(s)Sets the schema to be used for the tags. Valid values are: + + styled - 10 pre tags with css class of hltN, where N is 1-10
StringtoJSON()Retrieves the internal script object. This is typically used by + internal API functions so use with caution.
Objecttype(t,oField)Sets the highligher type. You can apply the option + to a specific field by passing the field name in to the + oField parameter. Valid values for order are: + + plain - the slower Lucene standard highligher + postings - the postings highligher + fvh - the fast vector based highligher
+
+ +

Method Detail

+ + + + + + + + + + + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 boundaryChars

+
+ + Object boundaryChars ( charStr, oField ) + + +
Set's the boundary characters. When highlighting a field that is + mapped with term vectors, boundary_chars can be configured to + define what constitutes a boundary for highlighting. It’s a single + string with each boundary character defined in it. You can apply + the option to a specific field by passing the field name in to + the oField parameter. It defaults to ".,!? \t\n".

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + charStr + + + <String> + + + + + + The boundary chars in a string. +
+ + + + + oField + + + <String> + + + + + + An optional field name +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 boundaryMaxScan

+
+ + Object boundaryMaxScan ( cnt, oField ) + + +
Sets the max number of characters to scan while looking for the + start of a boundary character. You can apply the option to a + specific field by passing the field name in to the + oField parameter. Default: 20

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + cnt + + + <Integer> + + + + + + The max characters to scan. +
+ + + + + oField + + + <String> + + + + + + An optional field name +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 encoder

+
+ + Object encoder ( e ) + + +
Sets highlight encoder. Valid values are: + + default - the default, no encoding + html - to encode html characters if you use html tags

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + e + + + <String> + + + + + + The encoder. default or html +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 fields

+
+ + Object fields ( vals ) + + +
Allows you to set the fields that will be highlighted. You can + specify a single field or an array of fields. All fields are + added to the current list of fields.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + vals + + + <String | String[]> + + + + + + A field name or array of field names. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 fragmenter

+
+ + Object fragmenter ( f, oField ) + + +
Sets the fragmenter type. You can apply the option + to a specific field by passing the field name in to the + oField parameter. Valid values for order are: + + simple - breaks text up into same-size fragments with no concerns + over spotting sentence boundaries. + span - breaks text up into same-size fragments but does not split + up Spans.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + f + + + <String> + + + + + + The fragmenter. +
+ + + + + oField + + + <String> + + + + + + An optional field name +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 fragmentSize

+
+ + Object fragmentSize ( size, oField ) + + +
Sets the size of each highlight fragment in characters. + You can apply the option to a specific field by passing the field + name in to the oField parameter. Default: 100

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + size + + + <Integer> + + + + + + The fragment size in characters. +
+ + + + + oField + + + <String> + + + + + + An optional field name +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 highlightFilter

+
+ + Object highlightFilter ( trueFalse, oField ) + + +
Enables highlights in documents matched by a filter. + You can apply the option to a specific field by passing the field + name in to the oField parameter. Defaults to false.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + If filtered docs should be highlighted. +
+ + + + + oField + + + <String> + + + + + + An optional field name +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 numberOfFragments

+
+ + Object numberOfFragments ( cnt, oField ) + + +
Sets the number of highlight fragments. + You can apply the option to a specific field by passing the field + name in to the oField parameter. Default: 5

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + cnt + + + <Integer> + + + + + + The fragment size in characters. +
+ + + + + oField + + + <String> + + + + + + An optional field name +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 options

+
+ + Object options ( opts, oField ) + + +
Sets arbitrary options that can be passed to the highlighter + implementation in use.

+ +
+
+ + + +
Since
+
elasticsearch 0.90.1
+ + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + opts + + + <String> + + + + + + A map/object of option name and values. +
+ + + + + oField + + + <Object> + + + + + + An optional field name +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 order

+
+ + Object order ( o, oField ) + + +
Sets the order of highlight fragments. You can apply the option + to a specific field by passing the field name in to the + oField parameter. Valid values for order are: + + score - the score calculated by Lucene's highlighting framework.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + o + + + <String> + + + + + + The order. Currently only "score". +
+ + + + + oField + + + <String> + + + + + + An optional field name +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 postTags

+
+ + Object postTags ( tags, oField ) + + +
Sets the post tags for highlighted fragments. You can apply the + tags to a specific field by passing the field name in to the + oField parameter.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + tags + + + <String | String[]> + + + + + + A single tag or an array of tags. +
+ + + + + oField + + + <String> + + + + + + An optional field name +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 preTags

+
+ + Object preTags ( tags, oField ) + + +
Sets the pre tags for highlighted fragments. You can apply the + tags to a specific field by passing the field name in to the + oField parameter.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + tags + + + <String | String[]> + + + + + + A single tag or an array of tags. +
+ + + + + oField + + + <String> + + + + + + An optional field name +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 requireFieldMatch

+
+ + Object requireFieldMatch ( trueFalse, oField ) + + +
When enabled it will cause a field to be highlighted only if a + query matched that field. false means that terms are highlighted + on all requested fields regardless if the query matches + specifically on them. You can apply the option to a specific + field by passing the field name in to the oField + parameter. Defaults to false.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + If filtered docs should be highlighted. +
+ + + + + oField + + + <String> + + + + + + An optional field name +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 tagsSchema

+
+ + Object tagsSchema ( s ) + + +
Sets the schema to be used for the tags. Valid values are: + + styled - 10 pre tags with css class of hltN, where N is 1-10

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + s + + + <String> + + + + + + The schema. Currently only "styled". +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +
Retrieves the internal script object. This is typically used by + internal API functions so use with caution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal object representation. + + + +
+ + + +
+ +
+
+
+ +

 type

+
+ + Object type ( t, oField ) + + +
Sets the highligher type. You can apply the option + to a specific field by passing the field name in to the + oField parameter. Valid values for order are: + + plain - the slower Lucene standard highligher + postings - the postings highligher + fvh - the fast vector based highligher

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + t + + + <String> + + + + + + The highligher. +
+ + + + + oField + + + <String> + + + + + + An optional field name +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.HistogramAggregation.html b/dist/docs/ejs.HistogramAggregation.html new file mode 100644 index 0000000..5dad94e --- /dev/null +++ b/dist/docs/ejs.HistogramAggregation.html @@ -0,0 +1,1558 @@ + + + + + elastic.js: Module: HistogramAggregation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsHistogramAggregation
+

+ +

A multi-bucket values source based aggregation that can be applied on + numeric values extracted from the documents. It dynamically builds fixed + size (a.k.a. interval) buckets over the values.

+
+ +
+

Module

+
+
+ +

 HistogramAggregation

+
+ + HistogramAggregation ( name ) + + +

Aggregation that can be applied on numeric values extracted from the + documents.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + name + + + <String> + + + + + + The name which be used to refer to this aggregation. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectagg(agg)Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method.
Objectaggregation(agg)Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation.
ObjectextendedBounds(min,max)Set's the range/bounds for the histogram aggregation. Useful when you + want to include buckets that might be outside the bounds of indexed + documents.
Objectfield(field)

Sets the field to operate on.

Objectformat(f)Sets the format expression for the terms. Use for number or date + formatting
Objectinterval(i)Sets the histogram interval. Buckets are generated based on this interval + value.
Objectkeyed(trueFalse)Enable the response to be returned as a keyed object where the key is the + bucket interval.
Objectlang(language)The script language being used.
ObjectminDocCount(num)Only return terms that match more than a configured number of hits.
Objectorder(order,direction)Sets order for the aggregated values.
Objectparams(p)Sets parameters that will be applied to the script. Overwrites + any existing params.
Objectscript(scriptCode)Allows you generate or modify the terms/values using a script.
ObjectscriptFile(scriptFile)Allows you generate or modify the terms/values using a script.
ObjectscriptId(scriptId)Allows you generate or modify the terms/values using a script.
StringtoJSON()

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.

+
+ +

Method Detail

+ + + + + + + + + + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 agg

+
+ + Object agg ( agg ) + + +
Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + agg + + + <Aggregation> + + + + + + Any valid Aggregation object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 aggregation

+
+ + Object aggregation ( agg ) + + +
Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + agg + + + <Aggregation> + + + + + + Any valid Aggregation object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 extendedBounds

+
+ + Object extendedBounds ( min, max ) + + +
Set's the range/bounds for the histogram aggregation. Useful when you + want to include buckets that might be outside the bounds of indexed + documents.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + min + + + <Long> + + + + + + The start bound / minimum bound value +
+ + + + + max + + + <Long> + + + + + + The end bound / maximum bound value +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( field ) + + +

Sets the field to operate on.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + field + + + <String> + + + + + + a valid field name.. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 format

+
+ + Object format ( f ) + + +
Sets the format expression for the terms. Use for number or date + formatting

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + f + + + <String> + + + + + + the format string +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 interval

+
+ + Object interval ( i ) + + +
Sets the histogram interval. Buckets are generated based on this interval + value.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + i + + + <Integer> + + + + + + The interval +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 keyed

+
+ + Object keyed ( trueFalse ) + + +
Enable the response to be returned as a keyed object where the key is the + bucket interval.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + to enable keyed response or not +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 lang

+
+ + Object lang ( language ) + + +
The script language being used.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + language + + + <String> + + + + + + The language of the script. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 minDocCount

+
+ + Object minDocCount ( num ) + + +
Only return terms that match more than a configured number of hits.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + num + + + <Integer> + + + + + + The numer of minimum number of hits. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 order

+
+ + Object order ( order, direction ) + + +
Sets order for the aggregated values.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + order + + + <String> + + + + + + The order string. +
+ + + + + direction + + + <String> + + + + + + The sort direction, asc or desc. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 params

+
+ + Object params ( p ) + + +
Sets parameters that will be applied to the script. Overwrites + any existing params.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + p + + + <Object> + + + + + + An object where the keys are the parameter name and + values are the parameter value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 script

+
+ + Object script ( scriptCode ) + + +
Allows you generate or modify the terms/values using a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptCode + + + <String> + + + + + + A valid script string to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scriptFile

+
+ + Object scriptFile ( scriptFile ) + + +
Allows you generate or modify the terms/values using a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptFile + + + <String> + + + + + + A valid script file to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scriptId

+
+ + Object scriptId ( scriptId ) + + +
Allows you generate or modify the terms/values using a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptId + + + <String> + + + + + + A valid script id to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal object. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.HistogramFacet.html b/dist/docs/ejs.HistogramFacet.html new file mode 100644 index 0000000..a4268cb --- /dev/null +++ b/dist/docs/ejs.HistogramFacet.html @@ -0,0 +1,1889 @@ + + + + + elastic.js: Module: HistogramFacet + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsHistogramFacet
+

+ +

The histogram facet works with numeric data by building a histogram across intervals + of the field values. Each value is rounded into an interval (or placed in a + bucket), and statistics are provided per interval/bucket (count and total).

+ +

Facets are similar to SQL GROUP BY statements but perform much + better. You can also construct several "groups" at once by simply + specifying multiple facets.

+ +
+

+ Tip: + For more information on faceted navigation, see + this + Wikipedia article on Faceted Classification. +

+

+
+ +
+

Module

+
+
+ +

 HistogramFacet

+
+ + HistogramFacet ( name ) + + +

A facet which returns the N most frequent terms within a collection + or set of collections.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + name + + + <String> + + + + + + The name which be used to refer to this facet. For instance, + the facet itself might utilize a field named doc_authors. Setting + name to Authors would allow you to refer to the + facet by that name, possibly simplifying some of the display logic. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
ObjectcacheFilter(trueFalse)

Enables caching of the facetFilter

ObjectfacetFilter(oFilter)

Allows you to reduce the documents used for computing facet results.

Objectfield(fieldName)Sets the field to be used to construct the this facet.
Objectfrom(from)Sets the "from", "start", or lower bounds bucket. For example if + you have a value of 1023, an interval of 100, and a from value of + 1500, it will be placed into the 1500 bucket vs. the normal bucket + of 1000.
Objectglobal(trueFalse)

Computes values across the entire index

Objectinterval(numericInterval)Sets the bucket interval used to calculate the distribution.
ObjectkeyField(fieldName)Allows you to specify a different key field to be used to group intervals.
ObjectkeyScript(scriptCode)Allows you modify the key field using a script. The modified value + is then used to generate the interval.
Objectlang(language)The script language being used. Currently supported values are + javascript, groovy, and mvel.
Objectmode(m)

Sets the mode the facet will use.

+ +

+
collector
+
post
+
Objectnested(path)

Sets the path to the nested document if faceting against a + nested field.

Objectorder(o)Sets the type of ordering that will be performed on the date + buckets. Valid values are: + + key - the default, sort by the bucket's key value + count - sort by the number of items in the bucket + total - sort by the sum/total of the items in the bucket
Objectparams(p)Sets parameters that will be applied to the script. Overwrites + any existing params.
Objectscope(scope)

Computes values across the the specified scope

ObjecttimeInterval(timeInterval)Sets the bucket interval used to calculate the distribution based + on a time value such as "1d", "1w", etc.
Objectto(to)Sets the "to", "end", or upper bounds bucket. For example if + you have a value of 1023, an interval of 100, and a to value of + 900, it will be placed into the 900 bucket vs. the normal bucket + of 1000.
StringtoJSON()

Retrieves the internal facet object. This is typically used by + internal API functions so use with caution.

ObjectvalueField(fieldName)Allows you to specify a different value field to aggrerate over.
ObjectvalueScript(scriptCode)Allows you modify the value field using a script. The modified value + is then used to compute the statistical data.
+
+ +

Method Detail

+ + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 cacheFilter

+
+ + Object cacheFilter ( trueFalse ) + + +

Enables caching of the facetFilter


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + If the facetFilter should be cached or not +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 facetFilter

+
+ + Object facetFilter ( oFilter ) + + +

Allows you to reduce the documents used for computing facet results.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + oFilter + + + <Object> + + + + + + A valid Filter object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( fieldName ) + + +
Sets the field to be used to construct the this facet.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + fieldName + + + <String> + + + + + + The field name whose data will be used to construct the facet. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 from

+
+ + Object from ( from ) + + +
Sets the "from", "start", or lower bounds bucket. For example if + you have a value of 1023, an interval of 100, and a from value of + 1500, it will be placed into the 1500 bucket vs. the normal bucket + of 1000.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + from + + + <Number> + + + + + + the lower bounds bucket value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 global

+
+ + Object global ( trueFalse ) + + +

Computes values across the entire index


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + Calculate facet counts globally or not. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 interval

+
+ + Object interval ( numericInterval ) + + +
Sets the bucket interval used to calculate the distribution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + numericInterval + + + <Number> + + + + + + The bucket interval in which to group values. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 keyField

+
+ + Object keyField ( fieldName ) + + +
Allows you to specify a different key field to be used to group intervals.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + fieldName + + + <String> + + + + + + The name of the field to be used. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 keyScript

+
+ + Object keyScript ( scriptCode ) + + +
Allows you modify the key field using a script. The modified value + is then used to generate the interval.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptCode + + + <String> + + + + + + A valid script string to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 lang

+
+ + Object lang ( language ) + + +
The script language being used. Currently supported values are + javascript, groovy, and mvel.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + language + + + <String> + + + + + + The language of the script. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 mode

+
+ + Object mode ( m ) + + +

Sets the mode the facet will use.

+ +

+
collector
+
post
+

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + m + + + <String> + + + + + + The mode: collector or post. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 nested

+
+ + Object nested ( path ) + + +

Sets the path to the nested document if faceting against a + nested field.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + path + + + <String> + + + + + + The nested path +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 order

+
+ + Object order ( o ) + + +
Sets the type of ordering that will be performed on the date + buckets. Valid values are: + + key - the default, sort by the bucket's key value + count - sort by the number of items in the bucket + total - sort by the sum/total of the items in the bucket

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + o + + + <String> + + + + + + The ordering method: key, count, or total. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 params

+
+ + Object params ( p ) + + +
Sets parameters that will be applied to the script. Overwrites + any existing params.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + p + + + <Object> + + + + + + An object where the keys are the parameter name and + values are the parameter value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scope

+
+ + Object scope ( scope ) + + +

Computes values across the the specified scope


+ +
+
+ + + + + +
Deprecated
since elasticsearch 0.90
+ + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scope + + + <String> + + + + + + The scope name to calculate facet counts with. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 timeInterval

+
+ + Object timeInterval ( timeInterval ) + + +
Sets the bucket interval used to calculate the distribution based + on a time value such as "1d", "1w", etc.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + timeInterval + + + <Number> + + + + + + The bucket interval in which to group values. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 to

+
+ + Object to ( to ) + + +
Sets the "to", "end", or upper bounds bucket. For example if + you have a value of 1023, an interval of 100, and a to value of + 900, it will be placed into the 900 bucket vs. the normal bucket + of 1000.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + to + + + <Number> + + + + + + the upper bounds bucket value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal facet object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal facet property. + + + +
+ + + +
+ +
+
+
+ +

 valueField

+
+ + Object valueField ( fieldName ) + + +
Allows you to specify a different value field to aggrerate over.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + fieldName + + + <String> + + + + + + The name of the field to be used. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 valueScript

+
+ + Object valueScript ( scriptCode ) + + +
Allows you modify the value field using a script. The modified value + is then used to compute the statistical data.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptCode + + + <String> + + + + + + A valid script string to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.IPv4RangeAggregation.html b/dist/docs/ejs.IPv4RangeAggregation.html new file mode 100644 index 0000000..1da414d --- /dev/null +++ b/dist/docs/ejs.IPv4RangeAggregation.html @@ -0,0 +1,1230 @@ + + + + + elastic.js: Module: IPv4RangeAggregation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsIPv4RangeAggregation
+

+ +

A dedicated range aggregation for IPv4 typed fields.

+ +

Note that this aggregration includes the from value and excludes the to + value for each range.

+
+ +
+

Module

+
+
+ +

 IPv4RangeAggregation

+
+ + IPv4RangeAggregation ( name ) + + +

A dedicated range aggregation for IPv4 typed fields.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + name + + + <String> + + + + + + The name which be used to refer to this aggregation. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectagg(agg)Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method.
Objectaggregation(agg)Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation.
Objectfield(field)

Sets the field to operate on.

Objectkeyed(trueFalse)Enable the response to be returned as a keyed object where the key is the + bucket interval.
Objectlang(language)The script language being used.
Objectparams(p)Sets parameters that will be applied to the script. Overwrites + any existing params.
Objectrange(from,to,key)Adds a range to the list of exsiting range expressions.
Objectscript(scriptCode)Allows you generate or modify the terms/values using a script.
ObjectscriptFile(scriptFile)Allows you generate or modify the terms/values using a script.
ObjectscriptId(scriptId)Allows you generate or modify the terms/values using a script.
StringtoJSON()

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.

+
+ +

Method Detail

+ + + + + + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 agg

+
+ + Object agg ( agg ) + + +
Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + agg + + + <Aggregation> + + + + + + Any valid Aggregation object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 aggregation

+
+ + Object aggregation ( agg ) + + +
Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + agg + + + <Aggregation> + + + + + + Any valid Aggregation object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( field ) + + +

Sets the field to operate on.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + field + + + <String> + + + + + + a valid field name.. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 keyed

+
+ + Object keyed ( trueFalse ) + + +
Enable the response to be returned as a keyed object where the key is the + bucket interval.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + to enable keyed response or not +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 lang

+
+ + Object lang ( language ) + + +
The script language being used.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + language + + + <String> + + + + + + The language of the script. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 params

+
+ + Object params ( p ) + + +
Sets parameters that will be applied to the script. Overwrites + any existing params.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + p + + + <Object> + + + + + + An object where the keys are the parameter name and + values are the parameter value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 range

+
+ + Object range ( from, to, key ) + + +
Adds a range to the list of exsiting range expressions.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + from + + + <String> + + + + + + The start value, use null to ignore +
+ + + + + to + + + <String> + + + + + + The end value, use null to ignore. +
+ + + + + key + + + <String> + + + + + + Optional key/bucket name for keyed responses. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 script

+
+ + Object script ( scriptCode ) + + +
Allows you generate or modify the terms/values using a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptCode + + + <String> + + + + + + A valid script string to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scriptFile

+
+ + Object scriptFile ( scriptFile ) + + +
Allows you generate or modify the terms/values using a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptFile + + + <String> + + + + + + A valid script file to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scriptId

+
+ + Object scriptId ( scriptId ) + + +
Allows you generate or modify the terms/values using a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptId + + + <String> + + + + + + A valid script id to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal object. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.IdsFilter.html b/dist/docs/ejs.IdsFilter.html new file mode 100644 index 0000000..19da50e --- /dev/null +++ b/dist/docs/ejs.IdsFilter.html @@ -0,0 +1,792 @@ + + + + + elastic.js: Module: IdsFilter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsIdsFilter
+

+ +

Filters documents that only have the provided ids. Note, this filter + does not require the _id field to be indexed since it works using the + _uid field.

+
+ +
+

Module

+
+
+ +

 IdsFilter

+
+ + IdsFilter ( ids ) + + +
Matches documents with the specified id(s).

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + ids + + + <String | String[]> + + + + + + A single document id or a list of document ids. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
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.
Objectname(name)Sets the filter name.
ObjecttoJSON()Returns the filter object.
Objecttype(type)Sets the type as a single type or an array of types. If type is a + string, it is added to the list of existing types. If type is an + array, it is set as the types and overwrites an existing types. This + parameter is optional.
Objectvalues(val)Sets the values array or adds a new value. if val is a string, it + is added to the list of existing document ids. If val is an + array it is set as the document values and replaces any existing values.
+
+ +

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. + + + +
+ + + +
+ +
+
+
+ +

 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. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + Object toJSON ( ) + + +
Returns the filter object.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ filter object + + + +
+ + + +
+ +
+
+
+ +

 type

+
+ + Object type ( type ) + + +
Sets the type as a single type or an array of types. If type is a + string, it is added to the list of existing types. If type is an + array, it is set as the types and overwrites an existing types. This + parameter is optional.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + type + + + <String | String[]> + + + + + + A type or a list of types +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 values

+
+ + Object values ( val ) + + +
Sets the values array or adds a new value. if val is a string, it + is added to the list of existing document ids. If val is an + array it is set as the document values and replaces any existing values.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + val + + + <String | String[]> + + + + + + An single document id or an array of document ids. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.IdsQuery.html b/dist/docs/ejs.IdsQuery.html new file mode 100644 index 0000000..2885c30 --- /dev/null +++ b/dist/docs/ejs.IdsQuery.html @@ -0,0 +1,634 @@ + + + + + elastic.js: Module: IdsQuery + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsIdsQuery
+

+ +

Filters documents that only have the provided ids. Note, this filter + does not require the _id field to be indexed since it works using the + _uid field.

+
+ +
+

Module

+
+
+ +

 IdsQuery

+
+ + IdsQuery ( ids ) + + +
Matches documents with the specified id(s).

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + ids + + + <String | String[]> + + + + + + A single document id or a list of document ids. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectboost(boost)Sets the boost value for documents matching the Query.
StringtoJSON()Retrieves the internal query object. This is typically used by + internal API functions so use with caution.
Objecttype(type)Sets the type as a single type or an array of types. If type is a + string, it is added to the list of existing types. If type is an + array, it is set as the types and overwrites an existing types. This + parameter is optional.
Objectvalues(val)Sets the values array or adds a new value. if val is a string, it + is added to the list of existing document ids. If val is an + array it is set as the document values and replaces any existing values.
+
+ +

Method Detail

+ + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 boost

+
+ + Object boost ( boost ) + + +
Sets the boost value for documents matching the Query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + boost + + + <Double> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +
Retrieves the internal query object. This is typically used by + internal API functions so use with caution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal query property. + + + +
+ + + +
+ +
+
+
+ +

 type

+
+ + Object type ( type ) + + +
Sets the type as a single type or an array of types. If type is a + string, it is added to the list of existing types. If type is an + array, it is set as the types and overwrites an existing types. This + parameter is optional.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + type + + + <String | String[]> + + + + + + A type or a list of types +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 values

+
+ + Object values ( val ) + + +
Sets the values array or adds a new value. if val is a string, it + is added to the list of existing document ids. If val is an + array it is set as the document values and replaces any existing values.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + val + + + <String | String[]> + + + + + + An single document id or an array of document ids. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.IndexedShape.html b/dist/docs/ejs.IndexedShape.html new file mode 100644 index 0000000..0e84414 --- /dev/null +++ b/dist/docs/ejs.IndexedShape.html @@ -0,0 +1,725 @@ + + + + + elastic.js: Module: IndexedShape + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsIndexedShape
+

+ +

A shape which has already been indexed in another index and/or index + type. This is particularly useful for when you have a pre-defined list of + shapes which are useful to your application and you want to reference this + using a logical name (for example ‘New Zealand’) rather than having to + provide their coordinates each time.

+
+ +
+

Module

+
+
+ +

 IndexedShape

+
+ + IndexedShape ( type, id ) + + +

Defines a shape that already exists in an index/type.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + type + + + <String> + + + + + + The name of the type where the shape is indexed. +
+ + + + + id + + + <String> + + + + + + The document id of the shape. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectid(id)Sets the document id of the indexed shape.
Objectindex(idx)Sets the index which the shape is indexed under. + Defaults to "shapes".
ObjectshapeFieldName(field)Sets the field name containing the indexed shape. + Defaults to "shape".
StringtoJSON()Retrieves the internal script object. This is typically used by + internal API functions so use with caution.
Objecttype(t)Sets the type which the shape is indexed under.
+
+ +

Method Detail

+ + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 id

+
+ + Object id ( id ) + + +
Sets the document id of the indexed shape.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + id + + + <String> + + + + + + a valid document id. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 index

+
+ + Object index ( idx ) + + +
Sets the index which the shape is indexed under. + Defaults to "shapes".

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + idx + + + <String> + + + + + + a valid index name. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 shapeFieldName

+
+ + Object shapeFieldName ( field ) + + +
Sets the field name containing the indexed shape. + Defaults to "shape".

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + field + + + <String> + + + + + + a valid field name. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +
Retrieves the internal script object. This is typically used by + internal API functions so use with caution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal object representation. + + + +
+ + + +
+ +
+
+
+ +

 type

+
+ + Object type ( t ) + + +
Sets the type which the shape is indexed under.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + t + + + <String> + + + + + + a valid shape type. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.IndicesFilter.html b/dist/docs/ejs.IndicesFilter.html new file mode 100644 index 0000000..af845c4 --- /dev/null +++ b/dist/docs/ejs.IndicesFilter.html @@ -0,0 +1,889 @@ + + + + + elastic.js: Module: IndicesFilter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsIndicesFilter
+

+ +

The indices filter can be used when executed across multiple indices, + allowing to have a filter that executes only when executed on an index that + matches a specific list of indices, and another filter that executes when it + is executed on an index that does not match the listed indices.

+
+ +
+

Module

+
+
+ +

 IndicesFilter

+
+ + IndicesFilter ( fltr, indices ) + + +
A configurable filter that is dependent on the index name.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + fltr + + + <Object> + + + + + + A valid filter object. +
+ + + + + indices + + + <String | String[]> + + + + + + a single index name or an array of index + names. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
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.
Objectfilter(f)Sets the filter to be used when executing on one of the indicies + specified.
Objectindices(i)Sets the indicies the filter should match. When passed a string, + the index name is added to the current list of indices. When passed + an array, it overwites all current indices.
Objectname(name)Sets the filter name.
ObjectnoMatchFilter(f)Sets the filter to be used on an index that does not match an index + name in the indices list. Can also be set to "none" to not match any + documents or "all" to match all documents.
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. + + + +
+ + + +
+ +
+
+
+ +

 filter

+
+ + Object filter ( f ) + + +
Sets the filter to be used when executing on one of the indicies + specified.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + f + + + <Object> + + + + + + A valid Filter object +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 indices

+
+ + Object indices ( i ) + + +
Sets the indicies the filter should match. When passed a string, + the index name is added to the current list of indices. When passed + an array, it overwites all current indices.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + i + + + <String | String[]> + + + + + + A single index name or an array of index names. +
+ + +
+ + + + + + +
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. + + + +
+ + + +
+ +
+
+
+ +

 noMatchFilter

+
+ + Object noMatchFilter ( f ) + + +
Sets the filter to be used on an index that does not match an index + name in the indices list. Can also be set to "none" to not match any + documents or "all" to match all documents.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + f + + + <Filter | String> + + + + + + A valid Filter object or "none" or "all" +
+ + +
+ + + + + + +
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

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.IndicesQuery.html b/dist/docs/ejs.IndicesQuery.html new file mode 100644 index 0000000..8fb3668 --- /dev/null +++ b/dist/docs/ejs.IndicesQuery.html @@ -0,0 +1,729 @@ + + + + + elastic.js: Module: IndicesQuery + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsIndicesQuery
+

+ +

The indices query can be used when executed across multiple indices, + allowing to have a query that executes only when executed on an index that + matches a specific list of indices, and another query that executes when it + is executed on an index that does not match the listed indices.

+
+ +
+

Module

+
+
+ +

 IndicesQuery

+
+ + IndicesQuery ( qry, indices ) + + +
A configurable query that is dependent on the index name.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + qry + + + <Query> + + + + + + A valid query object. +
+ + + + + indices + + + <String | String[]> + + + + + + a single index name or an array of index + names. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectboost(boost)Sets the boost value for documents matching the Query.
Objectindices(i)Sets the indicies the query should match. When passed a string, + the index name is added to the current list of indices. When passed + an array, it overwites all current indices.
ObjectnoMatchQuery(q)Sets the query to be used on an index that does not match an index + name in the indices list. Can also be set to "none" to not match any + documents or "all" to match all documents.
Objectquery(q)Sets the query to be executed against the indices specified.
StringtoJSON()Retrieves the internal query object. This is typically used by + internal API functions so use with caution.
+
+ +

Method Detail

+ + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 boost

+
+ + Object boost ( boost ) + + +
Sets the boost value for documents matching the Query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + boost + + + <Double> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 indices

+
+ + Object indices ( i ) + + +
Sets the indicies the query should match. When passed a string, + the index name is added to the current list of indices. When passed + an array, it overwites all current indices.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + i + + + <String | String[]> + + + + + + A single index name or an array of index names. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 noMatchQuery

+
+ + Object noMatchQuery ( q ) + + +
Sets the query to be used on an index that does not match an index + name in the indices list. Can also be set to "none" to not match any + documents or "all" to match all documents.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + q + + + <Query | String> + + + + + + A valid Query object or "none" or "all" +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 query

+
+ + Object query ( q ) + + +
Sets the query to be executed against the indices specified.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + q + + + <Query> + + + + + + A valid Query object +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +
Retrieves the internal query object. This is typically used by + internal API functions so use with caution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal query property. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.InnerHits.html b/dist/docs/ejs.InnerHits.html new file mode 100644 index 0000000..902c58c --- /dev/null +++ b/dist/docs/ejs.InnerHits.html @@ -0,0 +1,1202 @@ + + + + + elastic.js: Module: InnerHits + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsInnerHits
+

+ +

Inner hits can be used by defining a inner_hits definition on a nested, + has_child or has_parent query and filter. This feature returns per search hit + in the search response additional nested hits that caused a search hit to + match in a different scope.

+ +

See https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-inner-hits.html

+
+ +
+

Module

+
+
+ +

 InnerHits

+
+ + InnerHits ( ) + + +

Include additional nested hits in the response.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectexplain(trueFalse)

Enable/Disable explanation of score for each hit.

ObjectfieldDataFields(Fields)

Allows to return the field data representation of a field for each hit.

Objectfrom(from)

The offset from where the first hit to fetch in the returned regular search hits.

Objecthighlight(h)

Performs highlighting based on the Highlight settings.

Objectname(name)

The name to be used for the particular inner hit definition in the response. + Useful when multiple inner hits have been defined in a single search request. + The default depends in which query the inner hit is defined. For has_child query + and filter this is the child type, has_parent query and filter this is the parent + type and the nested query and filter this is the nested path..

ObjectscriptField(oScriptField)

Computes a document property dynamically based on the supplied ScriptField.

Objectsize(size)

The maximum number of hits to return. By default the top three matching hits are returned.

Objectsort(sort)

How the inner hits should be sorted. By default the hits are sorted by the score.

Objectsource(includes,excludes)

Allows to control how the _source field is returned with every hit. + By default operations return the contents of the _source field + unless you have used the fields parameter or if the _source field + is disabled. Set the includes parameter to false to completely + disable returning the source field.

StringtoJSON()Retrieves the internal script object. This is typically used by + internal API functions so use with caution.
Objectversion(trueFalse)

Enable/Disable returning version number for each hit.

+
+ +

Method Detail

+ + + + + + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 explain

+
+ + Object explain ( trueFalse ) + + +

Enable/Disable explanation of score for each hit.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + true to enable, false to disable +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 fieldDataFields

+
+ + Object fieldDataFields ( Fields ) + + +

Allows to return the field data representation of a field for each hit.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + Fields + + + <Array> + + + + + + to return field data representation for. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 from

+
+ + Object from ( from ) + + +

The offset from where the first hit to fetch in the returned regular search hits.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + from + + + <Integer> + + + + + + The offset from the first result you want to fetch. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 highlight

+
+ + Object highlight ( h ) + + +

Performs highlighting based on the Highlight settings.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + h + + + <Highlight> + + + + + + A valid Highlight object +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 name

+
+ + Object name ( name ) + + +

The name to be used for the particular inner hit definition in the response. + Useful when multiple inner hits have been defined in a single search request. + The default depends in which query the inner hit is defined. For has_child query + and filter this is the child type, has_parent query and filter this is the parent + type and the nested query and filter this is the nested path..


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + name + + + <String> + + + + + + The name to be used for the inner hit definition. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scriptField

+
+ + Object scriptField ( oScriptField ) + + +

Computes a document property dynamically based on the supplied ScriptField.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + oScriptField + + + <ScriptField> + + + + + + A valid ScriptField. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 size

+
+ + Object size ( size ) + + +

The maximum number of hits to return. By default the top three matching hits are returned.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + size + + + <Integer> + + + + + + The numer of hits to be returned. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 sort

+
+ + Object sort ( sort ) + + +

How the inner hits should be sorted. By default the hits are sorted by the score.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + sort + + + <String> + + + + + + The field to be sorted on. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 source

+
+ + Object source ( includes, excludes ) + + +

Allows to control how the _source field is returned with every hit. + By default operations return the contents of the _source field + unless you have used the fields parameter or if the _source field + is disabled. Set the includes parameter to false to completely + disable returning the source field.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + includes + + + <String | Boolean | String[]> + + + + + + The field or list of fields to include as array. + Set to a boolean false to disable the source completely. +
+ + + + + excludes + + + <String | String[]> + + + + + + The optional field or list of fields to exclude. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +
Retrieves the internal script object. This is typically used by + internal API functions so use with caution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal object representation. + + + +
+ + + +
+ +
+
+
+ +

 version

+
+ + Object version ( trueFalse ) + + +

Enable/Disable returning version number for each hit.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + true to enable, false to disable +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.LimitFilter.html b/dist/docs/ejs.LimitFilter.html new file mode 100644 index 0000000..664bb7b --- /dev/null +++ b/dist/docs/ejs.LimitFilter.html @@ -0,0 +1,700 @@ + + + + + elastic.js: Module: LimitFilter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsLimitFilter
+

+ +

A limit filter limits the number of documents (per shard) to execute on.

+
+ +
+

Module

+
+
+ +

 LimitFilter

+
+ + LimitFilter ( limit ) + + +
Limits the number of documents to execute on.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + limit + + + <Integer> + + + + + + The number of documents to execute on. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
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.
Objectname(name)Sets the filter name.
ObjecttoJSON()Returns the filter object.
Objectvalue(val)Sets the limit value.
+
+ +

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. + + + +
+ + + +
+ +
+
+
+ +

 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. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + Object toJSON ( ) + + +
Returns the filter object.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ filter object + + + +
+ + + +
+ +
+
+
+ +

 value

+
+ + Object value ( val ) + + +
Sets the limit value.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + val + + + <Integer> + + + + + + An The number of documents to execute on. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.MatchAllFilter.html b/dist/docs/ejs.MatchAllFilter.html new file mode 100644 index 0000000..43df68c --- /dev/null +++ b/dist/docs/ejs.MatchAllFilter.html @@ -0,0 +1,604 @@ + + + + + elastic.js: Module: MatchAllFilter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsMatchAllFilter
+

+ +

This filter can be used to match on all the documents + in a given set of collections and/or types.

+
+ +
+

Module

+
+
+ +

 MatchAllFilter

+
+ + MatchAllFilter ( ) + + +

A filter that matches on all documents


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
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.
Objectname(name)Sets the filter name.
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. + + + +
+ + + +
+ +
+
+
+ +

 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. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + Object toJSON ( ) + + +
Returns the filter object.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ filter object + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.MatchAllQuery.html b/dist/docs/ejs.MatchAllQuery.html new file mode 100644 index 0000000..de896e0 --- /dev/null +++ b/dist/docs/ejs.MatchAllQuery.html @@ -0,0 +1,446 @@ + + + + + elastic.js: Module: MatchAllQuery + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsMatchAllQuery
+

+ +

This query can be used to match all the documents + in a given set of collections and/or types.

+
+ +
+

Module

+
+
+ +

 MatchAllQuery

+
+ + MatchAllQuery ( ) + + +

A query that returns all documents.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectboost(boost)Sets the boost value for documents matching the Query.
StringtoJSON()Retrieves the internal query object. This is typically used by + internal API functions so use with caution.
+
+ +

Method Detail

+ + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 boost

+
+ + Object boost ( boost ) + + +
Sets the boost value for documents matching the Query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + boost + + + <Double> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +
Retrieves the internal query object. This is typically used by + internal API functions so use with caution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal query property. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.MatchQuery.html b/dist/docs/ejs.MatchQuery.html new file mode 100644 index 0000000..2b782d8 --- /dev/null +++ b/dist/docs/ejs.MatchQuery.html @@ -0,0 +1,1872 @@ + + + + + elastic.js: Module: MatchQuery + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsMatchQuery
+

+ +

A MatchQuery is a type of Query that accepts + text/numerics/dates, analyzes it, generates a query based on the + MatchQuery type.

+
+ +
+

Module

+
+
+ +

 MatchQuery

+
+ + MatchQuery ( field, qstr ) + + +
A Query that appects text, analyzes it, generates internal query based + on the MatchQuery type.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + field + + + <String> + + + + + + the document field/field to query against +
+ + + + + qstr + + + <String> + + + + + + the query string +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectanalyzer(analyzer)Sets the analyzer name used to analyze the Query object.
Objectboost(boost)Sets the boost value for documents matching the Query.
ObjectcutoffFrequency(freq)Sets the maximum threshold/frequency to be considered a low + frequency term in a CommonTermsQuery. + Set to a value between 0 and 1.
Objectfuzziness(fuzz)Sets the fuzziness value for the Query.
ObjectfuzzyRewrite(m)Sets fuzzy rewrite method. Valid values are: + + constant_score_auto - tries to pick the best constant-score rewrite + method based on term and document counts from the query + + scoring_boolean - translates each term into boolean should and + keeps the scores as computed by the query + + constant_score_boolean - same as scoring_boolean, expect no scores + are computed. + + constant_score_filter - first creates a private Filter, by visiting + each term in sequence and marking all docs for that term + + top_terms_boost_N - first translates each term into boolean should + and scores are only computed as the boost using the top N + scoring terms. Replace N with an integer value. + + top_terms_N - first translates each term into boolean should + and keeps the scores as computed by the query. Only the top N + scoring terms are used. Replace N with an integer value. + + Default is constant_score_auto. + + This is an advanced option, use with care.
ObjectfuzzyTranspositions(trueFalse)Set to false to use classic Levenshtein edit distance in the + fuzzy query.
Objectlenient(trueFalse)Enables lenient parsing of the query string.
ObjectmaxExpansions(e)Sets the max expansions of a fuzzy MatchQuery.
ObjectminimumShouldMatch(minMatch)Sets a string value controlling how many "should" clauses in the + resulting Query should match.
ObjectminimumShouldMatch(minMatch)Sets a percent value controlling how many "should" clauses in the + resulting Query should match.
Objectoperator(op)Sets default operator of the Query. Default: or.
ObjectprefixLength(l)Sets the prefix length for a fuzzy prefix MatchQuery.
Objectquery(qstr)Sets the query string for the Query.
Objectrewrite(m)Sets rewrite method. Valid values are: + + constant_score_auto - tries to pick the best constant-score rewrite + method based on term and document counts from the query + + scoring_boolean - translates each term into boolean should and + keeps the scores as computed by the query + + constant_score_boolean - same as scoring_boolean, expect no scores + are computed. + + constant_score_filter - first creates a private Filter, by visiting + each term in sequence and marking all docs for that term + + top_terms_boost_N - first translates each term into boolean should + and scores are only computed as the boost using the top N + scoring terms. Replace N with an integer value. + + top_terms_N - first translates each term into boolean should + and keeps the scores as computed by the query. Only the top N + scoring terms are used. Replace N with an integer value. + + Default is constant_score_auto. + + This is an advanced option, use with care.
Objectslop(slop)Sets the default slop for phrases. If zero, then exact phrase matches + are required. Default: 0.
StringtoJSON()Retrieves the internal query object. This is typically used by + internal API functions so use with caution.
Objecttype(type)Sets the type of the MatchQuery. Valid values are + boolean, phrase, and phrase_prefix.
ObjectzeroTermsQuery(q)Sets what happens when no terms match. Valid values are + "all" or "none".
+
+ +

Method Detail

+ + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 analyzer

+
+ + Object analyzer ( analyzer ) + + +
Sets the analyzer name used to analyze the Query object.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + analyzer + + + <String> + + + + + + A valid analyzer name. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 boost

+
+ + Object boost ( boost ) + + +
Sets the boost value for documents matching the Query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + boost + + + <Number> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 cutoffFrequency

+
+ + Object cutoffFrequency ( freq ) + + +
Sets the maximum threshold/frequency to be considered a low + frequency term in a CommonTermsQuery. + Set to a value between 0 and 1.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + freq + + + <Number> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 fuzziness

+
+ + Object fuzziness ( fuzz ) + + +
Sets the fuzziness value for the Query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + fuzz + + + <Double> + + + + + + A double value between 0.0 and 1.0. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 fuzzyRewrite

+
+ + Object fuzzyRewrite ( m ) + + +
Sets fuzzy rewrite method. Valid values are: + + constant_score_auto - tries to pick the best constant-score rewrite + method based on term and document counts from the query + + scoring_boolean - translates each term into boolean should and + keeps the scores as computed by the query + + constant_score_boolean - same as scoring_boolean, expect no scores + are computed. + + constant_score_filter - first creates a private Filter, by visiting + each term in sequence and marking all docs for that term + + top_terms_boost_N - first translates each term into boolean should + and scores are only computed as the boost using the top N + scoring terms. Replace N with an integer value. + + top_terms_N - first translates each term into boolean should + and keeps the scores as computed by the query. Only the top N + scoring terms are used. Replace N with an integer value. + + Default is constant_score_auto. + + This is an advanced option, use with care.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + m + + + <String> + + + + + + The rewrite method as a string. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 fuzzyTranspositions

+
+ + Object fuzzyTranspositions ( trueFalse ) + + +
Set to false to use classic Levenshtein edit distance in the + fuzzy query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + A boolean value +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 lenient

+
+ + Object lenient ( trueFalse ) + + +
Enables lenient parsing of the query string.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + A boolean value +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 maxExpansions

+
+ + Object maxExpansions ( e ) + + +
Sets the max expansions of a fuzzy MatchQuery.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + e + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 minimumShouldMatch

+
+ + Object minimumShouldMatch ( minMatch ) + + +
Sets a string value controlling how many "should" clauses in the + resulting Query should match.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + minMatch + + + <String> + + + + + + A min should match parameter. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 minimumShouldMatch

+
+ + Object minimumShouldMatch ( minMatch ) + + +
Sets a percent value controlling how many "should" clauses in the + resulting Query should match.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + minMatch + + + <String> + + + + + + A min should match parameter. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 operator

+
+ + Object operator ( op ) + + +
Sets default operator of the Query. Default: or.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + op + + + <String> + + + + + + Any of "and" or "or", no quote characters. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 prefixLength

+
+ + Object prefixLength ( l ) + + +
Sets the prefix length for a fuzzy prefix MatchQuery.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + l + + + <Integer> + + + + + + A positive integer length value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 query

+
+ + Object query ( qstr ) + + +
Sets the query string for the Query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + qstr + + + <String> + + + + + + The query string to search for. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 rewrite

+
+ + Object rewrite ( m ) + + +
Sets rewrite method. Valid values are: + + constant_score_auto - tries to pick the best constant-score rewrite + method based on term and document counts from the query + + scoring_boolean - translates each term into boolean should and + keeps the scores as computed by the query + + constant_score_boolean - same as scoring_boolean, expect no scores + are computed. + + constant_score_filter - first creates a private Filter, by visiting + each term in sequence and marking all docs for that term + + top_terms_boost_N - first translates each term into boolean should + and scores are only computed as the boost using the top N + scoring terms. Replace N with an integer value. + + top_terms_N - first translates each term into boolean should + and keeps the scores as computed by the query. Only the top N + scoring terms are used. Replace N with an integer value. + + Default is constant_score_auto. + + This is an advanced option, use with care.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + m + + + <String> + + + + + + The rewrite method as a string. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 slop

+
+ + Object slop ( slop ) + + +
Sets the default slop for phrases. If zero, then exact phrase matches + are required. Default: 0.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + slop + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +
Retrieves the internal query object. This is typically used by + internal API functions so use with caution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal query property. + + + +
+ + + +
+ +
+
+
+ +

 type

+
+ + Object type ( type ) + + +
Sets the type of the MatchQuery. Valid values are + boolean, phrase, and phrase_prefix.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + type + + + <String> + + + + + + Any of boolean, phrase, phrase_prefix. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 zeroTermsQuery

+
+ + Object zeroTermsQuery ( q ) + + +
Sets what happens when no terms match. Valid values are + "all" or "none".

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + q + + + <String> + + + + + + A no match action, "all" or "none". +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.MaxAggregation.html b/dist/docs/ejs.MaxAggregation.html new file mode 100644 index 0000000..9d6ae47 --- /dev/null +++ b/dist/docs/ejs.MaxAggregation.html @@ -0,0 +1,869 @@ + + + + + elastic.js: Module: MaxAggregation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsMaxAggregation
+

+ +

A single-value metrics aggregation that keeps track and returns the + maximum value among the numeric values extracted from the aggregated + documents. These values can be extracted either from specific numeric fields + in the documents, or be generated by a provided script.

+
+ +
+

Module

+
+
+ +

 MaxAggregation

+
+ + MaxAggregation ( name ) + + +

Aggregation that keeps track and returns the maximum value among the + numeric values extracted from the aggregated documents.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + name + + + <String> + + + + + + The name which be used to refer to this aggregation. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectfield(field)

Sets the field to operate on.

Objectlang(language)The script language being used.
Objectparams(p)Sets parameters that will be applied to the script. Overwrites + any existing params.
Objectscript(scriptCode)Allows you generate or modify the terms/values using a script.
ObjectscriptFile(scriptFile)Allows you generate or modify the terms/values using a script.
ObjectscriptId(scriptId)Allows you generate or modify the terms/values using a script.
StringtoJSON()

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.

+
+ +

Method Detail

+ + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( field ) + + +

Sets the field to operate on.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + field + + + <String> + + + + + + a valid field name.. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 lang

+
+ + Object lang ( language ) + + +
The script language being used.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + language + + + <String> + + + + + + The language of the script. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 params

+
+ + Object params ( p ) + + +
Sets parameters that will be applied to the script. Overwrites + any existing params.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + p + + + <Object> + + + + + + An object where the keys are the parameter name and + values are the parameter value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 script

+
+ + Object script ( scriptCode ) + + +
Allows you generate or modify the terms/values using a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptCode + + + <String> + + + + + + A valid script string to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scriptFile

+
+ + Object scriptFile ( scriptFile ) + + +
Allows you generate or modify the terms/values using a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptFile + + + <String> + + + + + + A valid script file to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scriptId

+
+ + Object scriptId ( scriptId ) + + +
Allows you generate or modify the terms/values using a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptId + + + <String> + + + + + + A valid script id to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal object. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.MetricsAggregationMixin.html b/dist/docs/ejs.MetricsAggregationMixin.html new file mode 100644 index 0000000..8a77956 --- /dev/null +++ b/dist/docs/ejs.MetricsAggregationMixin.html @@ -0,0 +1,817 @@ + + + + + elastic.js: Mixin: MetricsAggregationMixin + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsMetricsAggregationMixin
+

+ + +
+ +
+
+
+ + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectfield(field)

Sets the field to operate on.

Objectlang(language)The script language being used.
Objectparams(p)Sets parameters that will be applied to the script. Overwrites + any existing params.
Objectscript(scriptCode)Allows you generate or modify the terms/values using a script.
ObjectscriptFile(scriptFile)Allows you generate or modify the terms/values using a script.
ObjectscriptId(scriptId)Allows you generate or modify the terms/values using a script.
StringtoJSON()

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.

+
+ +

Method Detail

+ + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( field ) + + +

Sets the field to operate on.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + field + + + <String> + + + + + + a valid field name.. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 lang

+
+ + Object lang ( language ) + + +
The script language being used.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + language + + + <String> + + + + + + The language of the script. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 params

+
+ + Object params ( p ) + + +
Sets parameters that will be applied to the script. Overwrites + any existing params.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + p + + + <Object> + + + + + + An object where the keys are the parameter name and + values are the parameter value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 script

+
+ + Object script ( scriptCode ) + + +
Allows you generate or modify the terms/values using a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptCode + + + <String> + + + + + + A valid script string to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scriptFile

+
+ + Object scriptFile ( scriptFile ) + + +
Allows you generate or modify the terms/values using a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptFile + + + <String> + + + + + + A valid script file to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scriptId

+
+ + Object scriptId ( scriptId ) + + +
Allows you generate or modify the terms/values using a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptId + + + <String> + + + + + + A valid script id to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal object. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.MinAggregation.html b/dist/docs/ejs.MinAggregation.html new file mode 100644 index 0000000..92a62bf --- /dev/null +++ b/dist/docs/ejs.MinAggregation.html @@ -0,0 +1,869 @@ + + + + + elastic.js: Module: MinAggregation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsMinAggregation
+

+ +

A single-value metrics aggregation that keeps track and returns the + minimum value among numeric values extracted from the aggregated documents. + These values can be extracted either from specific numeric fields in the + documents, or be generated by a provided script.

+
+ +
+

Module

+
+
+ +

 MinAggregation

+
+ + MinAggregation ( name ) + + +

Aggregation that keeps track and returns the minimum value among numeric + values extracted from the aggregated documents.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + name + + + <String> + + + + + + The name which be used to refer to this aggregation. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectfield(field)

Sets the field to operate on.

Objectlang(language)The script language being used.
Objectparams(p)Sets parameters that will be applied to the script. Overwrites + any existing params.
Objectscript(scriptCode)Allows you generate or modify the terms/values using a script.
ObjectscriptFile(scriptFile)Allows you generate or modify the terms/values using a script.
ObjectscriptId(scriptId)Allows you generate or modify the terms/values using a script.
StringtoJSON()

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.

+
+ +

Method Detail

+ + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( field ) + + +

Sets the field to operate on.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + field + + + <String> + + + + + + a valid field name.. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 lang

+
+ + Object lang ( language ) + + +
The script language being used.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + language + + + <String> + + + + + + The language of the script. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 params

+
+ + Object params ( p ) + + +
Sets parameters that will be applied to the script. Overwrites + any existing params.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + p + + + <Object> + + + + + + An object where the keys are the parameter name and + values are the parameter value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 script

+
+ + Object script ( scriptCode ) + + +
Allows you generate or modify the terms/values using a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptCode + + + <String> + + + + + + A valid script string to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scriptFile

+
+ + Object scriptFile ( scriptFile ) + + +
Allows you generate or modify the terms/values using a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptFile + + + <String> + + + + + + A valid script file to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scriptId

+
+ + Object scriptId ( scriptId ) + + +
Allows you generate or modify the terms/values using a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptId + + + <String> + + + + + + A valid script id to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal object. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.MissingAggregation.html b/dist/docs/ejs.MissingAggregation.html new file mode 100644 index 0000000..a068f19 --- /dev/null +++ b/dist/docs/ejs.MissingAggregation.html @@ -0,0 +1,634 @@ + + + + + elastic.js: Module: MissingAggregation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsMissingAggregation
+

+ +

A field data based single bucket aggregation, that creates a bucket of all + documents in the current document set context that are missing a field value + (effectively, missing a field or having the configured NULL value set).

+
+ +
+

Module

+
+
+ +

 MissingAggregation

+
+ + MissingAggregation ( name ) + + +

Defines a bucket of all documents that are missing a field value.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + name + + + <String> + + + + + + The name which be used to refer to this aggregation. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectagg(agg)Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method.
Objectaggregation(agg)Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation.
Objectfield(field)

Sets the field to gather missing terms from.

StringtoJSON()

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.

+
+ +

Method Detail

+ + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 agg

+
+ + Object agg ( agg ) + + +
Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + agg + + + <Aggregation> + + + + + + Any valid Aggregation object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 aggregation

+
+ + Object aggregation ( agg ) + + +
Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + agg + + + <Aggregation> + + + + + + Any valid Aggregation object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( field ) + + +

Sets the field to gather missing terms from.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + field + + + <String> + + + + + + a valid field name.. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal object. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.MissingFilter.html b/dist/docs/ejs.MissingFilter.html new file mode 100644 index 0000000..eae467c --- /dev/null +++ b/dist/docs/ejs.MissingFilter.html @@ -0,0 +1,860 @@ + + + + + elastic.js: Module: MissingFilter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsMissingFilter
+

+ +

An missingFilter matches documents where the specified field contains no legitimate value.

+
+ +
+

Module

+
+
+ +

 MissingFilter

+
+ + MissingFilter ( fieldName ) + + +
Filters documents where a specific field has no value present.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + fieldName + + + <String> + + + + + + the field name to check for missing values. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
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.
Objectexistence(trueFalse)Checks if the field doesn't exist.
Objectfield(name)Sets the field to check for missing values.
Objectname(name)Sets the filter name.
ObjectnullValue(trueFalse)Checks if the field has null values.
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. + + + +
+ + + +
+ +
+
+
+ +

 existence

+
+ + Object existence ( trueFalse ) + + +
Checks if the field doesn't exist.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + True to check if the field doesn't exist. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( name ) + + +
Sets the field to check for missing values.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + name + + + <String> + + + + + + A name of the field. +
+ + +
+ + + + + + +
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. + + + +
+ + + +
+ +
+
+
+ +

 nullValue

+
+ + Object nullValue ( trueFalse ) + + +
Checks if the field has null values.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + True to check if the field has nulls. +
+ + +
+ + + + + + +
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

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.MoreLikeThisFieldQuery.html b/dist/docs/ejs.MoreLikeThisFieldQuery.html new file mode 100644 index 0000000..afdb7da --- /dev/null +++ b/dist/docs/ejs.MoreLikeThisFieldQuery.html @@ -0,0 +1,1548 @@ + + + + + elastic.js: Module: MoreLikeThisFieldQuery + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsMoreLikeThisFieldQuery
+

+ +

The more_like_this_field query is the same as the more_like_this query, + except it runs against a single field.

+
+ +
+

Module

+
+
+ +

 MoreLikeThisFieldQuery

+
+ + MoreLikeThisFieldQuery ( field, likeText ) + + +

Constructs a query where each documents returned are “like†provided text


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + field + + + <String> + + + + + + The field to run the query against. +
+ + + + + likeText + + + <String> + + + + + + The text to find documents like it. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectanalyzer(analyzerName)The analyzer that will be used to analyze the text. Defaults to the + analyzer associated with the field.
Objectboost(boost)Sets the boost value of the Query.
ObjectboostTerms(boost)Sets the boost factor to use when boosting terms. + Defaults to 1.
ObjectfailOnUnsupportedField(trueFalse)Should the Query fail when an unsupported field + is specified. Defaults to true.
Objectfield(f)The field to run the query against.
ObjectlikeText(s)The text to find documents like
ObjectmaxDocFreq(max)The maximum frequency in which words may still appear. Words that + appear in more than this many docs will be ignored. + Defaults to unbounded.
ObjectmaxQueryTerms(max)The maximum number of query terms that will be included in any + generated query. Defaults to 25.
ObjectmaxWordLen(len)The maximum word length above which words will be ignored. + Defaults to unbounded (0).
ObjectminDocFreq(min)The frequency at which words will be ignored which do not occur in + at least this many docs. Defaults to 5.
ObjectminTermFreq(freq)The frequency below which terms will be ignored in the source doc. + The default frequency is 2.
ObjectminWordLen(len)The minimum word length below which words will be ignored. + Defaults to 0.
ObjectpercentTermsToMatch(percent)The percentage of terms to match on (float value). + Defaults to 0.3 (30 percent).
ObjectstopWords(stopWords)An array of stop words. Any word in this set is considered + “uninteresting†and ignored. Even if your Analyzer allows stopwords, + you might want to tell the MoreLikeThis code to ignore them, as for + the purposes of document similarity it seems reasonable to assume + that “a stop word is never interestingâ€.
StringtoJSON()Retrieves the internal query object. This is typically used by + internal API functions so use with caution.
+
+ +

Method Detail

+ + + + + + + + + + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 analyzer

+
+ + Object analyzer ( analyzerName ) + + +
The analyzer that will be used to analyze the text. Defaults to the + analyzer associated with the field.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + analyzerName + + + <String> + + + + + + The name of the analyzer. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 boost

+
+ + Object boost ( boost ) + + +
Sets the boost value of the Query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + boost + + + <Double> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 boostTerms

+
+ + Object boostTerms ( boost ) + + +
Sets the boost factor to use when boosting terms. + Defaults to 1.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + boost + + + <Double> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 failOnUnsupportedField

+
+ + Object failOnUnsupportedField ( trueFalse ) + + +
Should the Query fail when an unsupported field + is specified. Defaults to true.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + A boolean value +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( f ) + + +
The field to run the query against.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + f + + + <String> + + + + + + A single field name. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 likeText

+
+ + Object likeText ( s ) + + +
The text to find documents like

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + s + + + <String> + + + + + + A text string. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 maxDocFreq

+
+ + Object maxDocFreq ( max ) + + +
The maximum frequency in which words may still appear. Words that + appear in more than this many docs will be ignored. + Defaults to unbounded.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + max + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 maxQueryTerms

+
+ + Object maxQueryTerms ( max ) + + +
The maximum number of query terms that will be included in any + generated query. Defaults to 25.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + max + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 maxWordLen

+
+ + Object maxWordLen ( len ) + + +
The maximum word length above which words will be ignored. + Defaults to unbounded (0).

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + len + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 minDocFreq

+
+ + Object minDocFreq ( min ) + + +
The frequency at which words will be ignored which do not occur in + at least this many docs. Defaults to 5.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + min + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 minTermFreq

+
+ + Object minTermFreq ( freq ) + + +
The frequency below which terms will be ignored in the source doc. + The default frequency is 2.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + freq + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 minWordLen

+
+ + Object minWordLen ( len ) + + +
The minimum word length below which words will be ignored. + Defaults to 0.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + len + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 percentTermsToMatch

+
+ + Object percentTermsToMatch ( percent ) + + +
The percentage of terms to match on (float value). + Defaults to 0.3 (30 percent).

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + percent + + + <Double> + + + + + + A double value between 0 and 1. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 stopWords

+
+ + Object stopWords ( stopWords ) + + +
An array of stop words. Any word in this set is considered + “uninteresting†and ignored. Even if your Analyzer allows stopwords, + you might want to tell the MoreLikeThis code to ignore them, as for + the purposes of document similarity it seems reasonable to assume + that “a stop word is never interestingâ€.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + stopWords + + + <Array> + + + + + + An array of string stopwords +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +
Retrieves the internal query object. This is typically used by + internal API functions so use with caution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal query property. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.MoreLikeThisQuery.html b/dist/docs/ejs.MoreLikeThisQuery.html new file mode 100644 index 0000000..3641f06 --- /dev/null +++ b/dist/docs/ejs.MoreLikeThisQuery.html @@ -0,0 +1,1552 @@ + + + + + elastic.js: Module: MoreLikeThisQuery + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsMoreLikeThisQuery
+

+ +

More like this query find documents that are “like†provided text by + running it against one or more fields.

+
+ +
+

Module

+
+
+ +

 MoreLikeThisQuery

+
+ + MoreLikeThisQuery ( fields, likeText ) + + +

Constructs a query where each documents returned are “like†provided text


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + fields + + + <String | String[]> + + + + + + A single field or array of fields to run against. +
+ + + + + likeText + + + <String> + + + + + + The text to find documents like it. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectanalyzer(analyzerName)The analyzer that will be used to analyze the text. Defaults to the + analyzer associated with the field.
Objectboost(boost)Sets the boost value for documents matching the Query.
ObjectboostTerms(boost)Sets the boost factor to use when boosting terms. + Defaults to 1.
ObjectfailOnUnsupportedField(trueFalse)Should the Query fail when an unsupported field + is specified. Defaults to true.
Objectfields(f)The fields to run the query against. If you call with a single field, + it is added to the existing list of fields. If called with an array + of field names, it replaces any existing values with the new array.
ObjectlikeText(s)The text to find documents like
ObjectmaxDocFreq(max)The maximum frequency in which words may still appear. Words that + appear in more than this many docs will be ignored. + Defaults to unbounded.
ObjectmaxQueryTerms(max)The maximum number of query terms that will be included in any + generated query. Defaults to 25.
ObjectmaxWordLen(len)The maximum word length above which words will be ignored. + Defaults to unbounded (0).
ObjectminDocFreq(min)The frequency at which words will be ignored which do not occur in + at least this many docs. Defaults to 5.
ObjectminTermFreq(freq)The frequency below which terms will be ignored in the source doc. + The default frequency is 2.
ObjectminWordLen(len)The minimum word length below which words will be ignored. + Defaults to 0.
ObjectpercentTermsToMatch(percent)The percentage of terms to match on (float value). + Defaults to 0.3 (30 percent).
ObjectstopWords(stopWords)An array of stop words. Any word in this set is considered + “uninteresting†and ignored. Even if your Analyzer allows stopwords, + you might want to tell the MoreLikeThis code to ignore them, as for + the purposes of document similarity it seems reasonable to assume + that “a stop word is never interestingâ€.
StringtoJSON()Retrieves the internal query object. This is typically used by + internal API functions so use with caution.
+
+ +

Method Detail

+ + + + + + + + + + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 analyzer

+
+ + Object analyzer ( analyzerName ) + + +
The analyzer that will be used to analyze the text. Defaults to the + analyzer associated with the field.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + analyzerName + + + <String> + + + + + + The name of the analyzer. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 boost

+
+ + Object boost ( boost ) + + +
Sets the boost value for documents matching the Query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + boost + + + <Double> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 boostTerms

+
+ + Object boostTerms ( boost ) + + +
Sets the boost factor to use when boosting terms. + Defaults to 1.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + boost + + + <Double> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 failOnUnsupportedField

+
+ + Object failOnUnsupportedField ( trueFalse ) + + +
Should the Query fail when an unsupported field + is specified. Defaults to true.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + A boolean value +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 fields

+
+ + Object fields ( f ) + + +
The fields to run the query against. If you call with a single field, + it is added to the existing list of fields. If called with an array + of field names, it replaces any existing values with the new array.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + f + + + <String | String[]> + + + + + + A single field name or a list of field names. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 likeText

+
+ + Object likeText ( s ) + + +
The text to find documents like

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + s + + + <String> + + + + + + A text string. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 maxDocFreq

+
+ + Object maxDocFreq ( max ) + + +
The maximum frequency in which words may still appear. Words that + appear in more than this many docs will be ignored. + Defaults to unbounded.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + max + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 maxQueryTerms

+
+ + Object maxQueryTerms ( max ) + + +
The maximum number of query terms that will be included in any + generated query. Defaults to 25.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + max + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 maxWordLen

+
+ + Object maxWordLen ( len ) + + +
The maximum word length above which words will be ignored. + Defaults to unbounded (0).

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + len + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 minDocFreq

+
+ + Object minDocFreq ( min ) + + +
The frequency at which words will be ignored which do not occur in + at least this many docs. Defaults to 5.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + min + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 minTermFreq

+
+ + Object minTermFreq ( freq ) + + +
The frequency below which terms will be ignored in the source doc. + The default frequency is 2.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + freq + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 minWordLen

+
+ + Object minWordLen ( len ) + + +
The minimum word length below which words will be ignored. + Defaults to 0.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + len + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 percentTermsToMatch

+
+ + Object percentTermsToMatch ( percent ) + + +
The percentage of terms to match on (float value). + Defaults to 0.3 (30 percent).

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + percent + + + <Double> + + + + + + A double value between 0 and 1. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 stopWords

+
+ + Object stopWords ( stopWords ) + + +
An array of stop words. Any word in this set is considered + “uninteresting†and ignored. Even if your Analyzer allows stopwords, + you might want to tell the MoreLikeThis code to ignore them, as for + the purposes of document similarity it seems reasonable to assume + that “a stop word is never interestingâ€.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + stopWords + + + <Array> + + + + + + An array of string stopwords +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +
Retrieves the internal query object. This is typically used by + internal API functions so use with caution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal query property. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.MultiMatchQuery.html b/dist/docs/ejs.MultiMatchQuery.html new file mode 100644 index 0000000..6dca4be --- /dev/null +++ b/dist/docs/ejs.MultiMatchQuery.html @@ -0,0 +1,1968 @@ + + + + + elastic.js: Module: MultiMatchQuery + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsMultiMatchQuery
+

+ +

A MultiMatchQuery query builds further on top of the + MatchQuery by allowing multiple fields to be specified. + The idea here is to allow to more easily build a concise match type query + over multiple fields instead of using a relatively more expressive query + by using multiple match queries within a bool query.

+
+ +
+

Module

+
+
+ +

 MultiMatchQuery

+
+ + MultiMatchQuery ( fields, qstr ) + + +
A Query that allow to more easily build a MatchQuery + over multiple fields

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + fields + + + <String | String[]> + + + + + + the single field or array of fields to search across +
+ + + + + qstr + + + <String> + + + + + + the query string +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectanalyzer(analyzer)Sets the analyzer name used to analyze the Query object.
Objectboost(boost)Sets the boost value for documents matching the Query.
ObjectcutoffFrequency(freq)Sets the maximum threshold/frequency to be considered a low + frequency term in a CommonTermsQuery. + Set to a value between 0 and 1.
Objectfields(f)Sets the fields to search across. If passed a single value it is + added to the existing list of fields. If passed an array of + values, they overwite all existing values.
Objectfuzziness(fuzz)Sets the fuzziness value for the Query.
ObjectfuzzyRewrite(m)Sets fuzzy rewrite method. Valid values are: + + constant_score_auto - tries to pick the best constant-score rewrite + method based on term and document counts from the query + + scoring_boolean - translates each term into boolean should and + keeps the scores as computed by the query + + constant_score_boolean - same as scoring_boolean, expect no scores + are computed. + + constant_score_filter - first creates a private Filter, by visiting + each term in sequence and marking all docs for that term + + top_terms_boost_N - first translates each term into boolean should + and scores are only computed as the boost using the top N + scoring terms. Replace N with an integer value. + + top_terms_N - first translates each term into boolean should + and keeps the scores as computed by the query. Only the top N + scoring terms are used. Replace N with an integer value. + + Default is constant_score_auto. + + This is an advanced option, use with care.
Objectlenient(trueFalse)Enables lenient parsing of the query string.
ObjectmaxExpansions(e)Sets the max expansions of a fuzzy Query.
ObjectminimumShouldMatch(minMatch)Sets a percent value controlling how many "should" clauses in the + resulting Query should match.
Objectoperator(op)Sets default operator of the Query. Default: or.
ObjectprefixLength(l)Sets the prefix length for a fuzzy prefix Query.
Objectquery(qstr)Sets the query string for the Query.
Objectrewrite(m)Sets rewrite method. Valid values are: + + constant_score_auto - tries to pick the best constant-score rewrite + method based on term and document counts from the query + + scoring_boolean - translates each term into boolean should and + keeps the scores as computed by the query + + constant_score_boolean - same as scoring_boolean, expect no scores + are computed. + + constant_score_filter - first creates a private Filter, by visiting + each term in sequence and marking all docs for that term + + top_terms_boost_N - first translates each term into boolean should + and scores are only computed as the boost using the top N + scoring terms. Replace N with an integer value. + + top_terms_N - first translates each term into boolean should + and keeps the scores as computed by the query. Only the top N + scoring terms are used. Replace N with an integer value. + + Default is constant_score_auto. + + This is an advanced option, use with care.
Objectslop(slop)Sets the default slop for phrases. If zero, then exact phrase matches + are required. Default: 0.
ObjecttieBreaker(tieBreaker)The tie breaker value. The tie breaker capability allows results + that include the same term in multiple fields to be judged better than + results that include this term in only the best of those multiple + fields, without confusing this with the better case of two different + terms in the multiple fields. Default: 0.0.
StringtoJSON()Retrieves the internal query object. This is typically used by + internal API functions so use with caution.
Objecttype(type)Sets the type of the MultiMatchQuery. Valid values are + boolean, phrase, and phrase_prefix or phrasePrefix.
ObjectuseDisMax(trueFalse)Sets whether or not queries against multiple fields should be combined using Lucene's + + DisjunctionMaxQuery
ObjectzeroTermsQuery(q)Sets what happens when no terms match. Valid values are + "all" or "none".
+
+ +

Method Detail

+ + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 analyzer

+
+ + Object analyzer ( analyzer ) + + +
Sets the analyzer name used to analyze the Query object.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + analyzer + + + <String> + + + + + + A valid analyzer name. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 boost

+
+ + Object boost ( boost ) + + +
Sets the boost value for documents matching the Query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + boost + + + <Double> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 cutoffFrequency

+
+ + Object cutoffFrequency ( freq ) + + +
Sets the maximum threshold/frequency to be considered a low + frequency term in a CommonTermsQuery. + Set to a value between 0 and 1.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + freq + + + <Number> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 fields

+
+ + Object fields ( f ) + + +
Sets the fields to search across. If passed a single value it is + added to the existing list of fields. If passed an array of + values, they overwite all existing values.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + f + + + <String | String[]> + + + + + + A single field or list of fields names to + search across. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be + chained. Returns {Array} current value if `f` not specified. + + + +
+ + + +
+ +
+
+
+ +

 fuzziness

+
+ + Object fuzziness ( fuzz ) + + +
Sets the fuzziness value for the Query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + fuzz + + + <Double> + + + + + + A double value between 0.0 and 1.0. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 fuzzyRewrite

+
+ + Object fuzzyRewrite ( m ) + + +
Sets fuzzy rewrite method. Valid values are: + + constant_score_auto - tries to pick the best constant-score rewrite + method based on term and document counts from the query + + scoring_boolean - translates each term into boolean should and + keeps the scores as computed by the query + + constant_score_boolean - same as scoring_boolean, expect no scores + are computed. + + constant_score_filter - first creates a private Filter, by visiting + each term in sequence and marking all docs for that term + + top_terms_boost_N - first translates each term into boolean should + and scores are only computed as the boost using the top N + scoring terms. Replace N with an integer value. + + top_terms_N - first translates each term into boolean should + and keeps the scores as computed by the query. Only the top N + scoring terms are used. Replace N with an integer value. + + Default is constant_score_auto. + + This is an advanced option, use with care.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + m + + + <String> + + + + + + The rewrite method as a string. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 lenient

+
+ + Object lenient ( trueFalse ) + + +
Enables lenient parsing of the query string.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + A boolean value +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 maxExpansions

+
+ + Object maxExpansions ( e ) + + +
Sets the max expansions of a fuzzy Query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + e + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 minimumShouldMatch

+
+ + Object minimumShouldMatch ( minMatch ) + + +
Sets a percent value controlling how many "should" clauses in the + resulting Query should match.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + minMatch + + + <String> + + + + + + A min should match parameter. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 operator

+
+ + Object operator ( op ) + + +
Sets default operator of the Query. Default: or.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + op + + + <String> + + + + + + Any of "and" or "or", no quote characters. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 prefixLength

+
+ + Object prefixLength ( l ) + + +
Sets the prefix length for a fuzzy prefix Query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + l + + + <Integer> + + + + + + A positive integer length value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 query

+
+ + Object query ( qstr ) + + +
Sets the query string for the Query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + qstr + + + <String> + + + + + + The query string to search for. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 rewrite

+
+ + Object rewrite ( m ) + + +
Sets rewrite method. Valid values are: + + constant_score_auto - tries to pick the best constant-score rewrite + method based on term and document counts from the query + + scoring_boolean - translates each term into boolean should and + keeps the scores as computed by the query + + constant_score_boolean - same as scoring_boolean, expect no scores + are computed. + + constant_score_filter - first creates a private Filter, by visiting + each term in sequence and marking all docs for that term + + top_terms_boost_N - first translates each term into boolean should + and scores are only computed as the boost using the top N + scoring terms. Replace N with an integer value. + + top_terms_N - first translates each term into boolean should + and keeps the scores as computed by the query. Only the top N + scoring terms are used. Replace N with an integer value. + + Default is constant_score_auto. + + This is an advanced option, use with care.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + m + + + <String> + + + + + + The rewrite method as a string. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 slop

+
+ + Object slop ( slop ) + + +
Sets the default slop for phrases. If zero, then exact phrase matches + are required. Default: 0.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + slop + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 tieBreaker

+
+ + Object tieBreaker ( tieBreaker ) + + +
The tie breaker value. The tie breaker capability allows results + that include the same term in multiple fields to be judged better than + results that include this term in only the best of those multiple + fields, without confusing this with the better case of two different + terms in the multiple fields. Default: 0.0.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + tieBreaker + + + <Double> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +
Retrieves the internal query object. This is typically used by + internal API functions so use with caution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal query property. + + + +
+ + + +
+ +
+
+
+ +

 type

+
+ + Object type ( type ) + + +
Sets the type of the MultiMatchQuery. Valid values are + boolean, phrase, and phrase_prefix or phrasePrefix.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + type + + + <String> + + + + + + Any of boolean, phrase, phrase_prefix or phrasePrefix. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 useDisMax

+
+ + Object useDisMax ( trueFalse ) + + +
Sets whether or not queries against multiple fields should be combined using Lucene's + + DisjunctionMaxQuery

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <String> + + + + + + A true/false value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 zeroTermsQuery

+
+ + Object zeroTermsQuery ( q ) + + +
Sets what happens when no terms match. Valid values are + "all" or "none".

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + q + + + <String> + + + + + + A no match action, "all" or "none". +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.NestedAggregation.html b/dist/docs/ejs.NestedAggregation.html new file mode 100644 index 0000000..7a8b062 --- /dev/null +++ b/dist/docs/ejs.NestedAggregation.html @@ -0,0 +1,634 @@ + + + + + elastic.js: Module: NestedAggregation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsNestedAggregation
+

+ +

A special single bucket aggregation that enables aggregating nested + documents.

+
+ +
+

Module

+
+
+ +

 NestedAggregation

+
+ + NestedAggregation ( name ) + + +

A special single bucket aggregation that enables aggregating nested + documents.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + name + + + <String> + + + + + + The name which be used to refer to this aggregation. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectagg(agg)Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method.
Objectaggregation(agg)Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation.
Objectpath(path)

Sets the nested path.

StringtoJSON()

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.

+
+ +

Method Detail

+ + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 agg

+
+ + Object agg ( agg ) + + +
Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + agg + + + <Aggregation> + + + + + + Any valid Aggregation object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 aggregation

+
+ + Object aggregation ( agg ) + + +
Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + agg + + + <Aggregation> + + + + + + Any valid Aggregation object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 path

+
+ + Object path ( path ) + + +

Sets the nested path.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + path + + + <String> + + + + + + The nested path value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal object. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.NestedFilter.html b/dist/docs/ejs.NestedFilter.html new file mode 100644 index 0000000..83cc54b --- /dev/null +++ b/dist/docs/ejs.NestedFilter.html @@ -0,0 +1,1275 @@ + + + + + elastic.js: Module: NestedFilter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsNestedFilter
+

+ +

Nested filters allow you to search against content within objects that are + embedded inside of other objects. It is similar to XPath + expressions in XML both conceptually and syntactically.

+ +

+ The filter is executed against the nested objects / docs as if they were + indexed as separate docs and resulting in the root + parent doc (or parent nested mapping).

+
+ +
+

Module

+
+
+ +

 NestedFilter

+
+ + NestedFilter ( path ) + + +

Constructs a filter that is capable of executing a filter against objects + nested within a document.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + path + + + <String> + + + + + + The nested object path. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectboost(boost)Sets the boost value of the nested Query.
Objectcache(trueFalse)Enable or disable caching of the filter
ObjectcacheKey(key)Sets the cache key.
Objectfilter(oFilter)Sets the nested filter to be executed.
ObjectinnerHits(i)Sets the inner hits options
ObjectinnerHits(i)Sets the inner hits options
Objectjoin(trueFalse)If the nested query should be "joined" with the parent document. + Defaults to false.
Objectname(name)Sets the filter name.
Objectpath(p)Sets the root context for the nested filter.
Objectquery(oQuery)Sets the nested query to be executed.
Objectscope(s)Sets the scope of the filter. A scope allows to run facets on the + same scope name that will work against the nested documents.
ObjecttoJSON()Returns the filter object.
+
+ +

Method Detail

+ + + + + + + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 boost

+
+ + Object boost ( boost ) + + +
Sets the boost value of the nested Query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + boost + + + <Double> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 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. + + + +
+ + + +
+ +
+
+
+ +

 filter

+
+ + Object filter ( oFilter ) + + +
Sets the nested filter to be executed.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + oFilter + + + <Object> + + + + + + A valid Filter object +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 innerHits

+
+ + Object innerHits ( i ) + + +
Sets the inner hits options

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + i + + + <InnerHits> + + + + + + A valid InnerHits object +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 innerHits

+
+ + Object innerHits ( i ) + + +
Sets the inner hits options

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + i + + + <InnerHits> + + + + + + A valid InnerHits object +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 join

+
+ + Object join ( trueFalse ) + + +
If the nested query should be "joined" with the parent document. + Defaults to false.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + If the query should be joined or not. +
+ + +
+ + + + + + +
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. + + + +
+ + + +
+ +
+
+
+ +

 path

+
+ + Object path ( p ) + + +
Sets the root context for the nested filter.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + p + + + <String> + + + + + + The path defining the root for the nested filter. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 query

+
+ + Object query ( oQuery ) + + +
Sets the nested query to be executed.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + oQuery + + + <Query> + + + + + + A valid Query object +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scope

+
+ + Object scope ( s ) + + +
Sets the scope of the filter. A scope allows to run facets on the + same scope name that will work against the nested documents.

+ +
+
+ + + + + +
Deprecated
since elasticsearch 0.90
+ + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + s + + + <String> + + + + + + The scope name as a string. +
+ + +
+ + + + + + +
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

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.NestedQuery.html b/dist/docs/ejs.NestedQuery.html new file mode 100644 index 0000000..7ac44d8 --- /dev/null +++ b/dist/docs/ejs.NestedQuery.html @@ -0,0 +1,875 @@ + + + + + elastic.js: Module: NestedQuery + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsNestedQuery
+

+ +

Nested queries allow you to search against content within objects that are + embedded inside of other objects. It is similar to XPath expressions + in XML both conceptually and syntactically.

+ +

The query is executed against the nested objects / docs as if they were + indexed as separate docs and resulting in the rootparent doc (or parent + nested mapping).

+
+ +
+

Module

+
+
+ +

 NestedQuery

+
+ + NestedQuery ( path ) + + +

Constructs a query that is capable of executing a search against objects + nested within a document.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + path + + + <String> + + + + + + The nested object path. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectboost(boost)Sets the boost value for documents matching the Query.
Objectfilter(oFilter)Sets the nested filter to be executed.
Objectpath(path)Sets the root context for the nested query.
Objectquery(oQuery)Sets the nested query to be executed.
Objectscope(s)Sets the scope of the query. A scope allows to run facets on the + same scope name that will work against the nested documents.
ObjectscoreMode(mode)Sets how the inner (nested) matches affect scoring on the parent document.
StringtoJSON()Retrieves the internal query object. This is typically used by + internal API functions so use with caution.
+
+ +

Method Detail

+ + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 boost

+
+ + Object boost ( boost ) + + +
Sets the boost value for documents matching the Query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + boost + + + <Double> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 filter

+
+ + Object filter ( oFilter ) + + +
Sets the nested filter to be executed.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + oFilter + + + <Object> + + + + + + A valid Filter object +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 path

+
+ + Object path ( path ) + + +
Sets the root context for the nested query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + path + + + <String> + + + + + + The path defining the root context for the nested query. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 query

+
+ + Object query ( oQuery ) + + +
Sets the nested query to be executed.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + oQuery + + + <Object> + + + + + + A valid Query object +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scope

+
+ + Object scope ( s ) + + +
Sets the scope of the query. A scope allows to run facets on the + same scope name that will work against the nested documents.

+ +
+
+ + + + + +
Deprecated
since elasticsearch 0.90
+ + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + s + + + <String> + + + + + + The scope name as a string. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scoreMode

+
+ + Object scoreMode ( mode ) + + +
Sets how the inner (nested) matches affect scoring on the parent document.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + mode + + + <String> + + + + + + The mode of scoring to be used for nested matches. + Options are avg, total, max, none - defaults to avg +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +
Retrieves the internal query object. This is typically used by + internal API functions so use with caution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal query property. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.NotFilter.html b/dist/docs/ejs.NotFilter.html new file mode 100644 index 0000000..c8cd6eb --- /dev/null +++ b/dist/docs/ejs.NotFilter.html @@ -0,0 +1,701 @@ + + + + + elastic.js: Module: NotFilter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsNotFilter
+

+ +

A container Filter that excludes the documents matched by the + contained filter.

+
+ +
+

Module

+
+
+ +

 NotFilter

+
+ + NotFilter ( oFilter ) + + +
Container filter that excludes the matched documents of the contained filter.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + oFilter + + + <Object> + + + + + + a valid Filter object such as a termFilter, etc. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
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.
Objectfilter(fltr)Sets the filter
Objectname(name)Sets the filter name.
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. + + + +
+ + + +
+ +
+
+
+ +

 filter

+
+ + Object filter ( fltr ) + + +
Sets the filter

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + fltr + + + <Object> + + + + + + A valid filter object such as a termFilter, etc. +
+ + +
+ + + + + + +
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. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + Object toJSON ( ) + + +
Returns the filter object.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ filter object + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.NumericRangeFilter.html b/dist/docs/ejs.NumericRangeFilter.html new file mode 100644 index 0000000..c063bf4 --- /dev/null +++ b/dist/docs/ejs.NumericRangeFilter.html @@ -0,0 +1,1362 @@ + + + + + elastic.js: Module: NumericRangeFilter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
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

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
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

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.OrFilter.html b/dist/docs/ejs.OrFilter.html new file mode 100644 index 0000000..92dd18b --- /dev/null +++ b/dist/docs/ejs.OrFilter.html @@ -0,0 +1,704 @@ + + + + + elastic.js: Module: OrFilter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsOrFilter
+

+ +

A container filter that allows Boolean OR composition of filters.

+
+ +
+

Module

+
+
+ +

 OrFilter

+
+ + OrFilter ( filters ) + + +
A container Filter that allows Boolean OR composition of filters.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + filters + + + <Filter | Filter[]> + + + + + + A valid Filter or array of Filters. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
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.
Objectfilters(fltr)Updates the filters. If passed a single Filter it is added to + the existing filters. If passed an array of Filters, they + replace all existing Filters.
Objectname(name)Sets the filter name.
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. + + + +
+ + + +
+ +
+
+
+ +

 filters

+
+ + Object filters ( fltr ) + + +
Updates the filters. If passed a single Filter it is added to + the existing filters. If passed an array of Filters, they + replace all existing Filters.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + fltr + + + <Filter | Filter[]> + + + + + + A Filter or array of Filters +
+ + +
+ + + + + + +
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. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + Object toJSON ( ) + + +
Returns the filter object.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ filter object + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.PartialField.html b/dist/docs/ejs.PartialField.html new file mode 100644 index 0000000..2e60509 --- /dev/null +++ b/dist/docs/ejs.PartialField.html @@ -0,0 +1,560 @@ + + + + + elastic.js: Module: PartialField + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsPartialField
+

+ +

When loading data from _source, partial fields can be used + to use wildcards to control what part of the _source will be loaded + based on include and exclude patterns.

+
+ +
+

Module

+
+
+ +

 PartialField

+
+ + PartialField ( fieldName ) + + +

Control what part of the _source will be loaded.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + fieldName + + + <String> + + + + + + A name of the partial field to create. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectexclude(exclude)Allows to control how the _source field is returned with every hit. + By default operations return the contents of the _source field + unless you have used the fields parameter or if the _source field + is disabled. Set the includes parameter to false to completely + disable returning the source field.
Objectinclude(include)Allows to control how the _source field is returned with every hit. + By default operations return the contents of the _source field + unless you have used the fields parameter or if the _source field + is disabled. Set the includes parameter to false to completely + disable returning the source field.
StringtoJSON()Retrieves the internal script object. This is typically used by + internal API functions so use with caution.
+
+ +

Method Detail

+ + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 exclude

+
+ + Object exclude ( exclude ) + + +
Allows to control how the _source field is returned with every hit. + By default operations return the contents of the _source field + unless you have used the fields parameter or if the _source field + is disabled. Set the includes parameter to false to completely + disable returning the source field.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + exclude + + + <String | String[]> + + + + + + The optional field or list of fields to exclude. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 include

+
+ + Object include ( include ) + + +
Allows to control how the _source field is returned with every hit. + By default operations return the contents of the _source field + unless you have used the fields parameter or if the _source field + is disabled. Set the includes parameter to false to completely + disable returning the source field.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + include + + + <String | String[]> + + + + + + The field or list of fields to include as array. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +
Retrieves the internal script object. This is typically used by + internal API functions so use with caution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal facet property. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.PercentilesAggregation.html b/dist/docs/ejs.PercentilesAggregation.html new file mode 100644 index 0000000..629e6c5 --- /dev/null +++ b/dist/docs/ejs.PercentilesAggregation.html @@ -0,0 +1,1203 @@ + + + + + elastic.js: Module: PercentilesAggregation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsPercentilesAggregation
+

+ +

A multi-value metrics aggregation that calculates one or more percentiles + over numeric values extracted from the aggregated documents. These values can + be extracted either from specific numeric fields in the documents, or be + generated by a provided script.

+
+ +
+

Module

+
+
+ +

 PercentilesAggregation

+
+ + PercentilesAggregation ( name ) + + +

Aggregation that calculates one or more percentiles over numeric values + extracted from the aggregated documents.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + name + + + <String> + + + + + + The name which be used to refer to this aggregation. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectcompression(c)Compression controls memory usage and approximation error. The compression + value limits the maximum number of nodes to 100 * compression. By + increasing the compression value, you can increase the accuracy of your + percentiles at the cost of more memory. Larger compression values also make + the algorithm slower since the underlying tree data structure grows in + size, resulting in more expensive operations. The default compression + value is 100.
Objectfield(field)

Sets the field to operate on.

Objectkeyed(trueFalse)Enable the response to be returned as a keyed object where the key is the + bucket interval.
Objectlang(language)The script language being used.
Objectparams(p)Sets parameters that will be applied to the script. Overwrites + any existing params.
Objectpercent(percentile)Add a single percentile to the current list of percentiles.
Objectpercents(percents)Sets the percentile bucket array. Overwrites all existing values.
Objectscript(scriptCode)Allows you generate or modify the terms/values using a script.
ObjectscriptFile(scriptFile)Allows you generate or modify the terms/values using a script.
ObjectscriptId(scriptId)Allows you generate or modify the terms/values using a script.
StringtoJSON()

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.

+
+ +

Method Detail

+ + + + + + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 compression

+
+ + Object compression ( c ) + + +
Compression controls memory usage and approximation error. The compression + value limits the maximum number of nodes to 100 * compression. By + increasing the compression value, you can increase the accuracy of your + percentiles at the cost of more memory. Larger compression values also make + the algorithm slower since the underlying tree data structure grows in + size, resulting in more expensive operations. The default compression + value is 100.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + c + + + <Integer> + + + + + + The compression level. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( field ) + + +

Sets the field to operate on.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + field + + + <String> + + + + + + a valid field name.. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 keyed

+
+ + Object keyed ( trueFalse ) + + +
Enable the response to be returned as a keyed object where the key is the + bucket interval.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + to enable keyed response or not +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 lang

+
+ + Object lang ( language ) + + +
The script language being used.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + language + + + <String> + + + + + + The language of the script. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 params

+
+ + Object params ( p ) + + +
Sets parameters that will be applied to the script. Overwrites + any existing params.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + p + + + <Object> + + + + + + An object where the keys are the parameter name and + values are the parameter value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 percent

+
+ + Object percent ( percentile ) + + +
Add a single percentile to the current list of percentiles.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + percentile + + + <Double> + + + + + + A double percentile value to add +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 percents

+
+ + Object percents ( percents ) + + +
Sets the percentile bucket array. Overwrites all existing values.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + percents + + + <Double[]> + + + + + + A double array of percentiles +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 script

+
+ + Object script ( scriptCode ) + + +
Allows you generate or modify the terms/values using a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptCode + + + <String> + + + + + + A valid script string to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scriptFile

+
+ + Object scriptFile ( scriptFile ) + + +
Allows you generate or modify the terms/values using a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptFile + + + <String> + + + + + + A valid script file to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scriptId

+
+ + Object scriptId ( scriptId ) + + +
Allows you generate or modify the terms/values using a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptId + + + <String> + + + + + + A valid script id to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal object. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.PhraseSuggester.html b/dist/docs/ejs.PhraseSuggester.html new file mode 100644 index 0000000..8e55506 --- /dev/null +++ b/dist/docs/ejs.PhraseSuggester.html @@ -0,0 +1,1837 @@ + + + + + elastic.js: Module: PhraseSuggester + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsPhraseSuggester
+

+ +

PhraseSuggester extends the PhraseSuggester and suggests + entire corrected phrases instead of individual tokens. The individual + phrase suggestions are weighted based on ngram-langugage models. In practice + it will be able to make better decision about which tokens to pick based on + co-occurence and frequencies.

+
+ +
+

Module

+
+
+ +

 PhraseSuggester

+
+ + PhraseSuggester ( name ) + + +

A suggester that suggests entire corrected phrases.


+ +
+
+ + + +
Since
+
elasticsearch 0.90
+ + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + name + + + <String> + + + + + + The name which be used to refer to this suggester. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectanalyzer(analyzer)

Sets analyzer used to analyze the suggest text.

Objectconfidence(c)

Sets the confidence level defines a factor applied to the input + phrases score which is used as a threshold for other suggest + candidates. Only candidates that score higher than the threshold + will be included in the result.

ObjectdirectGenerator(oGenerator)Adds a direct generator. If passed a single Generator + it is added to the list of existing generators. If passed an + array of Generators, they replace all existing generators.
Objectfield(field)

Sets the field used to generate suggestions from.

ObjectforceUnigrams(trueFalse)

Forces the use of unigrams.

ObjectgramSize(s)

Sets the max size of the n-grams (shingles) in the field. If + the field doesn't contain n-grams (shingles) this should be + omitted or set to 1.

Objecthighlight(preTag,postTag)

Enables highlighting of suggestions

ObjectlaplaceSmoothing(alpha)

A smoothing model that uses an additive smoothing model where a + constant (typically 1.0 or smaller) is added to all counts to + balance weights, The default alpha is 0.5.

ObjectlinearSmoothing(tl,bl,ul)

A smoothing model that takes the weighted mean of the unigrams, + bigrams and trigrams based on user supplied weights (lambdas). The + sum of tl, bl, and ul must equal 1.

ObjectmaxErrors(c)

Sets the maximum percentage of the terms that at most + considered to be misspellings in order to form a correction.

ObjectrealWordErrorLikelihood(l)

Sets the likelihood of a term being a misspelled even if the + term exists in the dictionary. The default it 0.95 corresponding + to 5% or the real words are misspelled.

Objectseparator(sep)

Sets the separator that is used to separate terms in the bigram + field. If not set the whitespce character is used as a + separator.

ObjectshardSize(s)

Sets the maximum number of suggestions to be retrieved from + each individual shard.

Objectsize(s)

Sets the number of suggestions returned for each token.

ObjectstupidBackoffSmoothing(discount)

A simple backoff model that backs off to lower order n-gram + models if the higher order count is 0 and discounts the lower + order n-gram model by a constant factor. The default discount is + 0.4.

Objecttext(txt)

Sets the text to get suggestions for. If not set, the global + suggestion text will be used.

StringtoJSON()

Retrieves the internal suggest object. This is typically used by + internal API functions so use with caution.

ObjecttokenLimit(l)

Sets the token limit.

+
+ +

Method Detail

+ + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 analyzer

+
+ + Object analyzer ( analyzer ) + + +

Sets analyzer used to analyze the suggest text.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + analyzer + + + <String> + + + + + + A valid analyzer name. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 confidence

+
+ + Object confidence ( c ) + + +

Sets the confidence level defines a factor applied to the input + phrases score which is used as a threshold for other suggest + candidates. Only candidates that score higher than the threshold + will be included in the result.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + c + + + <Double> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 directGenerator

+
+ + Object directGenerator ( oGenerator ) + + +
Adds a direct generator. If passed a single Generator + it is added to the list of existing generators. If passed an + array of Generators, they replace all existing generators.

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

 field

+
+ + Object field ( field ) + + +

Sets the field used to generate suggestions from.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + field + + + <String> + + + + + + A valid field name. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 forceUnigrams

+
+ + Object forceUnigrams ( trueFalse ) + + +

Forces the use of unigrams.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + True to force unigrams, false otherwise. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 gramSize

+
+ + Object gramSize ( s ) + + +

Sets the max size of the n-grams (shingles) in the field. If + the field doesn't contain n-grams (shingles) this should be + omitted or set to 1.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + s + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 highlight

+
+ + Object highlight ( preTag, postTag ) + + +

Enables highlighting of suggestions


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + preTag + + + <String> + + + + + + A tag used at highlight start. +
+ + + + + postTag + + + <String> + + + + + + A tag used at the end of the highlight. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 laplaceSmoothing

+
+ + Object laplaceSmoothing ( alpha ) + + +

A smoothing model that uses an additive smoothing model where a + constant (typically 1.0 or smaller) is added to all counts to + balance weights, The default alpha is 0.5.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + alpha + + + <Double> + + + + + + A double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 linearSmoothing

+
+ + Object linearSmoothing ( tl, bl, ul ) + + +

A smoothing model that takes the weighted mean of the unigrams, + bigrams and trigrams based on user supplied weights (lambdas). The + sum of tl, bl, and ul must equal 1.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + tl + + + <Double> + + + + + + A positive double value used for trigram weight. +
+ + + + + bl + + + <Double> + + + + + + A positive double value used for bigram weight. +
+ + + + + ul + + + <Double> + + + + + + A positive double value used for unigram weight. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 maxErrors

+
+ + Object maxErrors ( c ) + + +

Sets the maximum percentage of the terms that at most + considered to be misspellings in order to form a correction.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + c + + + <Double> + + + + + + A positive double value greater between 0 and 1. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 realWordErrorLikelihood

+
+ + Object realWordErrorLikelihood ( l ) + + +

Sets the likelihood of a term being a misspelled even if the + term exists in the dictionary. The default it 0.95 corresponding + to 5% or the real words are misspelled.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + l + + + <Double> + + + + + + A positive double value greater than 0.0. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 separator

+
+ + Object separator ( sep ) + + +

Sets the separator that is used to separate terms in the bigram + field. If not set the whitespce character is used as a + separator.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + sep + + + <String> + + + + + + A string separator. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 shardSize

+
+ + Object shardSize ( s ) + + +

Sets the maximum number of suggestions to be retrieved from + each individual shard.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + s + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 size

+
+ + Object size ( s ) + + +

Sets the number of suggestions returned for each token.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + s + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 stupidBackoffSmoothing

+
+ + Object stupidBackoffSmoothing ( discount ) + + +

A simple backoff model that backs off to lower order n-gram + models if the higher order count is 0 and discounts the lower + order n-gram model by a constant factor. The default discount is + 0.4.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + discount + + + <Double> + + + + + + A double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 text

+
+ + Object text ( txt ) + + +

Sets the text to get suggestions for. If not set, the global + suggestion text will be used.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + txt + + + <String> + + + + + + A string to get suggestions for. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal suggest object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal suggest property. + + + +
+ + + +
+ +
+
+
+ +

 tokenLimit

+
+ + Object tokenLimit ( l ) + + +

Sets the token limit.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + l + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.PrefixFilter.html b/dist/docs/ejs.PrefixFilter.html new file mode 100644 index 0000000..95dd8c6 --- /dev/null +++ b/dist/docs/ejs.PrefixFilter.html @@ -0,0 +1,797 @@ + + + + + elastic.js: Module: PrefixFilter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
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

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
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

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.PrefixQuery.html b/dist/docs/ejs.PrefixQuery.html new file mode 100644 index 0000000..895d96b --- /dev/null +++ b/dist/docs/ejs.PrefixQuery.html @@ -0,0 +1,766 @@ + + + + + elastic.js: Module: PrefixQuery + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsPrefixQuery
+

+ +

Matches documents that have fields containing terms with a specified + prefix (not analyzed). The prefix query maps to Lucene PrefixQuery.

+
+ +
+

Module

+
+
+ +

 PrefixQuery

+
+ + PrefixQuery ( field, value ) + + +
Matches documents containing the specified un-analyzed prefix.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + field + + + <String> + + + + + + A valid field name. +
+ + + + + value + + + <String> + + + + + + A string prefix. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectboost(boost)Sets the boost value of the Query.
Objectfield(f)The field to run the query against.
Objectrewrite(m)Sets rewrite method. Valid values are: + + constant_score_auto - tries to pick the best constant-score rewrite + method based on term and document counts from the query + + scoring_boolean - translates each term into boolean should and + keeps the scores as computed by the query + + constant_score_boolean - same as scoring_boolean, expect no scores + are computed. + + constant_score_filter - first creates a private Filter, by visiting + each term in sequence and marking all docs for that term + + top_terms_boost_N - first translates each term into boolean should + and scores are only computed as the boost using the top N + scoring terms. Replace N with an integer value. + + top_terms_N - first translates each term into boolean should + and keeps the scores as computed by the query. Only the top N + scoring terms are used. Replace N with an integer value. + + Default is constant_score_auto. + + This is an advanced option, use with care.
StringtoJSON()Retrieves the internal query object. This is typically used by + internal API functions so use with caution.
Objectvalue(p)The prefix value.
+
+ +

Method Detail

+ + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 boost

+
+ + Object boost ( boost ) + + +
Sets the boost value of the Query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + boost + + + <Double> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( f ) + + +
The field to run the query against.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + f + + + <String> + + + + + + A single field name. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 rewrite

+
+ + Object rewrite ( m ) + + +
Sets rewrite method. Valid values are: + + constant_score_auto - tries to pick the best constant-score rewrite + method based on term and document counts from the query + + scoring_boolean - translates each term into boolean should and + keeps the scores as computed by the query + + constant_score_boolean - same as scoring_boolean, expect no scores + are computed. + + constant_score_filter - first creates a private Filter, by visiting + each term in sequence and marking all docs for that term + + top_terms_boost_N - first translates each term into boolean should + and scores are only computed as the boost using the top N + scoring terms. Replace N with an integer value. + + top_terms_N - first translates each term into boolean should + and keeps the scores as computed by the query. Only the top N + scoring terms are used. Replace N with an integer value. + + Default is constant_score_auto. + + This is an advanced option, use with care.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + m + + + <String> + + + + + + The rewrite method as a string. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +
Retrieves the internal query object. This is typically used by + internal API functions so use with caution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal query property. + + + +
+ + + +
+ +
+
+
+ +

 value

+
+ + Object value ( p ) + + +
The prefix value.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + p + + + <String> + + + + + + A string prefix +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.QueryFacet.html b/dist/docs/ejs.QueryFacet.html new file mode 100644 index 0000000..ff29799 --- /dev/null +++ b/dist/docs/ejs.QueryFacet.html @@ -0,0 +1,974 @@ + + + + + elastic.js: Module: QueryFacet + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsQueryFacet
+

+ +

The QueryFacet facet allows you to specify any valid Query and + have the number of matching hits returned as the value.

+ +

Facets are similar to SQL GROUP BY statements but perform much + better. You can also construct several "groups" at once by simply + specifying multiple facets.

+ +
+

+ Tip: + For more information on faceted navigation, see + this + Wikipedia article on Faceted Classification. +

+

+
+ +
+

Module

+
+
+ +

 QueryFacet

+
+ + QueryFacet ( name ) + + +

A facet that return a count of the hits matching the given query.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + name + + + <String> + + + + + + The name which be used to refer to this facet. For instance, + the facet itself might utilize a field named doc_authors. Setting + name to Authors would allow you to refer to the + facet by that name, possibly simplifying some of the display logic. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
ObjectcacheFilter(trueFalse)

Enables caching of the facetFilter

ObjectfacetFilter(oFilter)

Allows you to reduce the documents used for computing facet results.

Objectglobal(trueFalse)

Computes values across the entire index

Objectmode(m)

Sets the mode the facet will use.

+ +

+
collector
+
post
+
Objectnested(path)

Sets the path to the nested document if faceting against a + nested field.

Objectquery(oQuery)

Sets the query to be used for this facet.

Objectscope(scope)

Computes values across the the specified scope

StringtoJSON()

Retrieves the internal facet object. This is typically used by + internal API functions so use with caution.

+
+ +

Method Detail

+ + + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 cacheFilter

+
+ + Object cacheFilter ( trueFalse ) + + +

Enables caching of the facetFilter


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + If the facetFilter should be cached or not +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 facetFilter

+
+ + Object facetFilter ( oFilter ) + + +

Allows you to reduce the documents used for computing facet results.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + oFilter + + + <Object> + + + + + + A valid Filter object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 global

+
+ + Object global ( trueFalse ) + + +

Computes values across the entire index


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + Calculate facet counts globally or not. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 mode

+
+ + Object mode ( m ) + + +

Sets the mode the facet will use.

+ +

+
collector
+
post
+

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + m + + + <String> + + + + + + The mode: collector or post. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 nested

+
+ + Object nested ( path ) + + +

Sets the path to the nested document if faceting against a + nested field.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + path + + + <String> + + + + + + The nested path +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 query

+
+ + Object query ( oQuery ) + + +

Sets the query to be used for this facet.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + oQuery + + + <Object> + + + + + + A valid Query object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scope

+
+ + Object scope ( scope ) + + +

Computes values across the the specified scope


+ +
+
+ + + + + +
Deprecated
since elasticsearch 0.90
+ + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scope + + + <String> + + + + + + The scope name to calculate facet counts with. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal facet object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal facet property. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.QueryFilter.html b/dist/docs/ejs.QueryFilter.html new file mode 100644 index 0000000..5ff6e82 --- /dev/null +++ b/dist/docs/ejs.QueryFilter.html @@ -0,0 +1,708 @@ + + + + + elastic.js: Module: QueryFilter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsQueryFilter
+

+ +

Wraps any query to be used as a filter. Can be placed within queries + that accept a filter.

+ +

The result of the filter is not cached by default. Set the cache + parameter to true to cache the result of the filter. This is handy when the + same query is used on several (many) other queries.

+ +

Note, the process of caching the first execution is higher when not + caching (since it needs to satisfy different queries).

+
+ +
+

Module

+
+
+ +

 QueryFilter

+
+ + QueryFilter ( qry ) + + +
Filters documents matching the wrapped query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + qry + + + <Object> + + + + + + A valid query object. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
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.
Objectname(name)Sets the filter name.
Objectquery(q)Sets the query
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. + + + +
+ + + +
+ +
+
+
+ +

 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. + + + +
+ + + +
+ +
+
+
+ +

 query

+
+ + Object query ( q ) + + +
Sets the query

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + q + + + <Object> + + + + + + A valid Query object +
+ + +
+ + + + + + +
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

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.QueryMixin.html b/dist/docs/ejs.QueryMixin.html new file mode 100644 index 0000000..3620152 --- /dev/null +++ b/dist/docs/ejs.QueryMixin.html @@ -0,0 +1,414 @@ + + + + + elastic.js: Mixin: QueryMixin + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsQueryMixin
+

+ + +
+ +
+
+
+ + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectboost(boost)Sets the boost value for documents matching the Query.
StringtoJSON()Retrieves the internal query object. This is typically used by + internal API functions so use with caution.
+
+ +

Method Detail

+ + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 boost

+
+ + Object boost ( boost ) + + +
Sets the boost value for documents matching the Query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + boost + + + <Double> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +
Retrieves the internal query object. This is typically used by + internal API functions so use with caution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal query property. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.QueryStringQuery.html b/dist/docs/ejs.QueryStringQuery.html new file mode 100644 index 0000000..f743af7 --- /dev/null +++ b/dist/docs/ejs.QueryStringQuery.html @@ -0,0 +1,2453 @@ + + + + + elastic.js: Module: QueryStringQuery + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsQueryStringQuery
+

+ +

A query that is parsed using Lucene's default query parser. Although Lucene provides the + ability to create your own queries through its API, it also provides a rich query language + through the Query Parser, a lexer which interprets a string into a Lucene Query.

+ +

See the Lucene Query Parser Syntax + for more information.

+
+ +
+

Module

+
+
+ +

 QueryStringQuery

+
+ + QueryStringQuery ( qstr ) + + +
A query that is parsed using Lucene's default query parser.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + qstr + + + <String> + + + + + + A valid Lucene query string. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
ObjectallowLeadingWildcard(trueFalse)Sets whether or not wildcard characters (* and ?) are allowed as the + first character of the Query. Default: true.
Objectanalyzer(analyzer)Sets the analyzer name used to analyze the Query object.
ObjectanalyzeWildcard(trueFalse)Sets whether or not we should attempt to analyzed wilcard terms in the + Query. By default, wildcard terms are not analyzed. + Analysis of wildcard characters is not perfect. Default: false.
ObjectautoGeneratePhraseQueries(trueFalse)Sets whether or not we should auto generate phrase queries *if* the + analyzer returns more than one term. Default: false.
Objectboost(boost)Sets the boost value for documents matching the Query.
ObjectdefaultField(fieldName)Sets the default field/property this query should execute against.
ObjectdefaultOperator(op)Set the default Boolean operator. This operator is used to join individual query + terms when no operator is explicity used in the query string (i.e., this AND that). + Defaults to OR.
ObjectenablePositionIncrements(trueFalse)Sets whether or not position increments will be used in the + Query. Default: true.
Objectescape(trueFalse)If they query string should be escaped or not.
Objectfields(fieldNames)A set of fields/properties this query should execute against. + Pass a single value to add to the existing list of fields and + pass an array to overwrite all existing fields. For each field, + you can apply a field specific boost by appending a ^boost to the + field name. For example, title^10, to give the title field a + boost of 10.
ObjectfuzzyMaxExpansions(max)Sets the max number of term expansions for fuzzy queries.
ObjectfuzzyMinSim(minSim)Set the minimum similarity for fuzzy queries. Default: 0.5.
ObjectfuzzyPrefixLength(fuzzLen)Sets the prefix length for fuzzy queries. Default: 0.
ObjectfuzzyRewrite(m)Sets fuzzy rewrite method. Valid values are: + + constant_score_auto - tries to pick the best constant-score rewrite + method based on term and document counts from the query + + scoring_boolean - translates each term into boolean should and + keeps the scores as computed by the query + + constant_score_boolean - same as scoring_boolean, expect no scores + are computed. + + constant_score_filter - first creates a private Filter, by visiting + each term in sequence and marking all docs for that term + + top_terms_boost_N - first translates each term into boolean should + and scores are only computed as the boost using the top N + scoring terms. Replace N with an integer value. + + top_terms_N - first translates each term into boolean should + and keeps the scores as computed by the query. Only the top N + scoring terms are used. Replace N with an integer value. + + Default is constant_score_auto. + + This is an advanced option, use with care.
Objectlenient(trueFalse)Enables lenient parsing of the query string.
ObjectlowercaseExpandedTerms(trueFalse)Sets whether or not terms from wildcard, prefix, fuzzy, and + range queries should automatically be lowercased in the Query + since they are not analyzed. Default: true.
ObjectminimumShouldMatch(minMatch)Sets a percent value controlling how many "should" clauses in the + resulting Query should match.
ObjectphraseSlop(slop)Sets the default slop for phrases. If zero, then exact phrase matches + are required. Default: 0.
Objectquery(qstr)Sets the query string on this Query object.
ObjectquoteAnalyzer(analyzer)Sets the quote analyzer name used to analyze the query + when in quoted text.
ObjectquoteFieldSuffix(s)Sets the suffix to automatically add to the field name when + performing a quoted search.
Objectrewrite(m)Sets rewrite method. Valid values are: + + constant_score_auto - tries to pick the best constant-score rewrite + method based on term and document counts from the query + + scoring_boolean - translates each term into boolean should and + keeps the scores as computed by the query + + constant_score_boolean - same as scoring_boolean, expect no scores + are computed. + + constant_score_filter - first creates a private Filter, by visiting + each term in sequence and marking all docs for that term + + top_terms_boost_N - first translates each term into boolean should + and scores are only computed as the boost using the top N + scoring terms. Replace N with an integer value. + + top_terms_N - first translates each term into boolean should + and keeps the scores as computed by the query. Only the top N + scoring terms are used. Replace N with an integer value. + + Default is constant_score_auto. + + This is an advanced option, use with care.
ObjecttieBreaker(tieBreaker)Sets the tie breaker value for a Query using + DisMax. The tie breaker capability allows results + that include the same term in multiple fields to be judged better than + results that include this term in only the best of those multiple + fields, without confusing this with the better case of two different + terms in the multiple fields. Default: 0.0.
StringtoJSON()Retrieves the internal query object. This is typically used by + internal API functions so use with caution.
ObjectuseDisMax(trueFalse)Sets whether or not queries against multiple fields should be combined using Lucene's + + DisjunctionMaxQuery
+
+ +

Method Detail

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 allowLeadingWildcard

+
+ + Object allowLeadingWildcard ( trueFalse ) + + +
Sets whether or not wildcard characters (* and ?) are allowed as the + first character of the Query. Default: true.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + A true/false value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 analyzer

+
+ + Object analyzer ( analyzer ) + + +
Sets the analyzer name used to analyze the Query object.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + analyzer + + + <String> + + + + + + A valid analyzer name. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 analyzeWildcard

+
+ + Object analyzeWildcard ( trueFalse ) + + +
Sets whether or not we should attempt to analyzed wilcard terms in the + Query. By default, wildcard terms are not analyzed. + Analysis of wildcard characters is not perfect. Default: false.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + A true/false value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 autoGeneratePhraseQueries

+
+ + Object autoGeneratePhraseQueries ( trueFalse ) + + +
Sets whether or not we should auto generate phrase queries *if* the + analyzer returns more than one term. Default: false.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + A true/false value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 boost

+
+ + Object boost ( boost ) + + +
Sets the boost value for documents matching the Query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + boost + + + <Double> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 defaultField

+
+ + Object defaultField ( fieldName ) + + +
Sets the default field/property this query should execute against.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + fieldName + + + <String> + + + + + + The name of document field/property. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 defaultOperator

+
+ + Object defaultOperator ( op ) + + +
Set the default Boolean operator. This operator is used to join individual query + terms when no operator is explicity used in the query string (i.e., this AND that). + Defaults to OR.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + op + + + <String> + + + + + + The operator to use, AND or OR. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 enablePositionIncrements

+
+ + Object enablePositionIncrements ( trueFalse ) + + +
Sets whether or not position increments will be used in the + Query. Default: true.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + A true/false value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 escape

+
+ + Object escape ( trueFalse ) + + +
If they query string should be escaped or not.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + A true/false value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 fields

+
+ + Object fields ( fieldNames ) + + +
A set of fields/properties this query should execute against. + Pass a single value to add to the existing list of fields and + pass an array to overwrite all existing fields. For each field, + you can apply a field specific boost by appending a ^boost to the + field name. For example, title^10, to give the title field a + boost of 10.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + fieldNames + + + <Array> + + + + + + A list of document fields/properties. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 fuzzyMaxExpansions

+
+ + Object fuzzyMaxExpansions ( max ) + + +
Sets the max number of term expansions for fuzzy queries.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + max + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 fuzzyMinSim

+
+ + Object fuzzyMinSim ( minSim ) + + +
Set the minimum similarity for fuzzy queries. Default: 0.5.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + minSim + + + <Double> + + + + + + A double value between 0 and 1. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 fuzzyPrefixLength

+
+ + Object fuzzyPrefixLength ( fuzzLen ) + + +
Sets the prefix length for fuzzy queries. Default: 0.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + fuzzLen + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 fuzzyRewrite

+
+ + Object fuzzyRewrite ( m ) + + +
Sets fuzzy rewrite method. Valid values are: + + constant_score_auto - tries to pick the best constant-score rewrite + method based on term and document counts from the query + + scoring_boolean - translates each term into boolean should and + keeps the scores as computed by the query + + constant_score_boolean - same as scoring_boolean, expect no scores + are computed. + + constant_score_filter - first creates a private Filter, by visiting + each term in sequence and marking all docs for that term + + top_terms_boost_N - first translates each term into boolean should + and scores are only computed as the boost using the top N + scoring terms. Replace N with an integer value. + + top_terms_N - first translates each term into boolean should + and keeps the scores as computed by the query. Only the top N + scoring terms are used. Replace N with an integer value. + + Default is constant_score_auto. + + This is an advanced option, use with care.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + m + + + <String> + + + + + + The rewrite method as a string. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 lenient

+
+ + Object lenient ( trueFalse ) + + +
Enables lenient parsing of the query string.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + A boolean value +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 lowercaseExpandedTerms

+
+ + Object lowercaseExpandedTerms ( trueFalse ) + + +
Sets whether or not terms from wildcard, prefix, fuzzy, and + range queries should automatically be lowercased in the Query + since they are not analyzed. Default: true.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + A true/false value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 minimumShouldMatch

+
+ + Object minimumShouldMatch ( minMatch ) + + +
Sets a percent value controlling how many "should" clauses in the + resulting Query should match.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + minMatch + + + <String> + + + + + + A min should match parameter. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 phraseSlop

+
+ + Object phraseSlop ( slop ) + + +
Sets the default slop for phrases. If zero, then exact phrase matches + are required. Default: 0.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + slop + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 query

+
+ + Object query ( qstr ) + + +
Sets the query string on this Query object.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + qstr + + + <String> + + + + + + A valid Lucene query string. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 quoteAnalyzer

+
+ + Object quoteAnalyzer ( analyzer ) + + +
Sets the quote analyzer name used to analyze the query + when in quoted text.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + analyzer + + + <String> + + + + + + A valid analyzer name. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 quoteFieldSuffix

+
+ + Object quoteFieldSuffix ( s ) + + +
Sets the suffix to automatically add to the field name when + performing a quoted search.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + s + + + <String> + + + + + + The suffix as a string. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 rewrite

+
+ + Object rewrite ( m ) + + +
Sets rewrite method. Valid values are: + + constant_score_auto - tries to pick the best constant-score rewrite + method based on term and document counts from the query + + scoring_boolean - translates each term into boolean should and + keeps the scores as computed by the query + + constant_score_boolean - same as scoring_boolean, expect no scores + are computed. + + constant_score_filter - first creates a private Filter, by visiting + each term in sequence and marking all docs for that term + + top_terms_boost_N - first translates each term into boolean should + and scores are only computed as the boost using the top N + scoring terms. Replace N with an integer value. + + top_terms_N - first translates each term into boolean should + and keeps the scores as computed by the query. Only the top N + scoring terms are used. Replace N with an integer value. + + Default is constant_score_auto. + + This is an advanced option, use with care.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + m + + + <String> + + + + + + The rewrite method as a string. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 tieBreaker

+
+ + Object tieBreaker ( tieBreaker ) + + +
Sets the tie breaker value for a Query using + DisMax. The tie breaker capability allows results + that include the same term in multiple fields to be judged better than + results that include this term in only the best of those multiple + fields, without confusing this with the better case of two different + terms in the multiple fields. Default: 0.0.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + tieBreaker + + + <Double> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +
Retrieves the internal query object. This is typically used by + internal API functions so use with caution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal query property. + + + +
+ + + +
+ +
+
+
+ +

 useDisMax

+
+ + Object useDisMax ( trueFalse ) + + +
Sets whether or not queries against multiple fields should be combined using Lucene's + + DisjunctionMaxQuery

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <String> + + + + + + A true/false value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.RandomScoreFunction.html b/dist/docs/ejs.RandomScoreFunction.html new file mode 100644 index 0000000..d3a0536 --- /dev/null +++ b/dist/docs/ejs.RandomScoreFunction.html @@ -0,0 +1,526 @@ + + + + + elastic.js: Module: RandomScoreFunction + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsRandomScoreFunction
+

+ +

The random_score generates scores via a pseudo random number algorithm + that is initialized with a seed.

+
+ +
+

Module

+
+
+ +

 RandomScoreFunction

+
+ + RandomScoreFunction ( ) + + +

Randomly score documents.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectfilter(oFilter)Adds a filter whose matching documents will have the score function applied.
Objectseed(s)Sets random seed value.
StringtoJSON()

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.

+
+ +

Method Detail

+ + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 filter

+
+ + Object filter ( oFilter ) + + +
Adds a filter whose matching documents will have the score function applied.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + oFilter + + + <Filter> + + + + + + Any valid Filter object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 seed

+
+ + Object seed ( s ) + + +
Sets random seed value.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + s + + + <Long> + + + + + + A seed value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal object. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.RangeAggregation.html b/dist/docs/ejs.RangeAggregation.html new file mode 100644 index 0000000..ed240b6 --- /dev/null +++ b/dist/docs/ejs.RangeAggregation.html @@ -0,0 +1,1234 @@ + + + + + elastic.js: Module: RangeAggregation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsRangeAggregation
+

+ +

A multi-bucket value source based aggregation that enables the user to + define a set of ranges - each representing a bucket. During the aggregation + process, the values extracted from each document will be checked against each + bucket range and "bucket" the relevant/matching document.

+ +

Note that this aggregration includes the from value and excludes the to + value for each range.

+
+ +
+

Module

+
+
+ +

 RangeAggregation

+
+ + RangeAggregation ( name ) + + +

Aggregation that enables the user to define a set of ranges that each + represent a bucket.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + name + + + <String> + + + + + + The name which be used to refer to this aggregation. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectagg(agg)Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method.
Objectaggregation(agg)Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation.
Objectfield(field)

Sets the field to operate on.

Objectkeyed(trueFalse)Enable the response to be returned as a keyed object where the key is the + bucket interval.
Objectlang(language)The script language being used.
Objectparams(p)Sets parameters that will be applied to the script. Overwrites + any existing params.
Objectrange(from,to,key)Adds a range to the list of exsiting range expressions.
Objectscript(scriptCode)Allows you generate or modify the terms/values using a script.
ObjectscriptFile(scriptFile)Allows you generate or modify the terms/values using a script.
ObjectscriptId(scriptId)Allows you generate or modify the terms/values using a script.
StringtoJSON()

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.

+
+ +

Method Detail

+ + + + + + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 agg

+
+ + Object agg ( agg ) + + +
Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + agg + + + <Aggregation> + + + + + + Any valid Aggregation object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 aggregation

+
+ + Object aggregation ( agg ) + + +
Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + agg + + + <Aggregation> + + + + + + Any valid Aggregation object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( field ) + + +

Sets the field to operate on.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + field + + + <String> + + + + + + a valid field name.. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 keyed

+
+ + Object keyed ( trueFalse ) + + +
Enable the response to be returned as a keyed object where the key is the + bucket interval.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + to enable keyed response or not +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 lang

+
+ + Object lang ( language ) + + +
The script language being used.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + language + + + <String> + + + + + + The language of the script. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 params

+
+ + Object params ( p ) + + +
Sets parameters that will be applied to the script. Overwrites + any existing params.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + p + + + <Object> + + + + + + An object where the keys are the parameter name and + values are the parameter value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 range

+
+ + Object range ( from, to, key ) + + +
Adds a range to the list of exsiting range expressions.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + from + + + <String> + + + + + + The start value, use null to ignore +
+ + + + + to + + + <String> + + + + + + The end value, use null to ignore. +
+ + + + + key + + + <String> + + + + + + Optional key/bucket name for keyed responses. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 script

+
+ + Object script ( scriptCode ) + + +
Allows you generate or modify the terms/values using a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptCode + + + <String> + + + + + + A valid script string to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scriptFile

+
+ + Object scriptFile ( scriptFile ) + + +
Allows you generate or modify the terms/values using a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptFile + + + <String> + + + + + + A valid script file to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scriptId

+
+ + Object scriptId ( scriptId ) + + +
Allows you generate or modify the terms/values using a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptId + + + <String> + + + + + + A valid script id to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal object. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.RangeFacet.html b/dist/docs/ejs.RangeFacet.html new file mode 100644 index 0000000..5120247 --- /dev/null +++ b/dist/docs/ejs.RangeFacet.html @@ -0,0 +1,1718 @@ + + + + + elastic.js: Module: RangeFacet + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsRangeFacet
+

+ +

A RangeFacet allows you to specify a set of ranges and get both the number of docs (count) that + fall within each range, and aggregated data based on the field, or another specified field.

+ +

Facets are similar to SQL GROUP BY statements but perform much + better. You can also construct several "groups" at once by simply + specifying multiple facets.

+ +
+

+ Tip: + For more information on faceted navigation, see + this + Wikipedia article on Faceted Classification. +

+

+
+ +
+

Module

+
+
+ +

 RangeFacet

+
+ + RangeFacet ( name ) + + +

A facet which provides information over a range of numeric intervals.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + name + + + <String> + + + + + + The name which be used to refer to this facet. For instance, + the facet itself might utilize a field named doc_authors. Setting + name to Authors would allow you to refer to the + facet by that name, possibly simplifying some of the display logic. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
ObjectaddRange(from,to)Adds a new bounded range.
ObjectaddUnboundedFrom(from)Adds a new unbounded lower limit.
ObjectaddUnboundedTo(to)Adds a new unbounded upper limit.
ObjectcacheFilter(trueFalse)

Enables caching of the facetFilter

ObjectfacetFilter(oFilter)

Allows you to reduce the documents used for computing facet results.

Objectfield(fieldName)Sets the document field to be used for the facet.
Objectglobal(trueFalse)

Computes values across the entire index

ObjectkeyField(fieldName)Allows you to specify an alternate key field to be used to compute the interval.
ObjectkeyScript(scriptCode)Allows you modify the key field using a script. The modified value + is then used to generate the interval.
Objectlang(language)The script language being used. Currently supported values are + javascript, groovy, and mvel.
Objectmode(m)

Sets the mode the facet will use.

+ +

+
collector
+
post
+
Objectnested(path)

Sets the path to the nested document if faceting against a + nested field.

Objectparams(p)Sets parameters that will be applied to the script. Overwrites + any existing params.
Objectscope(scope)

Computes values across the the specified scope

StringtoJSON()

Retrieves the internal facet object. This is typically used by + internal API functions so use with caution.

ObjectvalueField(fieldName)Allows you to specify an alternate value field to be used to compute statistical information.
ObjectvalueScript(scriptCode)Allows you modify the value field using a script. The modified value + is then used to compute the statistical data.
+
+ +

Method Detail

+ + + + + + + + + + + + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 addRange

+
+ + Object addRange ( from, to ) + + +
Adds a new bounded range.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + from + + + <Number> + + + + + + The lower bound of the range (can also be Date). +
+ + + + + to + + + <Number> + + + + + + The upper bound of the range (can also be Date). +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 addUnboundedFrom

+
+ + Object addUnboundedFrom ( from ) + + +
Adds a new unbounded lower limit.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + from + + + <Number> + + + + + + The lower limit of the unbounded range (can also be Date). +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 addUnboundedTo

+
+ + Object addUnboundedTo ( to ) + + +
Adds a new unbounded upper limit.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + to + + + <Number> + + + + + + The upper limit of the unbounded range (can also be Date). +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 cacheFilter

+
+ + Object cacheFilter ( trueFalse ) + + +

Enables caching of the facetFilter


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + If the facetFilter should be cached or not +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 facetFilter

+
+ + Object facetFilter ( oFilter ) + + +

Allows you to reduce the documents used for computing facet results.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + oFilter + + + <Object> + + + + + + A valid Filter object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( fieldName ) + + +
Sets the document field to be used for the facet.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + fieldName + + + <String> + + + + + + The field name whose data will be used to compute the interval. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 global

+
+ + Object global ( trueFalse ) + + +

Computes values across the entire index


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + Calculate facet counts globally or not. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 keyField

+
+ + Object keyField ( fieldName ) + + +
Allows you to specify an alternate key field to be used to compute the interval.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + fieldName + + + <String> + + + + + + The field name whose data will be used to compute the interval. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 keyScript

+
+ + Object keyScript ( scriptCode ) + + +
Allows you modify the key field using a script. The modified value + is then used to generate the interval.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptCode + + + <String> + + + + + + A valid script string to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 lang

+
+ + Object lang ( language ) + + +
The script language being used. Currently supported values are + javascript, groovy, and mvel.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + language + + + <String> + + + + + + The language of the script. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 mode

+
+ + Object mode ( m ) + + +

Sets the mode the facet will use.

+ +

+
collector
+
post
+

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + m + + + <String> + + + + + + The mode: collector or post. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 nested

+
+ + Object nested ( path ) + + +

Sets the path to the nested document if faceting against a + nested field.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + path + + + <String> + + + + + + The nested path +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 params

+
+ + Object params ( p ) + + +
Sets parameters that will be applied to the script. Overwrites + any existing params.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + p + + + <Object> + + + + + + An object where the keys are the parameter name and + values are the parameter value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scope

+
+ + Object scope ( scope ) + + +

Computes values across the the specified scope


+ +
+
+ + + + + +
Deprecated
since elasticsearch 0.90
+ + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scope + + + <String> + + + + + + The scope name to calculate facet counts with. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal facet object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal facet property. + + + +
+ + + +
+ +
+
+
+ +

 valueField

+
+ + Object valueField ( fieldName ) + + +
Allows you to specify an alternate value field to be used to compute statistical information.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + fieldName + + + <String> + + + + + + The field name whose data will be used to compute statistics. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 valueScript

+
+ + Object valueScript ( scriptCode ) + + +
Allows you modify the value field using a script. The modified value + is then used to compute the statistical data.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptCode + + + <String> + + + + + + A valid script string to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.RangeFilter.html b/dist/docs/ejs.RangeFilter.html new file mode 100644 index 0000000..d1bf664 --- /dev/null +++ b/dist/docs/ejs.RangeFilter.html @@ -0,0 +1,1350 @@ + + + + + elastic.js: Module: RangeFilter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsRangeFilter
+

+ +

Matches documents with fields that have terms within a certain range.

+
+ +
+

Module

+
+
+ +

 RangeFilter

+
+ + RangeFilter ( field ) + + +
Filters documents with fields that have terms within a certain range.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + field + + + <String> + + + + + + A valid field name. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
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(f)The field to run the filter against.
Objectfrom(f)The lower bound. Defaults to start from the first.
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(t)The upper bound. Defaults to unbounded.
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 ( f ) + + +
The field to run the filter against.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + f + + + <String> + + + + + + A single field name. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 from

+
+ + Object from ( f ) + + +
The lower bound. Defaults to start from the first.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + f + + + <*> + + + + + + the lower bound value, type depends on field type +
+ + +
+ + + + + + +
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 ( t ) + + +
The upper bound. Defaults to unbounded.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + t + + + <*> + + + + + + the upper bound value, type depends on field type +
+ + +
+ + + + + + +
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

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.RangeQuery.html b/dist/docs/ejs.RangeQuery.html new file mode 100644 index 0000000..aab921b --- /dev/null +++ b/dist/docs/ejs.RangeQuery.html @@ -0,0 +1,1195 @@ + + + + + elastic.js: Module: RangeQuery + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsRangeQuery
+

+ +

Matches documents with fields that have terms within a certain range. + The type of the Lucene query depends on the field type, for string fields, + the TermRangeQuery, while for number/date fields, the query is a + NumericRangeQuery.

+
+ +
+

Module

+
+
+ +

 RangeQuery

+
+ + RangeQuery ( field ) + + +
Matches documents with fields that have terms within a certain range.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + field + + + <String> + + + + + + A valid field name. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectboost(boost)Sets the boost value of the Query.
Objectfield(f)The field to run the query against.
Objectfrom(f)The lower bound. Defaults to start from the first.
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.
Objectto(t)The upper bound. Defaults to unbounded.
StringtoJSON()Retrieves the internal query object. This is typically used by + internal API functions so use with caution.
+
+ +

Method Detail

+ + + + + + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 boost

+
+ + Object boost ( boost ) + + +
Sets the boost value of the Query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + boost + + + <Double> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( f ) + + +
The field to run the query against.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + f + + + <String> + + + + + + A single field name. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 from

+
+ + Object from ( f ) + + +
The lower bound. Defaults to start from the first.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + f + + + <*> + + + + + + the lower bound value, type depends on field type +
+ + +
+ + + + + + +
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. + + + +
+ + + +
+ +
+
+
+ +

 to

+
+ + Object to ( t ) + + +
The upper bound. Defaults to unbounded.

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

 toJSON

+
+ + String toJSON ( ) + + +
Retrieves the internal query object. This is typically used by + internal API functions so use with caution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal query property. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.RegexpFilter.html b/dist/docs/ejs.RegexpFilter.html new file mode 100644 index 0000000..c91f590 --- /dev/null +++ b/dist/docs/ejs.RegexpFilter.html @@ -0,0 +1,983 @@ + + + + + elastic.js: Module: RegexpFilter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsRegexpFilter
+

+ +

Filters documents that have a field value matching a regular expression. + Based on Lucene 4.0 RegexpFilter which uses automaton to efficiently iterate + over index terms.

+
+ +
+

Module

+
+
+ +

 RegexpFilter

+
+ + RegexpFilter ( field, value ) + + +
Matches documents that have fields matching a regular expression.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + field + + + <String> + + + + + + A valid field name. +
+ + + + + value + + + <String> + + + + + + A regex pattern. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
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(f)The field to run the filter against.
Objectflags(f)The regex flags to use. Valid flags are: + + INTERSECTION - Support for intersection notation + COMPLEMENT - Support for complement notation + EMPTY - Support for the empty language symbol: # + ANYSTRING - Support for the any string symbol: @ + INTERVAL - Support for numerical interval notation: + NONE - Disable support for all syntax options + ALL - Enables support for all syntax options + + Use multiple flags by separating with a "|" character. Example: + + INTERSECTION|COMPLEMENT|EMPTY
ObjectflagsValue(v)The regex flags to use as a numeric value. Advanced use only, + it is probably better to stick with the flags option.
Objectname(name)Sets the filter name.
ObjecttoJSON()Returns the filter object.
Objectvalue(p)The regexp value.
+
+ +

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 ( f ) + + +
The field to run the filter against.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + f + + + <String> + + + + + + A single field name. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 flags

+
+ + Object flags ( f ) + + +
The regex flags to use. Valid flags are: + + INTERSECTION - Support for intersection notation + COMPLEMENT - Support for complement notation + EMPTY - Support for the empty language symbol: # + ANYSTRING - Support for the any string symbol: @ + INTERVAL - Support for numerical interval notation: + NONE - Disable support for all syntax options + ALL - Enables support for all syntax options + + Use multiple flags by separating with a "|" character. Example: + + INTERSECTION|COMPLEMENT|EMPTY

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + f + + + <String> + + + + + + The flags as a string, separate multiple flags with "|". +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 flagsValue

+
+ + Object flagsValue ( v ) + + +
The regex flags to use as a numeric value. Advanced use only, + it is probably better to stick with the flags option.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + v + + + <String> + + + + + + The flags as a numeric value. +
+ + +
+ + + + + + +
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. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + Object toJSON ( ) + + +
Returns the filter object.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ filter object + + + +
+ + + +
+ +
+
+
+ +

 value

+
+ + Object value ( p ) + + +
The regexp value.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + p + + + <String> + + + + + + A string regexp +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.RegexpQuery.html b/dist/docs/ejs.RegexpQuery.html new file mode 100644 index 0000000..8a5de6f --- /dev/null +++ b/dist/docs/ejs.RegexpQuery.html @@ -0,0 +1,953 @@ + + + + + elastic.js: Module: RegexpQuery + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsRegexpQuery
+

+ +

Matches documents that have fields matching a regular expression. Based + on Lucene 4.0 RegexpQuery which uses automaton to efficiently iterate over + index terms.

+
+ +
+

Module

+
+
+ +

 RegexpQuery

+
+ + RegexpQuery ( field, value ) + + +
Matches documents that have fields matching a regular expression.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + field + + + <String> + + + + + + A valid field name. +
+ + + + + value + + + <String> + + + + + + A regex pattern. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectboost(boost)Sets the boost value of the Query.
Objectfield(f)The field to run the query against.
Objectflags(f)The regex flags to use. Valid flags are: + + INTERSECTION - Support for intersection notation + COMPLEMENT - Support for complement notation + EMPTY - Support for the empty language symbol: # + ANYSTRING - Support for the any string symbol: @ + INTERVAL - Support for numerical interval notation: + NONE - Disable support for all syntax options + ALL - Enables support for all syntax options + + Use multiple flags by separating with a "|" character. Example: + + INTERSECTION|COMPLEMENT|EMPTY
ObjectflagsValue(v)The regex flags to use as a numeric value. Advanced use only, + it is probably better to stick with the flags option.
Objectrewrite(m)Sets rewrite method. Valid values are: + + constant_score_auto - tries to pick the best constant-score rewrite + method based on term and document counts from the query + + scoring_boolean - translates each term into boolean should and + keeps the scores as computed by the query + + constant_score_boolean - same as scoring_boolean, expect no scores + are computed. + + constant_score_filter - first creates a private Filter, by visiting + each term in sequence and marking all docs for that term + + top_terms_boost_N - first translates each term into boolean should + and scores are only computed as the boost using the top N + scoring terms. Replace N with an integer value. + + top_terms_N - first translates each term into boolean should + and keeps the scores as computed by the query. Only the top N + scoring terms are used. Replace N with an integer value. + + Default is constant_score_auto. + + This is an advanced option, use with care.
StringtoJSON()Retrieves the internal query object. This is typically used by + internal API functions so use with caution.
Objectvalue(p)The regexp value.
+
+ +

Method Detail

+ + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 boost

+
+ + Object boost ( boost ) + + +
Sets the boost value of the Query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + boost + + + <Double> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( f ) + + +
The field to run the query against.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + f + + + <String> + + + + + + A single field name. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 flags

+
+ + Object flags ( f ) + + +
The regex flags to use. Valid flags are: + + INTERSECTION - Support for intersection notation + COMPLEMENT - Support for complement notation + EMPTY - Support for the empty language symbol: # + ANYSTRING - Support for the any string symbol: @ + INTERVAL - Support for numerical interval notation: + NONE - Disable support for all syntax options + ALL - Enables support for all syntax options + + Use multiple flags by separating with a "|" character. Example: + + INTERSECTION|COMPLEMENT|EMPTY

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + f + + + <String> + + + + + + The flags as a string, separate multiple flags with "|". +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 flagsValue

+
+ + Object flagsValue ( v ) + + +
The regex flags to use as a numeric value. Advanced use only, + it is probably better to stick with the flags option.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + v + + + <String> + + + + + + The flags as a numeric value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 rewrite

+
+ + Object rewrite ( m ) + + +
Sets rewrite method. Valid values are: + + constant_score_auto - tries to pick the best constant-score rewrite + method based on term and document counts from the query + + scoring_boolean - translates each term into boolean should and + keeps the scores as computed by the query + + constant_score_boolean - same as scoring_boolean, expect no scores + are computed. + + constant_score_filter - first creates a private Filter, by visiting + each term in sequence and marking all docs for that term + + top_terms_boost_N - first translates each term into boolean should + and scores are only computed as the boost using the top N + scoring terms. Replace N with an integer value. + + top_terms_N - first translates each term into boolean should + and keeps the scores as computed by the query. Only the top N + scoring terms are used. Replace N with an integer value. + + Default is constant_score_auto. + + This is an advanced option, use with care.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + m + + + <String> + + + + + + The rewrite method as a string. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +
Retrieves the internal query object. This is typically used by + internal API functions so use with caution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal query property. + + + +
+ + + +
+ +
+
+
+ +

 value

+
+ + Object value ( p ) + + +
The regexp value.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + p + + + <String> + + + + + + A string regexp +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.Request.html b/dist/docs/ejs.Request.html new file mode 100644 index 0000000..991dbf0 --- /dev/null +++ b/dist/docs/ejs.Request.html @@ -0,0 +1,2295 @@ + + + + + elastic.js: Module: Request + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsRequest
+

+ +

The Request object provides methods generating an elasticsearch request body.

+
+ +
+

Module

+
+
+ +

 Request

+
+ + Request ( conf ) + + +

Provides methods for generating request bodies.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + conf + + + <Object> + + + + + + A configuration object containing the initilization + parameters. The following parameters can be set in the conf object: + indices - single index name or array of index names + types - single type name or array of types + routing - the shard routing value +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + +

Properties

+ + + + + + + + + + +
+
+ + + + + + + + + + +
NameDescription
query <Object> + The internal query object. +

+ + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectagg(agg)Add an aggregation. This method can be called multiple times + in order to set multiple nested aggregations that will be executed + at the same time as the search request. Alias for the aggregation method.
Objectaggregation(agg)Add an aggregation. This method can be called multiple times + in order to set multiple nested aggregations that will be executed + at the same time as the search request.
Objectexplain(trueFalse)Enable/Disable explanation of score for each search result.
Objectfacet(facet)Allows you to set the specified facet on this request object. Multiple facets can + be set, all of which will be returned when the search is executed.
Objectfields(s)By default, searches return full documents, meaning every property or field. + This method allows you to specify which fields you want returned. + + Pass a single field name and it is appended to the current list of + fields. Pass an array of fields and it replaces all existing + fields.
Objectfilter(filter)Allows you to set a specified filter on this request object.
Objectfrom(f)A search result set could be very large (think Google). Setting the + from parameter allows you to page through the result set + by making multiple request. This parameters specifies the starting + result/document number point. Combine with size() to achieve paging.
Objecthighlight(h)Performs highlighting based on the Highlight + settings.
ObjectindexBoost(index,boost)Boosts hits in the specified index by the given boost value.
ObjectminScore(min)Filters out search results will scores less than the specified minimum score.
ObjectpartialField(oPartialField)Control what part of the _source will be loaded based on PartialField.
Objectpost_filter(filter)Allows you to set a specified post_filter on this request object.
Objectquery(someQuery)Allows you to set the specified query on this search object. This is the + query that will be used when the search is executed.
Objectrescore(r)Once a query executes, you can use rescore to run a secondary, more + expensive query to re-order the results.
ObjectscriptField(oScriptField)Computes a document property dynamically based on the supplied ScriptField.
Objectsize(s)Sets the number of results/documents to be returned. This is set on a per page basis.
Objectsort(fieldName)

Sets the sorting for the query. This accepts many input formats.

+ +
+
sort() - The current sorting values are returned.
+
sort(fieldName) - Adds the field to the current list of sorting values.
+
sort(fieldName, order) - Adds the field to the current list of + sorting with the specified order. Order must be asc or desc.
+
sort(ejs.Sort) - Adds the Sort value to the current list of sorting values.
+
sort(array) - Replaces all current sorting values with values + from the array. The array must contain only strings and Sort objects.
+
+ +

Multi-level sorting is supported so the order in which sort fields + are added to the query requests is relevant.

+ +

It is recommended to use Sort objects when possible.

Objectsource(includes,excludes)Allows to control how the _source field is returned with every hit. + By default operations return the contents of the _source field + unless you have used the fields parameter or if the _source field + is disabled. Set the includes parameter to false to completely + disable returning the source field.
Objectsuggest(s)Allows you to set the specified suggester on this request object. + Multiple suggesters can be set, all of which will be returned when + the search is executed. Global suggestion text can be set by + passing in a string vs. a Suggest object.
Objecttimeout(t)A timeout, bounding the request to be executed within the + specified time value and bail when expired. Defaults to no timeout. + +

This option is valid during the following operations: + search and delete by query

StringtoJSON()Retrieves the internal query object. This is typically used by + internal API functions so use with caution.
ObjecttrackScores(trueFalse)Enables score computation and tracking during sorting. Be default, + when sorting scores are not computed.
Objectversion(trueFalse)Enable/Disable returning version number for each search result.
+
+ +

Method Detail

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 agg

+
+ + Object agg ( agg ) + + +
Add an aggregation. This method can be called multiple times + in order to set multiple nested aggregations that will be executed + at the same time as the search request. Alias for the aggregation method.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + agg + + + <Aggregation> + + + + + + Any valid Aggregation object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 aggregation

+
+ + Object aggregation ( agg ) + + +
Add an aggregation. This method can be called multiple times + in order to set multiple nested aggregations that will be executed + at the same time as the search request.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + agg + + + <Aggregation> + + + + + + Any valid Aggregation object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 explain

+
+ + Object explain ( trueFalse ) + + +
Enable/Disable explanation of score for each search result.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + true to enable, false to disable +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 facet

+
+ + Object facet ( facet ) + + +
Allows you to set the specified facet on this request object. Multiple facets can + be set, all of which will be returned when the search is executed.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + facet + + + <Facet> + + + + + + Any valid Facet object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 fields

+
+ + Object fields ( s ) + + +
By default, searches return full documents, meaning every property or field. + This method allows you to specify which fields you want returned. + + Pass a single field name and it is appended to the current list of + fields. Pass an array of fields and it replaces all existing + fields.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + s + + + <String | String[]> + + + + + + The field as a string or fields as array +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 filter

+
+ + Object filter ( filter ) + + +
Allows you to set a specified filter on this request object.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + filter + + + <Object> + + + + + + Any valid Filter object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 from

+
+ + Object from ( f ) + + +
A search result set could be very large (think Google). Setting the + from parameter allows you to page through the result set + by making multiple request. This parameters specifies the starting + result/document number point. Combine with size() to achieve paging.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + f + + + <Array> + + + + + + The offset at which to start fetching results/documents from the result set. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 highlight

+
+ + Object highlight ( h ) + + +
Performs highlighting based on the Highlight + settings.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + h + + + <Highlight> + + + + + + A valid Highlight object +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 indexBoost

+
+ + Object indexBoost ( index, boost ) + + +
Boosts hits in the specified index by the given boost value.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + index + + + <String> + + + + + + the index to boost +
+ + + + + boost + + + <Double> + + + + + + the boost value +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 minScore

+
+ + Object minScore ( min ) + + +
Filters out search results will scores less than the specified minimum score.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + min + + + <Double> + + + + + + a positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 partialField

+
+ + Object partialField ( oPartialField ) + + +
Control what part of the _source will be loaded based on PartialField.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + oPartialField + + + <PartialField> + + + + + + A valid PartialField. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 post_filter

+
+ + Object post_filter ( filter ) + + +
Allows you to set a specified post_filter on this request object.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + filter + + + <Object> + + + + + + Any valid Filter object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 query

+
+ + Object query ( someQuery ) + + +
Allows you to set the specified query on this search object. This is the + query that will be used when the search is executed.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + someQuery + + + <Query> + + + + + + Any valid Query object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 rescore

+
+ + Object rescore ( r ) + + +
Once a query executes, you can use rescore to run a secondary, more + expensive query to re-order the results.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + r + + + <Rescore> + + + + + + The rescore configuration. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scriptField

+
+ + Object scriptField ( oScriptField ) + + +
Computes a document property dynamically based on the supplied ScriptField.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + oScriptField + + + <ScriptField> + + + + + + A valid ScriptField. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 size

+
+ + Object size ( s ) + + +
Sets the number of results/documents to be returned. This is set on a per page basis.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + s + + + <Integer> + + + + + + The number of results that are to be returned by the search. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 sort

+
+ + Object sort ( fieldName ) + + +

Sets the sorting for the query. This accepts many input formats.

+ +
+
sort() - The current sorting values are returned.
+
sort(fieldName) - Adds the field to the current list of sorting values.
+
sort(fieldName, order) - Adds the field to the current list of + sorting with the specified order. Order must be asc or desc.
+
sort(ejs.Sort) - Adds the Sort value to the current list of sorting values.
+
sort(array) - Replaces all current sorting values with values + from the array. The array must contain only strings and Sort objects.
+
+ +

Multi-level sorting is supported so the order in which sort fields + are added to the query requests is relevant.

+ +

It is recommended to use Sort objects when possible.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + fieldName + + + <String> + + + + + + The field to be sorted by. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 source

+
+ + Object source ( includes, excludes ) + + +
Allows to control how the _source field is returned with every hit. + By default operations return the contents of the _source field + unless you have used the fields parameter or if the _source field + is disabled. Set the includes parameter to false to completely + disable returning the source field.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + includes + + + <String | Boolean | String[]> + + + + + + The field or list of fields to include as array. + Set to a boolean false to disable the source completely. +
+ + + + + excludes + + + <String | String[]> + + + + + + The optional field or list of fields to exclude. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 suggest

+
+ + Object suggest ( s ) + + +
Allows you to set the specified suggester on this request object. + Multiple suggesters can be set, all of which will be returned when + the search is executed. Global suggestion text can be set by + passing in a string vs. a Suggest object.

+ +
+
+ + + +
Since
+
elasticsearch 0.90
+ + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + s + + + <String | Suggest> + + + + + + A valid Suggest object or a String to + set as the global suggest text. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 timeout

+
+ + Object timeout ( t ) + + +
A timeout, bounding the request to be executed within the + specified time value and bail when expired. Defaults to no timeout. + +

This option is valid during the following operations: + search and delete by query


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + t + + + <Long> + + + + + + The timeout value in milliseconds. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +
Retrieves the internal query object. This is typically used by + internal API functions so use with caution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal object representation. + + + +
+ + + +
+ +
+
+
+ +

 trackScores

+
+ + Object trackScores ( trueFalse ) + + +
Enables score computation and tracking during sorting. Be default, + when sorting scores are not computed.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + If scores should be computed and tracked. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 version

+
+ + Object version ( trueFalse ) + + +
Enable/Disable returning version number for each search result.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + true to enable, false to disable +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.Rescore.html b/dist/docs/ejs.Rescore.html new file mode 100644 index 0000000..1f4f21e --- /dev/null +++ b/dist/docs/ejs.Rescore.html @@ -0,0 +1,809 @@ + + + + + elastic.js: Module: Rescore + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsRescore
+

+ +

A method that allows to rescore queries with a typically more expensive.

+
+ +
+

Module

+
+
+ +

 Rescore

+
+ + Rescore ( windowSize, windowSize ) + + +

Defines an operation that rescores a query with another query.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + windowSize + + + <Number> + + + + + + The optional number of documents to reorder per shard. +
+ + + + + windowSize + + + <Query> + + + + + + The optional query to use for rescoring. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
ObjectqueryWeight(weight)Sets the weight assigned to the original query of the rescoring.
ObjectrescoreQuery(someQuery)Sets the query used by the rescoring.
ObjectrescoreQueryWeight(weight)Sets the weight assigned to the query used to rescore the original query.
ObjectscoreMode(s)Sets the scoring mode. Valid values are: + + total - default mode, the scores combined + multiply - the scores multiplied + min - the lowest of the scores + max - the highest score + avg - the average of the scores
StringtoJSON()Retrieves the internal script object. This is typically used by + internal API functions so use with caution.
ObjectwindowSize(size)Sets the window_size parameter of the rescoring.
+
+ +

Method Detail

+ + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 queryWeight

+
+ + Object queryWeight ( weight ) + + +
Sets the weight assigned to the original query of the rescoring.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + weight + + + <Number> + + + + + + a valid query weight. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 rescoreQuery

+
+ + Object rescoreQuery ( someQuery ) + + +
Sets the query used by the rescoring.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + someQuery + + + <Query> + + + + + + a valid query. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 rescoreQueryWeight

+
+ + Object rescoreQueryWeight ( weight ) + + +
Sets the weight assigned to the query used to rescore the original query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + weight + + + <Number> + + + + + + a valid rescore query weight. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scoreMode

+
+ + Object scoreMode ( s ) + + +
Sets the scoring mode. Valid values are: + + total - default mode, the scores combined + multiply - the scores multiplied + min - the lowest of the scores + max - the highest score + avg - the average of the scores

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + s + + + <String> + + + + + + The score mode as a string. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +
Retrieves the internal script object. This is typically used by + internal API functions so use with caution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal object representation. + + + +
+ + + +
+ +
+
+
+ +

 windowSize

+
+ + Object windowSize ( size ) + + +
Sets the window_size parameter of the rescoring.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + size + + + <Number> + + + + + + a valid window size. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.ScoreFunction.html b/dist/docs/ejs.ScoreFunction.html new file mode 100644 index 0000000..c41110a --- /dev/null +++ b/dist/docs/ejs.ScoreFunction.html @@ -0,0 +1,526 @@ + + + + + elastic.js: Module: ScoreFunction + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsScoreFunction
+

+ +

A basic filter score function, which mathces a filter and applies a + weight.

+
+ +
+

Module

+
+
+ +

 ScoreFunction

+
+ + ScoreFunction ( ) + + +

Randomly score documents.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectfilter(oFilter)Adds a filter whose matching documents will have the score function applied.
StringtoJSON()

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.

Objectweight(oWeight)Sets the weight of the score function
+
+ +

Method Detail

+ + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 filter

+
+ + Object filter ( oFilter ) + + +
Adds a filter whose matching documents will have the score function applied.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + oFilter + + + <Filter> + + + + + + Any valid Filter object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal object. + + + +
+ + + +
+ +
+
+
+ +

 weight

+
+ + Object weight ( oWeight ) + + +
Sets the weight of the score function

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + oWeight + + + <Number> + + + + + + The weight of this score function. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.ScoreFunctionMixin.html b/dist/docs/ejs.ScoreFunctionMixin.html new file mode 100644 index 0000000..71be992 --- /dev/null +++ b/dist/docs/ejs.ScoreFunctionMixin.html @@ -0,0 +1,494 @@ + + + + + elastic.js: Mixin: ScoreFunctionMixin + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsScoreFunctionMixin
+

+ + +
+ +
+
+
+ + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectfilter(oFilter)Adds a filter whose matching documents will have the score function applied.
StringtoJSON()

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.

Objectweight(oWeight)Sets the weight of the score function
+
+ +

Method Detail

+ + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 filter

+
+ + Object filter ( oFilter ) + + +
Adds a filter whose matching documents will have the score function applied.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + oFilter + + + <Filter> + + + + + + Any valid Filter object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal object. + + + +
+ + + +
+ +
+
+
+ +

 weight

+
+ + Object weight ( oWeight ) + + +
Sets the weight of the score function

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + oWeight + + + <Number> + + + + + + The weight of this score function. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.ScriptField.html b/dist/docs/ejs.ScriptField.html new file mode 100644 index 0000000..8767bb1 --- /dev/null +++ b/dist/docs/ejs.ScriptField.html @@ -0,0 +1,710 @@ + + + + + elastic.js: Module: ScriptField + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsScriptField
+

+ +

ScriptField's allow you create dynamic fields on stored documents at query + time. For example, you might have a set of document thats containsthe fields + price and quantity. At query time, you could define a computed + property that dynamically creates a new field called totalin each document + based on the calculation price * quantity.

+
+ +
+

Module

+
+
+ +

 ScriptField

+
+ + ScriptField ( fieldName ) + + +

Computes dynamic document properties based on information from other fields.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + fieldName + + + <String> + + + + + + A name of the script field to create. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
ObjectignoreFailure(trueFalse)If execeptions thrown from the script should be ignored or not. + Default: false
Objectlang(language)The script language being used. Currently supported values are + javascript and mvel.
Objectparams(oParams)Allows you to set script parameters to be used during the execution of the script.
Objectscript(expression)Sets the script/code that will be used to perform the calculation.
StringtoJSON()Retrieves the internal script object. This is typically used by + internal API functions so use with caution.
+
+ +

Method Detail

+ + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 ignoreFailure

+
+ + Object ignoreFailure ( trueFalse ) + + +
If execeptions thrown from the script should be ignored or not. + Default: false

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + if execptions should be ignored +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 lang

+
+ + Object lang ( language ) + + +
The script language being used. Currently supported values are + javascript and mvel.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + language + + + <String> + + + + + + The language of the script. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 params

+
+ + Object params ( oParams ) + + +
Allows you to set script parameters to be used during the execution of the script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + oParams + + + <Object> + + + + + + An object containing key/value pairs representing param name/value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 script

+
+ + Object script ( expression ) + + +
Sets the script/code that will be used to perform the calculation.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + expression + + + <String> + + + + + + The script/code to use. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +
Retrieves the internal script object. This is typically used by + internal API functions so use with caution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal facet property. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.ScriptFilter.html b/dist/docs/ejs.ScriptFilter.html new file mode 100644 index 0000000..bd8fefc --- /dev/null +++ b/dist/docs/ejs.ScriptFilter.html @@ -0,0 +1,863 @@ + + + + + elastic.js: Module: ScriptFilter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsScriptFilter
+

+ +

A filter allowing to define scripts as filters

+
+ +
+

Module

+
+
+ +

 ScriptFilter

+
+ + ScriptFilter ( script ) + + +
A filter allowing to define scripts as filters.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + script + + + <String> + + + + + + The script as a string. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
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.
Objectlang(lang)Sets the script language.
Objectname(name)Sets the filter name.
Objectparams(p)Sets parameters that will be applied to the script. Overwrites + any existing params.
Objectscript(s)Sets the script.
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. + + + +
+ + + +
+ +
+
+
+ +

 lang

+
+ + Object lang ( lang ) + + +
Sets the script language.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + lang + + + <String> + + + + + + The script language, default mvel. +
+ + +
+ + + + + + +
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. + + + +
+ + + +
+ +
+
+
+ +

 params

+
+ + Object params ( p ) + + +
Sets parameters that will be applied to the script. Overwrites + any existing params.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + p + + + <Object> + + + + + + An object where the keys are the parameter name and + values are the parameter value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 script

+
+ + Object script ( s ) + + +
Sets the script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + s + + + <String> + + + + + + The script as a string. +
+ + +
+ + + + + + +
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

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.ScriptScoreFunction.html b/dist/docs/ejs.ScriptScoreFunction.html new file mode 100644 index 0000000..1f5e41e --- /dev/null +++ b/dist/docs/ejs.ScriptScoreFunction.html @@ -0,0 +1,770 @@ + + + + + elastic.js: Module: ScriptScoreFunction + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsScriptScoreFunction
+

+ +

The script_score function allows you to wrap another query and customize + the scoring of it optionally with a computation derived from other numeric + field values in the doc using a script expression.

+
+ +
+

Module

+
+
+ +

 ScriptScoreFunction

+
+ + ScriptScoreFunction ( ) + + +

Modify a documents score using a script.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectfilter(oFilter)Adds a filter whose matching documents will have the score function applied.
Objectlang(language)The script language being used.
Objectparams(p)Sets parameters that will be applied to the script. Overwrites + any existing params.
Objectscript(scriptCode)Set the script that will modify the score.
ObjectscriptId(scriptId)Set the script id that will modify the score.
StringtoJSON()

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.

+
+ +

Method Detail

+ + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 filter

+
+ + Object filter ( oFilter ) + + +
Adds a filter whose matching documents will have the score function applied.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + oFilter + + + <Filter> + + + + + + Any valid Filter object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 lang

+
+ + Object lang ( language ) + + +
The script language being used.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + language + + + <String> + + + + + + The language of the script. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 params

+
+ + Object params ( p ) + + +
Sets parameters that will be applied to the script. Overwrites + any existing params.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + p + + + <Object> + + + + + + An object where the keys are the parameter name and + values are the parameter value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 script

+
+ + Object script ( scriptCode ) + + +
Set the script that will modify the score.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptCode + + + <String> + + + + + + A valid script string to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scriptId

+
+ + Object scriptId ( scriptId ) + + +
Set the script id that will modify the score.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptId + + + <String> + + + + + + Id of an indexed script. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal object. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.ScriptedMetricAggregation.html b/dist/docs/ejs.ScriptedMetricAggregation.html new file mode 100644 index 0000000..1d70a21 --- /dev/null +++ b/dist/docs/ejs.ScriptedMetricAggregation.html @@ -0,0 +1,1746 @@ + + + + + elastic.js: Module: ScriptedMetricAggregation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsScriptedMetricAggregation
+

+ +

A metric aggregation that executes using scripts to provide a metric output.

+
+ +
+

Module

+
+
+ +

 ScriptedMetricAggregation

+
+ + ScriptedMetricAggregation ( name ) + + +

Aggregation that keeps track and returns the minimum value among numeric + values extracted from the aggregated documents.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + name + + + <String> + + + + + + The name which be used to refer to this aggregation. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
ObjectcombineScript(combineScript)

Sets the combine phase script.

ObjectcombineScriptFile(combine_script_file)

Sets the combine_script_file.

ObjectcombineScriptId(combine_script_id)

Sets the combine_script_id.

ObjectinitScript(initScript)

Sets the initialization script.

ObjectinitScriptFile(init_script_file)

Sets the init_script_file.

ObjectinitScriptId(init_script_id)

Sets the init_script_id.

Objectlang(language)The script language being used.
Objectlang(lang)

Set the scripting language used for this aggregation.

ObjectmapScript(mapScript)

Sets the map script. This is the only required script.

ObjectmapScriptFile(map_script_file)

Sets the map_script_file.

ObjectmapScriptId(map_script_id)

Sets the map_script_id.

Objectparams(p)Sets parameters that will be applied to the script. Overwrites + any existing params.
Objectparams(params)

Set parameters which will be passed to the init, map and combine scripts.

ObjectreduceParams(reduceParams)

Set parameters which will be passed to the reduce script.

ObjectreduceScript(reduceScript)

Sets the combine phase script.

ObjectreduceScriptFile(reduce_script_file)

Sets the reduce_script_file.

ObjectreduceScriptId(reduce_script_id)

Sets the reduce_script_id.

StringtoJSON()

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.

+
+ +

Method Detail

+ + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 combineScript

+
+ + Object combineScript ( combineScript ) + + +

Sets the combine phase script.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + combineScript + + + <String> + + + + + + The combine script. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 combineScriptFile

+
+ + Object combineScriptFile ( combine_script_file ) + + +

Sets the combine_script_file.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + combine_script_file + + + <String> + + + + + + A valid script file name. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 combineScriptId

+
+ + Object combineScriptId ( combine_script_id ) + + +

Sets the combine_script_id.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + combine_script_id + + + <String> + + + + + + A valid id from indexed script. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 initScript

+
+ + Object initScript ( initScript ) + + +

Sets the initialization script.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + initScript + + + <String> + + + + + + The initialization script +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 initScriptFile

+
+ + Object initScriptFile ( init_script_file ) + + +

Sets the init_script_file.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + init_script_file + + + <String> + + + + + + A valid script file name. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 initScriptId

+
+ + Object initScriptId ( init_script_id ) + + +

Sets the init_script_id.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + init_script_id + + + <String> + + + + + + A valid id from indexed script. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 lang

+
+ + Object lang ( language ) + + +
The script language being used.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + language + + + <String> + + + + + + The language of the script. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 lang

+
+ + Object lang ( lang ) + + +

Set the scripting language used for this aggregation.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + lang + + + <String> + + + + + + The script langauge. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 mapScript

+
+ + Object mapScript ( mapScript ) + + +

Sets the map script. This is the only required script.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + mapScript + + + <String> + + + + + + The map script. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 mapScriptFile

+
+ + Object mapScriptFile ( map_script_file ) + + +

Sets the map_script_file.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + map_script_file + + + <String> + + + + + + A valid script file name. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 mapScriptId

+
+ + Object mapScriptId ( map_script_id ) + + +

Sets the map_script_id.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + map_script_id + + + <String> + + + + + + A valid id from indexed script. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 params

+
+ + Object params ( p ) + + +
Sets parameters that will be applied to the script. Overwrites + any existing params.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + p + + + <Object> + + + + + + An object where the keys are the parameter name and + values are the parameter value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 params

+
+ + Object params ( params ) + + +

Set parameters which will be passed to the init, map and combine scripts.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + params + + + <String> + + + + + + Parameters passed to the init, map and combine scripts. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 reduceParams

+
+ + Object reduceParams ( reduceParams ) + + +

Set parameters which will be passed to the reduce script.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + reduceParams + + + <String> + + + + + + Paramters to pass to the recude script. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 reduceScript

+
+ + Object reduceScript ( reduceScript ) + + +

Sets the combine phase script.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + reduceScript + + + <String> + + + + + + The reduce script. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 reduceScriptFile

+
+ + Object reduceScriptFile ( reduce_script_file ) + + +

Sets the reduce_script_file.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + reduce_script_file + + + <String> + + + + + + A valid script file name. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 reduceScriptId

+
+ + Object reduceScriptId ( reduce_script_id ) + + +

Sets the reduce_script_id.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + reduce_script_id + + + <String> + + + + + + A valid id from indexed script. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal object. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.Shape.html b/dist/docs/ejs.Shape.html new file mode 100644 index 0000000..0a6e709 --- /dev/null +++ b/dist/docs/ejs.Shape.html @@ -0,0 +1,646 @@ + + + + + elastic.js: Module: Shape + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsShape
+

+ +

A Shape object that can be used in queries and filters that + take a Shape. Shape uses the GeoJSON format.

+ +

See http://www.geojson.org/

+
+ +
+

Module

+
+
+ +

 Shape

+
+ + Shape ( type, coords ) + + +

Defines a shape


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + type + + + <String> + + + + + + A valid shape type. +
+ + + + + coords + + + <Array> + + + + + + An valid coordinat definition for the given shape. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectcoordinates(c)Sets the coordinates for the shape definition. Note, the coordinates + are not validated in this api. Please see GeoJSON and ElasticSearch + documentation for correct coordinate definitions.
Objectradius(r)Sets the radius for parsing a circle Shape.
StringtoJSON()Retrieves the internal script object. This is typically used by + internal API functions so use with caution.
Objecttype(t)Sets the shape type. Can be set to one of: point, linestring, polygon, + multipoint, envelope, or multipolygon.
+
+ +

Method Detail

+ + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 coordinates

+
+ + Object coordinates ( c ) + + +
Sets the coordinates for the shape definition. Note, the coordinates + are not validated in this api. Please see GeoJSON and ElasticSearch + documentation for correct coordinate definitions.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + c + + + <Array> + + + + + + a valid coordinates definition for the shape. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 radius

+
+ + Object radius ( r ) + + +
Sets the radius for parsing a circle Shape.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + r + + + <String> + + + + + + a valid radius value for a circle. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +
Retrieves the internal script object. This is typically used by + internal API functions so use with caution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal object representation. + + + +
+ + + +
+ +
+
+
+ +

 type

+
+ + Object type ( t ) + + +
Sets the shape type. Can be set to one of: point, linestring, polygon, + multipoint, envelope, or multipolygon.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + t + + + <String> + + + + + + a valid shape type. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.SignificantTermsAggregation.html b/dist/docs/ejs.SignificantTermsAggregation.html new file mode 100644 index 0000000..859efbf --- /dev/null +++ b/dist/docs/ejs.SignificantTermsAggregation.html @@ -0,0 +1,1250 @@ + + + + + elastic.js: Module: SignificantTermsAggregation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsSignificantTermsAggregation
+

+ +

An aggregation that returns interesting or unusual occurrences of terms in + a set.

+
+ +
+

Module

+
+
+ +

 SignificantTermsAggregation

+
+ + SignificantTermsAggregation ( name ) + + +

An aggregation that returns interesting or unusual occurrences of terms in + a set.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + name + + + <String> + + + + + + The name which be used to refer to this aggregation. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectagg(agg)Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method.
Objectaggregation(agg)Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation.
Objectexclude(exclude,flags)

Allows you to filter out unwanted facet entries using a regular + expression. You can also optionally pass in a set of flags to apply + to the regular expression. Valid flags are: CASE_INSENSITIVE, + MULTILINE, DOTALL, UNICODE_CASE, CANON_EQ, UNIX_LINES, LITERAL, + COMMENTS, and UNICODE_CHAR_CLASS. Separate multiple flags with a | + character.

ObjectexecutionHint(h)Sets the execution hint determines how the aggregation is computed. + Supported values are: map and ordinals.
Objectfield(field)

Sets the field to gather terms from.

Objectformat(f)Sets the format expression for the terms. Use for number or date + formatting.
Objectinclude(include,flags)

Allows you to allow only specific entries using a regular + expression. You can also optionally pass in a set of flags to apply + to the regular expression. Valid flags are: CASE_INSENSITIVE, + MULTILINE, DOTALL, UNICODE_CASE, CANON_EQ, UNIX_LINES, LITERAL, + COMMENTS, and UNICODE_CHAR_CLASS. Separate multiple flags with a | + character.

ObjectminDocCount(num)Only return terms that match more than a configured number of hits.
ObjectshardSize(shardSize)Determines how many terms the coordinating node will request from + each shard.
Objectsize(size)Sets the number of aggregation entries that will be returned.
StringtoJSON()

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.

+
+ +

Method Detail

+ + + + + + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 agg

+
+ + Object agg ( agg ) + + +
Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + agg + + + <Aggregation> + + + + + + Any valid Aggregation object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 aggregation

+
+ + Object aggregation ( agg ) + + +
Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + agg + + + <Aggregation> + + + + + + Any valid Aggregation object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 exclude

+
+ + Object exclude ( exclude, flags ) + + +

Allows you to filter out unwanted facet entries using a regular + expression. You can also optionally pass in a set of flags to apply + to the regular expression. Valid flags are: CASE_INSENSITIVE, + MULTILINE, DOTALL, UNICODE_CASE, CANON_EQ, UNIX_LINES, LITERAL, + COMMENTS, and UNICODE_CHAR_CLASS. Separate multiple flags with a | + character.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + exclude + + + <String> + + + + + + A regular expression exclude string +
+ + + + + flags + + + <String> + + + + + + Optional regular expression flags.. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 executionHint

+
+ + Object executionHint ( h ) + + +
Sets the execution hint determines how the aggregation is computed. + Supported values are: map and ordinals.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + h + + + <String> + + + + + + The hint value as a string. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( field ) + + +

Sets the field to gather terms from.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + field + + + <String> + + + + + + a valid field name.. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 format

+
+ + Object format ( f ) + + +
Sets the format expression for the terms. Use for number or date + formatting.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + f + + + <String> + + + + + + the format string +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 include

+
+ + Object include ( include, flags ) + + +

Allows you to allow only specific entries using a regular + expression. You can also optionally pass in a set of flags to apply + to the regular expression. Valid flags are: CASE_INSENSITIVE, + MULTILINE, DOTALL, UNICODE_CASE, CANON_EQ, UNIX_LINES, LITERAL, + COMMENTS, and UNICODE_CHAR_CLASS. Separate multiple flags with a | + character.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + include + + + <String> + + + + + + A regular expression include string +
+ + + + + flags + + + <String> + + + + + + Optional regular expression flags.. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 minDocCount

+
+ + Object minDocCount ( num ) + + +
Only return terms that match more than a configured number of hits.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + num + + + <Integer> + + + + + + The numer of minimum number of hits. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 shardSize

+
+ + Object shardSize ( shardSize ) + + +
Determines how many terms the coordinating node will request from + each shard.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + shardSize + + + <Integer> + + + + + + The numer of terms to fetch from each shard. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 size

+
+ + Object size ( size ) + + +
Sets the number of aggregation entries that will be returned.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + size + + + <Integer> + + + + + + The numer of aggregation entries to be returned. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal object. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.Sort.html b/dist/docs/ejs.Sort.html new file mode 100644 index 0000000..75988d1 --- /dev/null +++ b/dist/docs/ejs.Sort.html @@ -0,0 +1,1920 @@ + + + + + elastic.js: Module: Sort + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsSort
+

+ +

A Sort object that can be used in on the Request object to specify + various types of sorting.

+ +

See http://www.elasticsearch.org/guide/reference/api/search/sort.html

+
+ +
+

Module

+
+
+ +

 Sort

+
+ + Sort ( fieldName ) + + +

Defines a sort value


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + fieldName + + + <String> + + + + + + The fieldName to sort against. Defaults to _score + if not specified. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectasc()Sets the sort order to ascending (asc). Same as calling + order('asc').
Objectdesc()Sets the sort order to descending (desc). Same as calling + order('desc').
ObjectdistanceType(type)How to compute the distance. Can either be arc (better precision) + or plane (faster). Defaults to arc. + + Valid during sort types: geo distance
Objectfield(f)Set's the field to sort on
ObjectgeoDistance(point)Enables sorting based on a distance from a GeoPoint
ObjectignoreUnmapped(trueFalse)Sets if the sort should ignore unmapped fields vs throwing an error. + + Valid during sort types: field
Objectlang(lang)Sets the script language. + + Valid during sort types: script
Objectmissing(m)Sets the value to use for missing fields. Valid values are: + + _last - to put documents with the field missing last + _first - to put documents with the field missing first + {String} - any string value to use as the sort value. + + Valid during sort types: field
Objectmode(m)Sets the sort mode. Valid values are: + +
+
min - sort by lowest value
+
max - sort by highest value
+
sum - sort by the sum of all values
+
avg - sort by the average of all values
+
+ + Valid during sort types: field, geo distance
ObjectnestedFilter(oFilter)

Allows you to set a filter that nested objects must match + in order to be considered during sorting.

+ + Valid during sort types: field, geo distance
ObjectnestedPath(path)Sets the path of the nested object. + + Valid during sort types: field, geo distance
Objectnormalize(trueFalse)If the lat/long points should be normalized to lie within their + respective normalized ranges. + + Normalized ranges are: + lon = -180 (exclusive) to 180 (inclusive) range + lat = -90 to 90 (both inclusive) range + + Valid during sort types: geo distance
Objectorder(o)Sets the sort order. Valid values are: + + asc - for ascending order + desc - for descending order + + Valid during sort types: field, geo distance, and script
Objectparams(p)Sets parameters that will be applied to the script. Overwrites + any existing params. + + Valid during sort types: script
Objectreverse(trueFalse)Sets the order with a boolean value. + + true = descending sort order + false = ascending sort order + + Valid during sort types: field, geo distance, and script
Objectscript(scriptCode)Enables sorting based on a script.
StringtoJSON()Retrieves the internal script object. This is typically used by + internal API functions so use with caution.
Objecttype(type)Sets the script sort type. Valid values are: + +
+
string - script return value is sorted as a string
+
number - script return value is sorted as a number
+
+ + Valid during sort types: script
Objectunit(unit)Sets the distance unit. Valid values are "mi" for miles or "km" + for kilometers. Defaults to "km". + + Valid during sort types: geo distance
+
+ +

Method Detail

+ + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 asc

+
+ + Object asc ( ) + + +
Sets the sort order to ascending (asc). Same as calling + order('asc').

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 desc

+
+ + Object desc ( ) + + +
Sets the sort order to descending (desc). Same as calling + order('desc').

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 distanceType

+
+ + Object distanceType ( type ) + + +
How to compute the distance. Can either be arc (better precision) + or plane (faster). Defaults to arc. + + Valid during sort types: geo distance

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + type + + + <String> + + + + + + The execution type as a string. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( f ) + + +
Set's the field to sort on

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + f + + + <String> + + + + + + The name of a field +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 geoDistance

+
+ + Object geoDistance ( point ) + + +
Enables sorting based on a distance from a GeoPoint

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + point + + + <GeoPoint> + + + + + + A valid GeoPoint object +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 ignoreUnmapped

+
+ + Object ignoreUnmapped ( trueFalse ) + + +
Sets if the sort should ignore unmapped fields vs throwing an error. + + Valid during sort types: field

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + If sort should ignore unmapped fields. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 lang

+
+ + Object lang ( lang ) + + +
Sets the script language. + + Valid during sort types: script

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + lang + + + <String> + + + + + + The script language, default mvel. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 missing

+
+ + Object missing ( m ) + + +
Sets the value to use for missing fields. Valid values are: + + _last - to put documents with the field missing last + _first - to put documents with the field missing first + {String} - any string value to use as the sort value. + + Valid during sort types: field

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + m + + + <String> + + + + + + The value to use for documents with the field missing. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 mode

+
+ + Object mode ( m ) + + +
Sets the sort mode. Valid values are: + +
+
min - sort by lowest value
+
max - sort by highest value
+
sum - sort by the sum of all values
+
avg - sort by the average of all values
+
+ + Valid during sort types: field, geo distance

+ +
+
+ + + +
Since
+
elasticsearch 0.90
+ + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + m + + + <String> + + + + + + The sort mode. Either min, max, sum, or avg. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 nestedFilter

+
+ + Object nestedFilter ( oFilter ) + + +

Allows you to set a filter that nested objects must match + in order to be considered during sorting.

+ + Valid during sort types: field, geo distance

+ +
+
+ + + +
Since
+
elasticsearch 0.90
+ + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + oFilter + + + <Object> + + + + + + A valid Filter object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 nestedPath

+
+ + Object nestedPath ( path ) + + +
Sets the path of the nested object. + + Valid during sort types: field, geo distance

+ +
+
+ + + +
Since
+
elasticsearch 0.90
+ + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + path + + + <String> + + + + + + The nested path value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 normalize

+
+ + Object normalize ( trueFalse ) + + +
If the lat/long points should be normalized to lie within their + respective normalized ranges. + + Normalized ranges are: + lon = -180 (exclusive) to 180 (inclusive) range + lat = -90 to 90 (both inclusive) range + + Valid during sort types: geo distance

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <String> + + + + + + True if the coordinates should be normalized. False otherwise. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 order

+
+ + Object order ( o ) + + +
Sets the sort order. Valid values are: + + asc - for ascending order + desc - for descending order + + Valid during sort types: field, geo distance, and script

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + o + + + <String> + + + + + + The sort order as a string, asc or desc. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 params

+
+ + Object params ( p ) + + +
Sets parameters that will be applied to the script. Overwrites + any existing params. + + Valid during sort types: script

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + p + + + <Object> + + + + + + An object where the keys are the parameter name and + values are the parameter value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 reverse

+
+ + Object reverse ( trueFalse ) + + +
Sets the order with a boolean value. + + true = descending sort order + false = ascending sort order + + Valid during sort types: field, geo distance, and script

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + If sort should be in reverse order. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 script

+
+ + Object script ( scriptCode ) + + +
Enables sorting based on a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptCode + + + <String> + + + + + + The script code as a string +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +
Retrieves the internal script object. This is typically used by + internal API functions so use with caution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal object representation. + + + +
+ + + +
+ +
+
+
+ +

 type

+
+ + Object type ( type ) + + +
Sets the script sort type. Valid values are: + +
+
string - script return value is sorted as a string
+
number - script return value is sorted as a number
+
+ + Valid during sort types: script

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + type + + + <String> + + + + + + The sort type. Either string or number. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 unit

+
+ + Object unit ( unit ) + + +
Sets the distance unit. Valid values are "mi" for miles or "km" + for kilometers. Defaults to "km". + + Valid during sort types: geo distance

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + unit + + + <Number> + + + + + + the unit of distance measure. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.SpanFirstQuery.html b/dist/docs/ejs.SpanFirstQuery.html new file mode 100644 index 0000000..755f010 --- /dev/null +++ b/dist/docs/ejs.SpanFirstQuery.html @@ -0,0 +1,639 @@ + + + + + elastic.js: Module: SpanFirstQuery + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsSpanFirstQuery
+

+ +

Matches spans near the beginning of a field. The spanFirstQuery allows you to search + for Spans that start and end within the first n positions of the document. + The span first query maps to Lucene SpanFirstQuery.

+
+ +
+

Module

+
+
+ +

 SpanFirstQuery

+
+ + SpanFirstQuery ( spanQry, end ) + + +
Matches spans near the beginning of a field.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + spanQry + + + <Query> + + + + + + A valid SpanQuery +
+ + + + + end + + + <Integer> + + + + + + the maximum end position in a match. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectboost(boost)Sets the boost value for documents matching the Query.
Objectend(position)Sets the maximum end position permitted in a match.
Objectmatch(spanQuery)Sets the span query to match on.
StringtoJSON()Retrieves the internal query object. This is typically used by + internal API functions so use with caution.
+
+ +

Method Detail

+ + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 boost

+
+ + Object boost ( boost ) + + +
Sets the boost value for documents matching the Query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + boost + + + <Double> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 end

+
+ + Object end ( position ) + + +
Sets the maximum end position permitted in a match.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + position + + + <Number> + + + + + + The maximum position length to consider. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 match

+
+ + Object match ( spanQuery ) + + +
Sets the span query to match on.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + spanQuery + + + <Object> + + + + + + Any valid span type query. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +
Retrieves the internal query object. This is typically used by + internal API functions so use with caution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal query property. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.SpanMultiTermQuery.html b/dist/docs/ejs.SpanMultiTermQuery.html new file mode 100644 index 0000000..f79a324 --- /dev/null +++ b/dist/docs/ejs.SpanMultiTermQuery.html @@ -0,0 +1,544 @@ + + + + + elastic.js: Module: SpanMultiTermQuery + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsSpanMultiTermQuery
+

+ +

Wraps lucene MultiTermQueries as a SpanQuery so it can be used in the + various Span* queries. Examples of valid MultiTermQueries are + Fuzzy, NumericRange, Prefix, Regex, Range, and Wildcard.

+
+ +
+

Module

+
+
+ +

 SpanMultiTermQuery

+
+ + SpanMultiTermQuery ( qry ) + + +
Use MultiTermQueries as a SpanQuery.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + qry + + + <Query> + + + + + + An optional multi-term query object. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectboost(boost)Sets the boost value for documents matching the Query.
Objectmatch(mtQuery)Sets the span query to match on.
StringtoJSON()Retrieves the internal query object. This is typically used by + internal API functions so use with caution.
+
+ +

Method Detail

+ + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 boost

+
+ + Object boost ( boost ) + + +
Sets the boost value for documents matching the Query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + boost + + + <Double> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 match

+
+ + Object match ( mtQuery ) + + +
Sets the span query to match on.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + mtQuery + + + <Object> + + + + + + Any valid multi-term query. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +
Retrieves the internal query object. This is typically used by + internal API functions so use with caution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal query property. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.SpanNearQuery.html b/dist/docs/ejs.SpanNearQuery.html new file mode 100644 index 0000000..4f7f401 --- /dev/null +++ b/dist/docs/ejs.SpanNearQuery.html @@ -0,0 +1,804 @@ + + + + + elastic.js: Module: SpanNearQuery + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsSpanNearQuery
+

+ +

A spanNearQuery will look to find a number of spanQuerys within a given + distance from each other.

+
+ +
+

Module

+
+
+ +

 SpanNearQuery

+
+ + SpanNearQuery ( clauses, slop ) + + +
Matches spans which are near one another.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + clauses + + + <Query | Query[]> + + + + + + A single SpanQuery or array of SpanQueries +
+ + + + + slop + + + <Integer> + + + + + + The number of intervening unmatched positions +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectboost(boost)Sets the boost value for documents matching the Query.
Objectclauses(clauses)Sets the clauses used. If passed a single SpanQuery, it is added + to the existing list of clauses. If passed an array of + SpanQueries, they replace any existing clauses.
ObjectcollectPayloads(trueFalse)Sets whether or not payloads are being used. A payload is an arbitrary + byte array stored at a specific position (i.e. token/term).
ObjectinOrder(trueFalse)Sets whether or not matches are required to be in-order.
Objectslop(distance)Sets the maximum number of intervening unmatched positions.
StringtoJSON()Retrieves the internal query object. This is typically used by + internal API functions so use with caution.
+
+ +

Method Detail

+ + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 boost

+
+ + Object boost ( boost ) + + +
Sets the boost value for documents matching the Query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + boost + + + <Double> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 clauses

+
+ + Object clauses ( clauses ) + + +
Sets the clauses used. If passed a single SpanQuery, it is added + to the existing list of clauses. If passed an array of + SpanQueries, they replace any existing clauses.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + clauses + + + <Query | Query[]> + + + + + + A SpanQuery or array of SpanQueries. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 collectPayloads

+
+ + Object collectPayloads ( trueFalse ) + + +
Sets whether or not payloads are being used. A payload is an arbitrary + byte array stored at a specific position (i.e. token/term).

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + Whether or not to return payloads. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 inOrder

+
+ + Object inOrder ( trueFalse ) + + +
Sets whether or not matches are required to be in-order.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + Determines if matches must be in-order. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 slop

+
+ + Object slop ( distance ) + + +
Sets the maximum number of intervening unmatched positions.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + distance + + + <Number> + + + + + + The number of intervening unmatched positions. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +
Retrieves the internal query object. This is typically used by + internal API functions so use with caution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal query property. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.SpanNotQuery.html b/dist/docs/ejs.SpanNotQuery.html new file mode 100644 index 0000000..ca0e569 --- /dev/null +++ b/dist/docs/ejs.SpanNotQuery.html @@ -0,0 +1,638 @@ + + + + + elastic.js: Module: SpanNotQuery + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsSpanNotQuery
+

+ +

Removes matches which overlap with another span query. + The span not query maps to Lucene SpanNotQuery.

+
+ +
+

Module

+
+
+ +

 SpanNotQuery

+
+ + SpanNotQuery ( includeQry, excludeQry ) + + +
Removes matches which overlap with another span query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + includeQry + + + <Query> + + + + + + a valid SpanQuery whose matching docs will be returned. +
+ + + + + excludeQry + + + <Query> + + + + + + a valid SpanQuery whose matching docs will not be returned +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectboost(boost)Sets the boost value for documents matching the Query.
Objectexclude(spanQuery)Sets the span query whose matches must not overlap those returned.
Objectinclude(spanQuery)Set the span query whose matches are filtered.
StringtoJSON()Retrieves the internal query object. This is typically used by + internal API functions so use with caution.
+
+ +

Method Detail

+ + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 boost

+
+ + Object boost ( boost ) + + +
Sets the boost value for documents matching the Query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + boost + + + <Double> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 exclude

+
+ + Object exclude ( spanQuery ) + + +
Sets the span query whose matches must not overlap those returned.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + spanQuery + + + <Object> + + + + + + Any valid span type query. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 include

+
+ + Object include ( spanQuery ) + + +
Set the span query whose matches are filtered.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + spanQuery + + + <Object> + + + + + + Any valid span type query. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +
Retrieves the internal query object. This is typically used by + internal API functions so use with caution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal query property. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.SpanOrQuery.html b/dist/docs/ejs.SpanOrQuery.html new file mode 100644 index 0000000..6e89323 --- /dev/null +++ b/dist/docs/ejs.SpanOrQuery.html @@ -0,0 +1,547 @@ + + + + + elastic.js: Module: SpanOrQuery + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsSpanOrQuery
+

+ +

The spanOrQuery takes an array of SpanQuerys and will match if any of the + underlying SpanQueries match. The span or query maps to Lucene SpanOrQuery.

+
+ +
+

Module

+
+
+ +

 SpanOrQuery

+
+ + SpanOrQuery ( clauses ) + + +
Matches the union of its span clauses.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + clauses + + + <Object> + + + + + + A single SpanQuery or array of SpanQueries. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectboost(boost)Sets the boost value for documents matching the Query.
Objectclauses(clauses)Sets the clauses used. If passed a single SpanQuery, it is added + to the existing list of clauses. If passed an array of + SpanQueries, they replace any existing clauses.
StringtoJSON()Retrieves the internal query object. This is typically used by + internal API functions so use with caution.
+
+ +

Method Detail

+ + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 boost

+
+ + Object boost ( boost ) + + +
Sets the boost value for documents matching the Query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + boost + + + <Double> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 clauses

+
+ + Object clauses ( clauses ) + + +
Sets the clauses used. If passed a single SpanQuery, it is added + to the existing list of clauses. If passed an array of + SpanQueries, they replace any existing clauses.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + clauses + + + <Query | Query[]> + + + + + + A SpanQuery or array of SpanQueries. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +
Retrieves the internal query object. This is typically used by + internal API functions so use with caution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal query property. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.SpanTermQuery.html b/dist/docs/ejs.SpanTermQuery.html new file mode 100644 index 0000000..23ad9df --- /dev/null +++ b/dist/docs/ejs.SpanTermQuery.html @@ -0,0 +1,639 @@ + + + + + elastic.js: Module: SpanTermQuery + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsSpanTermQuery
+

+ +

A spanTermQuery is the basic unit of Lucene's Span Query which allows for nested, + positional restrictions when matching documents. The spanTermQuery simply matches + spans containing a term. It's essentially a termQuery with positional information asscoaited.

+
+ +
+

Module

+
+
+ +

 SpanTermQuery

+
+ + SpanTermQuery ( field, value ) + + +
Matches spans containing a term

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + field + + + <String> + + + + + + the document field/field to query against +
+ + + + + value + + + <String> + + + + + + the literal value to be matched +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectboost(boost)Sets the boost value for documents matching the Query.
Objectfield(f)Sets the field to query against.
Objectterm(t)Sets the term.
StringtoJSON()Retrieves the internal query object. This is typically used by + internal API functions so use with caution.
+
+ +

Method Detail

+ + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 boost

+
+ + Object boost ( boost ) + + +
Sets the boost value for documents matching the Query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + boost + + + <Double> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( f ) + + +
Sets the field to query against.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + f + + + <String> + + + + + + A valid field name. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 term

+
+ + Object term ( t ) + + +
Sets the term.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + t + + + <String> + + + + + + A single term. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +
Retrieves the internal query object. This is typically used by + internal API functions so use with caution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal query property. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.StatisticalFacet.html b/dist/docs/ejs.StatisticalFacet.html new file mode 100644 index 0000000..24bf559 --- /dev/null +++ b/dist/docs/ejs.StatisticalFacet.html @@ -0,0 +1,1298 @@ + + + + + elastic.js: Module: StatisticalFacet + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsStatisticalFacet
+

+ +

A statistical facet allows you to compute statistical data over a numeric fields. Statistical data includes + the count, total, sum of squares, mean (average), minimum, maximum, variance, and standard deviation.

+ +

Facets are similar to SQL GROUP BY statements but perform much + better. You can also construct several "groups" at once by simply + specifying multiple facets.

+ +
+

+ Tip: + For more information on faceted navigation, see + this + Wikipedia article on Faceted Classification. +

+

+
+ +
+

Module

+
+
+ +

 StatisticalFacet

+
+ + StatisticalFacet ( name ) + + +

A facet which returns statistical information about a numeric field


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + name + + + <String> + + + + + + The name which be used to refer to this facet. For instance, + the facet itself might utilize a field named doc_authors. Setting + name to Authors would allow you to refer to the + facet by that name, possibly simplifying some of the display logic. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
ObjectcacheFilter(trueFalse)

Enables caching of the facetFilter

ObjectfacetFilter(oFilter)

Allows you to reduce the documents used for computing facet results.

Objectfield(fieldName)Sets the field to be used to construct the this facet.
Objectfields(aFieldName)Aggregate statistical info across a set of fields.
Objectglobal(trueFalse)

Computes values across the entire index

Objectlang(language)The script language being used. Currently supported values are + javascript, groovy, and mvel.
Objectmode(m)

Sets the mode the facet will use.

+ +

+
collector
+
post
+
Objectnested(path)

Sets the path to the nested document if faceting against a + nested field.

Objectparams(oParams)Allows you to set script parameters to be used during the execution of the script.
Objectscope(scope)

Computes values across the the specified scope

Objectscript(code)Define a script to evaluate of which the result will be used to generate + the statistical information.
StringtoJSON()

Retrieves the internal facet object. This is typically used by + internal API functions so use with caution.

+
+ +

Method Detail

+ + + + + + + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 cacheFilter

+
+ + Object cacheFilter ( trueFalse ) + + +

Enables caching of the facetFilter


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + If the facetFilter should be cached or not +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 facetFilter

+
+ + Object facetFilter ( oFilter ) + + +

Allows you to reduce the documents used for computing facet results.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + oFilter + + + <Object> + + + + + + A valid Filter object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( fieldName ) + + +
Sets the field to be used to construct the this facet.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + fieldName + + + <String> + + + + + + The field name whose data will be used to construct the facet. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 fields

+
+ + Object fields ( aFieldName ) + + +
Aggregate statistical info across a set of fields.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + aFieldName + + + <Array> + + + + + + An array of field names. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 global

+
+ + Object global ( trueFalse ) + + +

Computes values across the entire index


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + Calculate facet counts globally or not. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 lang

+
+ + Object lang ( language ) + + +
The script language being used. Currently supported values are + javascript, groovy, and mvel.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + language + + + <String> + + + + + + The language of the script. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 mode

+
+ + Object mode ( m ) + + +

Sets the mode the facet will use.

+ +

+
collector
+
post
+

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + m + + + <String> + + + + + + The mode: collector or post. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 nested

+
+ + Object nested ( path ) + + +

Sets the path to the nested document if faceting against a + nested field.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + path + + + <String> + + + + + + The nested path +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 params

+
+ + Object params ( oParams ) + + +
Allows you to set script parameters to be used during the execution of the script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + oParams + + + <Object> + + + + + + An object containing key/value pairs representing param name/value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scope

+
+ + Object scope ( scope ) + + +

Computes values across the the specified scope


+ +
+
+ + + + + +
Deprecated
since elasticsearch 0.90
+ + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scope + + + <String> + + + + + + The scope name to calculate facet counts with. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 script

+
+ + Object script ( code ) + + +
Define a script to evaluate of which the result will be used to generate + the statistical information.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + code + + + <String> + + + + + + The script code to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal facet object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal facet property. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.StatsAggregation.html b/dist/docs/ejs.StatsAggregation.html new file mode 100644 index 0000000..f0bb538 --- /dev/null +++ b/dist/docs/ejs.StatsAggregation.html @@ -0,0 +1,871 @@ + + + + + elastic.js: Module: StatsAggregation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsStatsAggregation
+

+ +

A multi-value metrics aggregation that computes stats over numeric values + extracted from the aggregated documents. These values can be extracted either + from specific numeric fields in the documents, or be generated by a provided + script.

+ +

The stats that are returned consist of: min, max, sum, count and avg.

+
+ +
+

Module

+
+
+ +

 StatsAggregation

+
+ + StatsAggregation ( name ) + + +

Aggregation that computes stats over numeric values extracted from the + aggregated documents.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + name + + + <String> + + + + + + The name which be used to refer to this aggregation. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectfield(field)

Sets the field to operate on.

Objectlang(language)The script language being used.
Objectparams(p)Sets parameters that will be applied to the script. Overwrites + any existing params.
Objectscript(scriptCode)Allows you generate or modify the terms/values using a script.
ObjectscriptFile(scriptFile)Allows you generate or modify the terms/values using a script.
ObjectscriptId(scriptId)Allows you generate or modify the terms/values using a script.
StringtoJSON()

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.

+
+ +

Method Detail

+ + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( field ) + + +

Sets the field to operate on.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + field + + + <String> + + + + + + a valid field name.. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 lang

+
+ + Object lang ( language ) + + +
The script language being used.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + language + + + <String> + + + + + + The language of the script. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 params

+
+ + Object params ( p ) + + +
Sets parameters that will be applied to the script. Overwrites + any existing params.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + p + + + <Object> + + + + + + An object where the keys are the parameter name and + values are the parameter value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 script

+
+ + Object script ( scriptCode ) + + +
Allows you generate or modify the terms/values using a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptCode + + + <String> + + + + + + A valid script string to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scriptFile

+
+ + Object scriptFile ( scriptFile ) + + +
Allows you generate or modify the terms/values using a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptFile + + + <String> + + + + + + A valid script file to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scriptId

+
+ + Object scriptId ( scriptId ) + + +
Allows you generate or modify the terms/values using a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptId + + + <String> + + + + + + A valid script id to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal object. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.SuggestContextMixin.html b/dist/docs/ejs.SuggestContextMixin.html new file mode 100644 index 0000000..7125bc4 --- /dev/null +++ b/dist/docs/ejs.SuggestContextMixin.html @@ -0,0 +1,528 @@ + + + + + elastic.js: Mixin: SuggestContextMixin + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsSuggestContextMixin
+

+ + +
+ +
+
+
+ + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
Objectanalyzer(analyzer)

Sets analyzer used to analyze the suggest text.

Objectfield(field)

Sets the field used to generate suggestions from.

ObjectshardSize(s)

Sets the maximum number of suggestions to be retrieved from + each individual shard.

Objectsize(s)

Sets the number of suggestions returned for each token.

+
+ +

Method Detail

+ + + + + + + + + +
+
+ +

 analyzer

+
+ + Object analyzer ( analyzer ) + + +

Sets analyzer used to analyze the suggest text.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + analyzer + + + <String> + + + + + + A valid analyzer name. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( field ) + + +

Sets the field used to generate suggestions from.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + field + + + <String> + + + + + + A valid field name. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 shardSize

+
+ + Object shardSize ( s ) + + +

Sets the maximum number of suggestions to be retrieved from + each individual shard.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + s + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 size

+
+ + Object size ( s ) + + +

Sets the number of suggestions returned for each token.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + s + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.SuggesterMixin.html b/dist/docs/ejs.SuggesterMixin.html new file mode 100644 index 0000000..5d51ad8 --- /dev/null +++ b/dist/docs/ejs.SuggesterMixin.html @@ -0,0 +1,416 @@ + + + + + elastic.js: Mixin: SuggesterMixin + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsSuggesterMixin
+

+ + +
+ +
+
+
+ + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objecttext(txt)

Sets the text to get suggestions for. If not set, the global + suggestion text will be used.

StringtoJSON()

Retrieves the internal suggest object. This is typically used by + internal API functions so use with caution.

+
+ +

Method Detail

+ + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 text

+
+ + Object text ( txt ) + + +

Sets the text to get suggestions for. If not set, the global + suggestion text will be used.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + txt + + + <String> + + + + + + A string to get suggestions for. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal suggest object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal suggest property. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.SumAggregation.html b/dist/docs/ejs.SumAggregation.html new file mode 100644 index 0000000..99f20c9 --- /dev/null +++ b/dist/docs/ejs.SumAggregation.html @@ -0,0 +1,869 @@ + + + + + elastic.js: Module: SumAggregation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsSumAggregation
+

+ +

A single-value metrics aggregation that sums up numeric values that are + extracted from the aggregated documents. These values can be extracted either + from specific numeric fields in the documents, or be generated by a + provided script.

+
+ +
+

Module

+
+
+ +

 SumAggregation

+
+ + SumAggregation ( name ) + + +

Aggregation that sums up numeric values that are extracted from the + aggregated documents.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + name + + + <String> + + + + + + The name which be used to refer to this aggregation. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectfield(field)

Sets the field to operate on.

Objectlang(language)The script language being used.
Objectparams(p)Sets parameters that will be applied to the script. Overwrites + any existing params.
Objectscript(scriptCode)Allows you generate or modify the terms/values using a script.
ObjectscriptFile(scriptFile)Allows you generate or modify the terms/values using a script.
ObjectscriptId(scriptId)Allows you generate or modify the terms/values using a script.
StringtoJSON()

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.

+
+ +

Method Detail

+ + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( field ) + + +

Sets the field to operate on.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + field + + + <String> + + + + + + a valid field name.. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 lang

+
+ + Object lang ( language ) + + +
The script language being used.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + language + + + <String> + + + + + + The language of the script. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 params

+
+ + Object params ( p ) + + +
Sets parameters that will be applied to the script. Overwrites + any existing params.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + p + + + <Object> + + + + + + An object where the keys are the parameter name and + values are the parameter value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 script

+
+ + Object script ( scriptCode ) + + +
Allows you generate or modify the terms/values using a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptCode + + + <String> + + + + + + A valid script string to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scriptFile

+
+ + Object scriptFile ( scriptFile ) + + +
Allows you generate or modify the terms/values using a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptFile + + + <String> + + + + + + A valid script file to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scriptId

+
+ + Object scriptId ( scriptId ) + + +
Allows you generate or modify the terms/values using a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptId + + + <String> + + + + + + A valid script id to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal object. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.TermFilter.html b/dist/docs/ejs.TermFilter.html new file mode 100644 index 0000000..4c8060a --- /dev/null +++ b/dist/docs/ejs.TermFilter.html @@ -0,0 +1,788 @@ + + + + + elastic.js: Module: TermFilter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsTermFilter
+

+ +

Constructs a filter for docs matching any of the terms added to this + object. Unlike a RangeFilter this can be used for filtering on multiple + terms that are not necessarily in a sequence.

+
+ +
+

Module

+
+
+ +

 TermFilter

+
+ + TermFilter ( fieldName, term ) + + +
Constructs a filter for docs matching the term added to this object.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + fieldName + + + <string> + + + + + + The document field/fieldName to execute the filter against. +
+ + + + + term + + + <string> + + + + + + The literal term used to filter the results. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
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(f)Provides access to the filter fieldName used to construct the + termFilter object.
Objectname(name)Sets the filter name.
Objectterm()Provides access to the filter term used to construct the + termFilter object.
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 ( f ) + + +
Provides access to the filter fieldName used to construct the + termFilter object.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + f + + + <String> + + + + + + the fieldName term +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + When k is not specified, Returns {String}, the filter fieldName used to construct + the termFilter object. + + + +
+ + + +
+ +
+
+
+ +

 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. + + + +
+ + + +
+ +
+
+
+ +

 term

+
+ + Object term ( ) + + +
Provides access to the filter term used to construct the + termFilter object.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this so that calls can be chained. + When k is not specified, Returns {String}, the filter term used + to construct the termFilter object. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + Object toJSON ( ) + + +
Returns the filter object.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ filter object + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.TermQuery.html b/dist/docs/ejs.TermQuery.html new file mode 100644 index 0000000..5d978f3 --- /dev/null +++ b/dist/docs/ejs.TermQuery.html @@ -0,0 +1,641 @@ + + + + + elastic.js: Module: TermQuery + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsTermQuery
+

+ +

A TermQuery can be used to return documents containing a given + keyword or term. For instance, you might want to retieve all the + documents/objects that contain the term Javascript. Term filters + often serve as the basis for more complex queries such as Boolean queries.

+
+ +
+

Module

+
+
+ +

 TermQuery

+
+ + TermQuery ( field, term ) + + +
A Query that matches documents containing a term. This may be + combined with other terms with a BooleanQuery.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + field + + + <String> + + + + + + the document field/key to query against +
+ + + + + term + + + <String> + + + + + + the literal value to be matched +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectboost(boost)Sets the boost value for documents matching the Query.
Objectfield(f)Sets the fields to query against.
Objectterm(t)Sets the term.
StringtoJSON()Retrieves the internal query object. This is typically used by + internal API functions so use with caution.
+
+ +

Method Detail

+ + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 boost

+
+ + Object boost ( boost ) + + +
Sets the boost value for documents matching the Query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + boost + + + <Number> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( f ) + + +
Sets the fields to query against.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + f + + + <String> + + + + + + A valid field name. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 term

+
+ + Object term ( t ) + + +
Sets the term.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + t + + + <String> + + + + + + A single term. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +
Retrieves the internal query object. This is typically used by + internal API functions so use with caution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal query property. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.TermStatsFacet.html b/dist/docs/ejs.TermStatsFacet.html new file mode 100644 index 0000000..146c27a --- /dev/null +++ b/dist/docs/ejs.TermStatsFacet.html @@ -0,0 +1,1654 @@ + + + + + elastic.js: Module: TermStatsFacet + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsTermStatsFacet
+

+ +

A termsStatsFacet allows you to compute statistics over an aggregate key (term). Essentially this + facet provides the functionality of what is often refered to as a pivot table.

+ +

Facets are similar to SQL GROUP BY statements but perform much + better. You can also construct several "groups" at once by simply + specifying multiple facets.

+ +
+

+ Tip: + For more information on faceted navigation, see + this + Wikipedia article on Faceted Classification. +

+

+
+ +
+

Module

+
+
+ +

 TermStatsFacet

+
+ + TermStatsFacet ( name ) + + +

A facet which computes statistical data based on an aggregate key.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + name + + + <String> + + + + + + The name which be used to refer to this facet. For instance, + the facet itself might utilize a field named doc_authors. Setting + name to Authors would allow you to refer to the + facet by that name, possibly simplifying some of the display logic. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
ObjectallTerms(trueFalse)

Allows you to return all terms, even if the frequency count is 0. This should not be + used on fields that contain a large number of unique terms because it could cause + out-of-memory errors.

ObjectcacheFilter(trueFalse)

Enables caching of the facetFilter

ObjectfacetFilter(oFilter)

Allows you to reduce the documents used for computing facet results.

Objectglobal(trueFalse)

Computes values across the entire index

ObjectkeyField(fieldName)Sets the field which will be used to pivot on (group-by).
Objectlang(language)The script language being used. Currently supported values are + javascript, groovy, and mvel.
Objectmode(m)

Sets the mode the facet will use.

+ +

+
collector
+
post
+
Objectnested(path)

Sets the path to the nested document if faceting against a + nested field.

Objectorder(o)Sets the type of ordering that will be performed on the date + buckets. Valid values are: + + count - default, sort by the number of items in the bucket + term - sort by term value. + reverse_count - reverse sort of the number of items in the bucket + reverse_term - reverse sort of the term value. + total - sorts by the total value of the bucket contents + reverse_total - reverse sort of the total value of bucket contents + min - the minimum value in the bucket + reverse_min - the reverse sort of the minimum value + max - the maximum value in the bucket + reverse_max - the reverse sort of the maximum value + mean - the mean value of the bucket contents + reverse_mean - the reverse sort of the mean value of bucket contents.
Objectparams(oParams)Allows you to set script parameters to be used during the execution of the script.
Objectscope(scope)

Computes values across the the specified scope

ObjectscriptField(script)Sets a script that will provide the terms for a given document.
Objectsize(facetSize)Sets the number of facet entries that will be returned for this facet. For instance, you + might ask for only the top 5 aggregate keys although there might be hundreds of + unique keys. Higher settings could cause memory strain.
StringtoJSON()

Retrieves the internal facet object. This is typically used by + internal API functions so use with caution.

ObjectvalueField(fieldName)Sets the field for which statistical information will be generated.
ObjectvalueScript(code)Define a script to evaluate of which the result will be used to generate + the statistical information.
+
+ +

Method Detail

+ + + + + + + + + + + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 allTerms

+
+ + Object allTerms ( trueFalse ) + + +

Allows you to return all terms, even if the frequency count is 0. This should not be + used on fields that contain a large number of unique terms because it could cause + out-of-memory errors.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <String> + + + + + + true or false +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 cacheFilter

+
+ + Object cacheFilter ( trueFalse ) + + +

Enables caching of the facetFilter


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + If the facetFilter should be cached or not +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 facetFilter

+
+ + Object facetFilter ( oFilter ) + + +

Allows you to reduce the documents used for computing facet results.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + oFilter + + + <Object> + + + + + + A valid Filter object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 global

+
+ + Object global ( trueFalse ) + + +

Computes values across the entire index


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + Calculate facet counts globally or not. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 keyField

+
+ + Object keyField ( fieldName ) + + +
Sets the field which will be used to pivot on (group-by).

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + fieldName + + + <String> + + + + + + The field name whose data will be used to construct the facet. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 lang

+
+ + Object lang ( language ) + + +
The script language being used. Currently supported values are + javascript, groovy, and mvel.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + language + + + <String> + + + + + + The language of the script. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 mode

+
+ + Object mode ( m ) + + +

Sets the mode the facet will use.

+ +

+
collector
+
post
+

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + m + + + <String> + + + + + + The mode: collector or post. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 nested

+
+ + Object nested ( path ) + + +

Sets the path to the nested document if faceting against a + nested field.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + path + + + <String> + + + + + + The nested path +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 order

+
+ + Object order ( o ) + + +
Sets the type of ordering that will be performed on the date + buckets. Valid values are: + + count - default, sort by the number of items in the bucket + term - sort by term value. + reverse_count - reverse sort of the number of items in the bucket + reverse_term - reverse sort of the term value. + total - sorts by the total value of the bucket contents + reverse_total - reverse sort of the total value of bucket contents + min - the minimum value in the bucket + reverse_min - the reverse sort of the minimum value + max - the maximum value in the bucket + reverse_max - the reverse sort of the maximum value + mean - the mean value of the bucket contents + reverse_mean - the reverse sort of the mean value of bucket contents.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + o + + + <String> + + + + + + The ordering method +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 params

+
+ + Object params ( oParams ) + + +
Allows you to set script parameters to be used during the execution of the script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + oParams + + + <Object> + + + + + + An object containing key/value pairs representing param name/value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scope

+
+ + Object scope ( scope ) + + +

Computes values across the the specified scope


+ +
+
+ + + + + +
Deprecated
since elasticsearch 0.90
+ + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scope + + + <String> + + + + + + The scope name to calculate facet counts with. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scriptField

+
+ + Object scriptField ( script ) + + +
Sets a script that will provide the terms for a given document.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + script + + + <String> + + + + + + The script code. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 size

+
+ + Object size ( facetSize ) + + +
Sets the number of facet entries that will be returned for this facet. For instance, you + might ask for only the top 5 aggregate keys although there might be hundreds of + unique keys. Higher settings could cause memory strain.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + facetSize + + + <Integer> + + + + + + The numer of facet entries to be returned. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal facet object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal facet property. + + + +
+ + + +
+ +
+
+
+ +

 valueField

+
+ + Object valueField ( fieldName ) + + +
Sets the field for which statistical information will be generated.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + fieldName + + + <String> + + + + + + The field name whose data will be used to construct the facet. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 valueScript

+
+ + Object valueScript ( code ) + + +
Define a script to evaluate of which the result will be used to generate + the statistical information.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + code + + + <String> + + + + + + The script code to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.TermSuggester.html b/dist/docs/ejs.TermSuggester.html new file mode 100644 index 0000000..912ef4c --- /dev/null +++ b/dist/docs/ejs.TermSuggester.html @@ -0,0 +1,1565 @@ + + + + + elastic.js: Module: TermSuggester + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsTermSuggester
+

+ +

TermSuggester suggests terms based on edit distance. The provided suggest + text is analyzed before terms are suggested. The suggested terms are + provided per analyzed suggest text token. This leaves the suggest-selection + to the API consumer. For a higher level suggester, please use the + PhraseSuggester.

+
+ +
+

Module

+
+
+ +

 TermSuggester

+
+ + TermSuggester ( name ) + + +

A suggester that suggests terms based on edit distance.


+ +
+
+ + + +
Since
+
elasticsearch 0.90
+ + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + name + + + <String> + + + + + + The name which be used to refer to this suggester. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectaccuracy(a)

Sets the accuracy. How similar the suggested terms at least + need to be compared to the original suggest text.

Objectanalyzer(analyzer)

Sets analyzer used to analyze the suggest text.

Objectfield(field)

Sets the field used to generate suggestions from.

ObjectmaxEdits(max)

Sets the maximum edit distance candidate suggestions can have + in order to be considered as a suggestion.

ObjectmaxInspections(max)

The factor that is used to multiply with the size in order + to inspect more candidate suggestions.

ObjectmaxTermFreq(max)

Sets a maximum threshold in number of documents a suggest text + token can exist in order to be corrected.

ObjectminDocFreq(min)

Sets a minimal threshold of the number of documents a suggested + term should appear in.

ObjectminWordLen(len)

Sets the minimum length a suggest text term must have in order + to be corrected.

ObjectshardSize(s)

Sets the maximum number of suggestions to be retrieved from + each individual shard.

Objectsize(s)

Sets the number of suggestions returned for each token.

Objectsort(s)

Sets the sort mode. Valid values are:

+ +
+
score - Sort by score first, then document frequency, and then the term itself
+
frequency - Sort by document frequency first, then simlarity score and then the term itself
+
ObjectstringDistance(s)

Sets what string distance implementation to use for comparing + how similar suggested terms are. Valid values are:

+ +
+
internal - based on damerau_levenshtein but but highly optimized for comparing string distance for terms inside the index
+
damerau_levenshtein - String distance algorithm based on Damerau-Levenshtein algorithm
+
levenstein - String distance algorithm based on Levenstein edit distance algorithm
+
jarowinkler - String distance algorithm based on Jaro-Winkler algorithm
+
ngram - String distance algorithm based on character n-grams
+
ObjectsuggestMode(m)

Sets the suggest mode. Valid values are:

+ +
+
missing - Only suggest terms in the suggest text that aren't in the index
+
popular - Only suggest suggestions that occur in more docs then the original suggest text term
+
always - Suggest any matching suggestions based on terms in the suggest text
+
Objecttext(txt)

Sets the text to get suggestions for. If not set, the global + suggestion text will be used.

StringtoJSON()

Retrieves the internal suggest object. This is typically used by + internal API functions so use with caution.

+
+ +

Method Detail

+ + + + + + + + + + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 accuracy

+
+ + Object accuracy ( a ) + + +

Sets the accuracy. How similar the suggested terms at least + need to be compared to the original suggest text.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + a + + + <Double> + + + + + + A positive double value between 0 and 1. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 analyzer

+
+ + Object analyzer ( analyzer ) + + +

Sets analyzer used to analyze the suggest text.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + analyzer + + + <String> + + + + + + A valid analyzer name. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( field ) + + +

Sets the field used to generate suggestions from.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + field + + + <String> + + + + + + A valid field name. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 maxEdits

+
+ + Object maxEdits ( max ) + + +

Sets the maximum edit distance candidate suggestions can have + in order to be considered as a suggestion.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + max + + + <Integer> + + + + + + An integer value greater than 0. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 maxInspections

+
+ + Object maxInspections ( max ) + + +

The factor that is used to multiply with the size in order + to inspect more candidate suggestions.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + max + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 maxTermFreq

+
+ + Object maxTermFreq ( max ) + + +

Sets a maximum threshold in number of documents a suggest text + token can exist in order to be corrected.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + max + + + <Double> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 minDocFreq

+
+ + Object minDocFreq ( min ) + + +

Sets a minimal threshold of the number of documents a suggested + term should appear in.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + min + + + <Double> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 minWordLen

+
+ + Object minWordLen ( len ) + + +

Sets the minimum length a suggest text term must have in order + to be corrected.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + len + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 shardSize

+
+ + Object shardSize ( s ) + + +

Sets the maximum number of suggestions to be retrieved from + each individual shard.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + s + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 size

+
+ + Object size ( s ) + + +

Sets the number of suggestions returned for each token.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + s + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 sort

+
+ + Object sort ( s ) + + +

Sets the sort mode. Valid values are:

+ +
+
score - Sort by score first, then document frequency, and then the term itself
+
frequency - Sort by document frequency first, then simlarity score and then the term itself
+

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + s + + + <String> + + + + + + The score type of score or frequency. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 stringDistance

+
+ + Object stringDistance ( s ) + + +

Sets what string distance implementation to use for comparing + how similar suggested terms are. Valid values are:

+ +
+
internal - based on damerau_levenshtein but but highly optimized for comparing string distance for terms inside the index
+
damerau_levenshtein - String distance algorithm based on Damerau-Levenshtein algorithm
+
levenstein - String distance algorithm based on Levenstein edit distance algorithm
+
jarowinkler - String distance algorithm based on Jaro-Winkler algorithm
+
ngram - String distance algorithm based on character n-grams
+

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + s + + + <String> + + + + + + The string distance algorithm name. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 suggestMode

+
+ + Object suggestMode ( m ) + + +

Sets the suggest mode. Valid values are:

+ +
+
missing - Only suggest terms in the suggest text that aren't in the index
+
popular - Only suggest suggestions that occur in more docs then the original suggest text term
+
always - Suggest any matching suggestions based on terms in the suggest text
+

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + m + + + <String> + + + + + + The mode of missing, popular, or always. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 text

+
+ + Object text ( txt ) + + +

Sets the text to get suggestions for. If not set, the global + suggestion text will be used.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + txt + + + <String> + + + + + + A string to get suggestions for. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal suggest object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal suggest property. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.TermsAggregation.html b/dist/docs/ejs.TermsAggregation.html new file mode 100644 index 0000000..8bc73b0 --- /dev/null +++ b/dist/docs/ejs.TermsAggregation.html @@ -0,0 +1,1747 @@ + + + + + elastic.js: Module: TermsAggregation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsTermsAggregation
+

+ +

A multi-bucket value source based aggregation where buckets are dynamically + built - one per unique value.

+
+ +
+

Module

+
+
+ +

 TermsAggregation

+
+ + TermsAggregation ( name ) + + +

Defines an aggregation of unique values/terms.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + name + + + <String> + + + + + + The name which be used to refer to this aggregation. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectagg(agg)Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method.
Objectaggregation(agg)Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation.
Objectexclude(exclude,flags)

Allows you to filter out unwanted facet entries using a regular + expression. You can also optionally pass in a set of flags to apply + to the regular expression. Valid flags are: CASE_INSENSITIVE, + MULTILINE, DOTALL, UNICODE_CASE, CANON_EQ, UNIX_LINES, LITERAL, + COMMENTS, and UNICODE_CHAR_CLASS. Separate multiple flags with a | + character.

ObjectexecutionHint(h)Sets the execution hint determines how the aggregation is computed. + Supported values are: map and ordinals.
Objectfield(field)

Sets the field to operate on.

Objectformat(f)Sets the format expression for the terms. Use for number or date + formatting
Objectinclude(include,flags)

Allows you to allow only specific entries using a regular + expression. You can also optionally pass in a set of flags to apply + to the regular expression. Valid flags are: CASE_INSENSITIVE, + MULTILINE, DOTALL, UNICODE_CASE, CANON_EQ, UNIX_LINES, LITERAL, + COMMENTS, and UNICODE_CHAR_CLASS. Separate multiple flags with a | + character.

Objectlang(language)The script language being used.
ObjectminDocCount(num)Only return terms that match more than a configured number of hits.
Objectorder(order,direction)Sets order for the aggregated values.
Objectparams(p)Sets parameters that will be applied to the script. Overwrites + any existing params.
Objectscript(scriptCode)Allows you generate or modify the terms/values using a script.
ObjectscriptFile(scriptFile)Allows you generate or modify the terms/values using a script.
ObjectscriptId(scriptId)Allows you generate or modify the terms/values using a script.
ObjectshardSize(shardSize)Determines how many terms the coordinating node will request from + each shard.
Objectsize(size)Sets the number of aggregation entries that will be returned.
StringtoJSON()

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.

+
+ +

Method Detail

+ + + + + + + + + + + + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 agg

+
+ + Object agg ( agg ) + + +
Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + agg + + + <Aggregation> + + + + + + Any valid Aggregation object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 aggregation

+
+ + Object aggregation ( agg ) + + +
Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + agg + + + <Aggregation> + + + + + + Any valid Aggregation object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 exclude

+
+ + Object exclude ( exclude, flags ) + + +

Allows you to filter out unwanted facet entries using a regular + expression. You can also optionally pass in a set of flags to apply + to the regular expression. Valid flags are: CASE_INSENSITIVE, + MULTILINE, DOTALL, UNICODE_CASE, CANON_EQ, UNIX_LINES, LITERAL, + COMMENTS, and UNICODE_CHAR_CLASS. Separate multiple flags with a | + character.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + exclude + + + <String> + + + + + + A regular expression exclude string +
+ + + + + flags + + + <String> + + + + + + Optional regular expression flags.. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 executionHint

+
+ + Object executionHint ( h ) + + +
Sets the execution hint determines how the aggregation is computed. + Supported values are: map and ordinals.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + h + + + <String> + + + + + + The hint value as a string. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( field ) + + +

Sets the field to operate on.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + field + + + <String> + + + + + + a valid field name.. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 format

+
+ + Object format ( f ) + + +
Sets the format expression for the terms. Use for number or date + formatting

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + f + + + <String> + + + + + + the format string +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 include

+
+ + Object include ( include, flags ) + + +

Allows you to allow only specific entries using a regular + expression. You can also optionally pass in a set of flags to apply + to the regular expression. Valid flags are: CASE_INSENSITIVE, + MULTILINE, DOTALL, UNICODE_CASE, CANON_EQ, UNIX_LINES, LITERAL, + COMMENTS, and UNICODE_CHAR_CLASS. Separate multiple flags with a | + character.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + include + + + <String> + + + + + + A regular expression include string +
+ + + + + flags + + + <String> + + + + + + Optional regular expression flags.. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 lang

+
+ + Object lang ( language ) + + +
The script language being used.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + language + + + <String> + + + + + + The language of the script. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 minDocCount

+
+ + Object minDocCount ( num ) + + +
Only return terms that match more than a configured number of hits.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + num + + + <Integer> + + + + + + The numer of minimum number of hits. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 order

+
+ + Object order ( order, direction ) + + +
Sets order for the aggregated values.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + order + + + <String> + + + + + + The order string. +
+ + + + + direction + + + <String> + + + + + + The sort direction, asc or desc. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 params

+
+ + Object params ( p ) + + +
Sets parameters that will be applied to the script. Overwrites + any existing params.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + p + + + <Object> + + + + + + An object where the keys are the parameter name and + values are the parameter value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 script

+
+ + Object script ( scriptCode ) + + +
Allows you generate or modify the terms/values using a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptCode + + + <String> + + + + + + A valid script string to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scriptFile

+
+ + Object scriptFile ( scriptFile ) + + +
Allows you generate or modify the terms/values using a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptFile + + + <String> + + + + + + A valid script file to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scriptId

+
+ + Object scriptId ( scriptId ) + + +
Allows you generate or modify the terms/values using a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptId + + + <String> + + + + + + A valid script id to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 shardSize

+
+ + Object shardSize ( shardSize ) + + +
Determines how many terms the coordinating node will request from + each shard.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + shardSize + + + <Integer> + + + + + + The numer of terms to fetch from each shard. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 size

+
+ + Object size ( size ) + + +
Sets the number of aggregation entries that will be returned.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + size + + + <Integer> + + + + + + The numer of aggregation entries to be returned. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal object. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.TermsFacet.html b/dist/docs/ejs.TermsFacet.html new file mode 100644 index 0000000..0af974c --- /dev/null +++ b/dist/docs/ejs.TermsFacet.html @@ -0,0 +1,2053 @@ + + + + + elastic.js: Module: TermsFacet + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsTermsFacet
+

+ +

A facet which returns the N most frequent terms within a collection + or set of collections. Term facets are useful for building constructs + which allow users to refine search results by filtering on terms returned + by the facet.

+ +

Facets are similar to SQL GROUP BY statements but perform much + better. You can also construct several "groups" at once by simply + specifying multiple facets.

+ +

For more information on faceted navigation, see this Wikipedia article on + Faceted Classification +

+ +
+

Module

+
+
+ +

 TermsFacet

+
+ + TermsFacet ( name ) + + +

A facet which returns the N most frequent terms within a collection + or set of collections.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + name + + + <String> + + + + + + The name which be used to refer to this facet. For instance, + the facet itself might utilize a field named doc_authors. Setting + name to Authors would allow you to refer to the + facet by that name, possibly simplifying some of the display logic. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
ObjectallTerms(trueFalse)

Allows you to return all terms, even if the frequency count is 0. This should not be + used on fields that contain a large number of unique terms because it could cause + out-of-memory errors.

ObjectcacheFilter(trueFalse)

Enables caching of the facetFilter

Objectexclude(exclude)

Allows you to filter out unwanted facet entries. When passed + a single term, it is appended to the list of currently excluded + terms. If passed an array, it overwrites all existing values.

ObjectexecutionHint(h)Sets the execution hint determines how the facet is computed. + Currently only supported value is "map".
ObjectfacetFilter(oFilter)

Allows you to reduce the documents used for computing facet results.

Objectfield(fieldName)Sets the field to be used to construct the this facet. Set to + _index to return a facet count of hits per _index the search was + executed on.
Objectfields(aFieldName)Aggregate statistical info across a set of fields.
Objectglobal(trueFalse)

Computes values across the entire index

Objectlang(language)The script language being used. Currently supported values are + javascript, groovy, and mvel.
Objectmode(m)

Sets the mode the facet will use.

+ +

+
collector
+
post
+
Objectnested(path)

Sets the path to the nested document if faceting against a + nested field.

Objectorder(o)Sets the type of ordering that will be performed on the date + buckets. Valid values are: + + count - default, sort by the number of items in the bucket + term - sort by term value. + reverse_count - reverse sort of the number of items in the bucket + reverse_term - reverse sort of the term value.
Objectparams(p)Sets parameters that will be applied to the script. Overwrites + any existing params.
Objectregex(exp)

Allows you to only include facet entries matching a specified regular expression.

ObjectregexFlags(flags)

Allows you to set the regular expression flags to be used + with the regex

Objectscope(scope)

Computes values across the the specified scope

Objectscript(scriptCode)Allows you modify the term using a script. The modified value + is then used in the facet collection.
ObjectscriptField(script)Sets a script that will provide the terms for a given document.
ObjectshardSize(shardSize)Determines how many terms the coordinating node will request from + each shard.
Objectsize(facetSize)Sets the number of facet entries that will be returned for this facet. For instance, you + might ask for only the top 5 authors although there might be hundreds of + unique authors.
StringtoJSON()

Retrieves the internal facet object. This is typically used by + internal API functions so use with caution.

+
+ +

Method Detail

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 allTerms

+
+ + Object allTerms ( trueFalse ) + + +

Allows you to return all terms, even if the frequency count is 0. This should not be + used on fields that contain a large number of unique terms because it could cause + out-of-memory errors.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <String> + + + + + + true or false +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 cacheFilter

+
+ + Object cacheFilter ( trueFalse ) + + +

Enables caching of the facetFilter


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + If the facetFilter should be cached or not +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 exclude

+
+ + Object exclude ( exclude ) + + +

Allows you to filter out unwanted facet entries. When passed + a single term, it is appended to the list of currently excluded + terms. If passed an array, it overwrites all existing values.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + exclude + + + <String | String[]> + + + + + + A single term to exclude or an + array of terms to exclude. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 executionHint

+
+ + Object executionHint ( h ) + + +
Sets the execution hint determines how the facet is computed. + Currently only supported value is "map".

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + h + + + <Object> + + + + + + The hint value as a string. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 facetFilter

+
+ + Object facetFilter ( oFilter ) + + +

Allows you to reduce the documents used for computing facet results.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + oFilter + + + <Object> + + + + + + A valid Filter object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( fieldName ) + + +
Sets the field to be used to construct the this facet. Set to + _index to return a facet count of hits per _index the search was + executed on.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + fieldName + + + <String> + + + + + + The field name whose data will be used to construct the facet. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 fields

+
+ + Object fields ( aFieldName ) + + +
Aggregate statistical info across a set of fields.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + aFieldName + + + <Array> + + + + + + An array of field names. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 global

+
+ + Object global ( trueFalse ) + + +

Computes values across the entire index


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + Calculate facet counts globally or not. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 lang

+
+ + Object lang ( language ) + + +
The script language being used. Currently supported values are + javascript, groovy, and mvel.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + language + + + <String> + + + + + + The language of the script. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 mode

+
+ + Object mode ( m ) + + +

Sets the mode the facet will use.

+ +

+
collector
+
post
+

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + m + + + <String> + + + + + + The mode: collector or post. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 nested

+
+ + Object nested ( path ) + + +

Sets the path to the nested document if faceting against a + nested field.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + path + + + <String> + + + + + + The nested path +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 order

+
+ + Object order ( o ) + + +
Sets the type of ordering that will be performed on the date + buckets. Valid values are: + + count - default, sort by the number of items in the bucket + term - sort by term value. + reverse_count - reverse sort of the number of items in the bucket + reverse_term - reverse sort of the term value.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + o + + + <String> + + + + + + The ordering method +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 params

+
+ + Object params ( p ) + + +
Sets parameters that will be applied to the script. Overwrites + any existing params.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + p + + + <Object> + + + + + + An object where the keys are the parameter name and + values are the parameter value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 regex

+
+ + Object regex ( exp ) + + +

Allows you to only include facet entries matching a specified regular expression.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + exp + + + <String> + + + + + + A valid regular expression. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 regexFlags

+
+ + Object regexFlags ( flags ) + + +

Allows you to set the regular expression flags to be used + with the regex


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + flags + + + <String> + + + + + + A valid regex flag - see Java Pattern API +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scope

+
+ + Object scope ( scope ) + + +

Computes values across the the specified scope


+ +
+
+ + + + + +
Deprecated
since elasticsearch 0.90
+ + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scope + + + <String> + + + + + + The scope name to calculate facet counts with. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 script

+
+ + Object script ( scriptCode ) + + +
Allows you modify the term using a script. The modified value + is then used in the facet collection.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptCode + + + <String> + + + + + + A valid script string to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scriptField

+
+ + Object scriptField ( script ) + + +
Sets a script that will provide the terms for a given document.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + script + + + <String> + + + + + + The script code. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 shardSize

+
+ + Object shardSize ( shardSize ) + + +
Determines how many terms the coordinating node will request from + each shard.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + shardSize + + + <Integer> + + + + + + The numer of terms to fetch from each shard. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 size

+
+ + Object size ( facetSize ) + + +
Sets the number of facet entries that will be returned for this facet. For instance, you + might ask for only the top 5 authors although there might be hundreds of + unique authors.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + facetSize + + + <Integer> + + + + + + The numer of facet entries to be returned. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal facet object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal facet property. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.TermsFilter.html b/dist/docs/ejs.TermsFilter.html new file mode 100644 index 0000000..a819158 --- /dev/null +++ b/dist/docs/ejs.TermsFilter.html @@ -0,0 +1,1393 @@ + + + + + elastic.js: Module: TermsFilter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsTermsFilter
+

+ +

Filters documents that have fields that match any of the provided + terms (not analyzed)

+
+ +
+

Module

+
+
+ +

 TermsFilter

+
+ + TermsFilter ( field, terms ) + + +
A Filter that matches documents containing provided terms.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + field + + + <String> + + + + + + the document field/key to filter against +
+ + + + + terms + + + <String | String[]> + + + + + + a single term or an array of terms. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
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.
ObjectcacheLookup(trueFalse)Enable or disable caching of the lookup
Objectexecution(e)Sets the way terms filter executes is by iterating over the terms + provided and finding matches docs (loading into a bitset) and + caching it. Valid values are: plain, bool, bool_nocache, and, + and_nocache, or, or_nocache. Defaults to plain.
Objectfield(f)Sets the fields to filter against.
Objectid(id)Sets the document id of the document containing the terms to use + when performing a terms lookup.
Objectindex(idx)Sets the index the document containing the terms is in when + performing a terms lookup. Defaults to the index currently + being searched.
Objectname(name)Sets the filter name.
Objectpath(path)Sets the path/field name where the terms in the source document + are located when performing a terms lookup.
Objectrouting(path)Sets the routing value for the source document when performing a + terms lookup.
Objectterms(t)Sets the terms. If t is a String, it is added to the existing + list of terms. If t is an array, the list of terms replaces the + existing terms.
ObjecttoJSON()Returns the filter object.
Objecttype(type)Sets the type the document containing the terms when performing a + terms lookup.
+
+ +

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. + + + +
+ + + +
+ +
+
+
+ +

 cacheLookup

+
+ + Object cacheLookup ( trueFalse ) + + +
Enable or disable caching of the lookup

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + True to cache the lookup, false otherwise. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 execution

+
+ + Object execution ( e ) + + +
Sets the way terms filter executes is by iterating over the terms + provided and finding matches docs (loading into a bitset) and + caching it. Valid values are: plain, bool, bool_nocache, and, + and_nocache, or, or_nocache. Defaults to plain.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + e + + + <String> + + + + + + A valid execution method. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( f ) + + +
Sets the fields to filter against.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + f + + + <String> + + + + + + A valid field name. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 id

+
+ + Object id ( id ) + + +
Sets the document id of the document containing the terms to use + when performing a terms lookup.

+ +
+
+ + + +
Since
+
elasticsearch 0.90
+ + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + id + + + <String> + + + + + + A valid index name. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 index

+
+ + Object index ( idx ) + + +
Sets the index the document containing the terms is in when + performing a terms lookup. Defaults to the index currently + being searched.

+ +
+
+ + + +
Since
+
elasticsearch 0.90
+ + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + idx + + + <String> + + + + + + A valid index name. +
+ + +
+ + + + + + +
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. + + + +
+ + + +
+ +
+
+
+ +

 path

+
+ + Object path ( path ) + + +
Sets the path/field name where the terms in the source document + are located when performing a terms lookup.

+ +
+
+ + + +
Since
+
elasticsearch 0.90
+ + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + path + + + <String> + + + + + + A valid index name. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 routing

+
+ + Object routing ( path ) + + +
Sets the routing value for the source document when performing a + terms lookup.

+ +
+
+ + + +
Since
+
elasticsearch 0.90.2
+ + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + path + + + <String> + + + + + + A valid index name. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 terms

+
+ + Object terms ( t ) + + +
Sets the terms. If t is a String, it is added to the existing + list of terms. If t is an array, the list of terms replaces the + existing terms.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + t + + + <String | String[]> + + + + + + A single term or an array or terms. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + Object toJSON ( ) + + +
Returns the filter object.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ filter object + + + +
+ + + +
+ +
+
+
+ +

 type

+
+ + Object type ( type ) + + +
Sets the type the document containing the terms when performing a + terms lookup.

+ +
+
+ + + +
Since
+
elasticsearch 0.90
+ + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + type + + + <String> + + + + + + A valid type name. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.TermsQuery.html b/dist/docs/ejs.TermsQuery.html new file mode 100644 index 0000000..dd525f9 --- /dev/null +++ b/dist/docs/ejs.TermsQuery.html @@ -0,0 +1,807 @@ + + + + + elastic.js: Module: TermsQuery + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsTermsQuery
+

+ +

A query that match on any (configurable) of the provided terms. This is + a simpler syntax query for using a bool query with several term queries + in the should clauses.

+
+ +
+

Module

+
+
+ +

 TermsQuery

+
+ + TermsQuery ( field, terms ) + + +
A Query that matches documents containing provided terms.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + field + + + <String> + + + + + + the document field/key to query against +
+ + + + + terms + + + <String | String[]> + + + + + + a single term or array of "terms" to match +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectboost(boost)Sets the boost value for documents matching the Query.
ObjectdisableCoord(trueFalse)Enables or disables similarity coordinate scoring of documents + matching the Query. Default: false.
Objectfield(f)Sets the fields to query against.
ObjectminimumShouldMatch(minMatch)Sets the minimum number of terms that need to match in a document + before that document is returned in the results.
Objectterms(t)Sets the terms. If you t is a String, it is added to the existing + list of terms. If t is an array, the list of terms replaces the + existing terms.
StringtoJSON()Retrieves the internal query object. This is typically used by + internal API functions so use with caution.
+
+ +

Method Detail

+ + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 boost

+
+ + Object boost ( boost ) + + +
Sets the boost value for documents matching the Query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + boost + + + <Double> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 disableCoord

+
+ + Object disableCoord ( trueFalse ) + + +
Enables or disables similarity coordinate scoring of documents + matching the Query. Default: false.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <String> + + + + + + A true/false +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( f ) + + +
Sets the fields to query against.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + f + + + <String> + + + + + + A valid field name. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 minimumShouldMatch

+
+ + Object minimumShouldMatch ( minMatch ) + + +
Sets the minimum number of terms that need to match in a document + before that document is returned in the results.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + minMatch + + + <String> + + + + + + A min should match parameter. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 terms

+
+ + Object terms ( t ) + + +
Sets the terms. If you t is a String, it is added to the existing + list of terms. If t is an array, the list of terms replaces the + existing terms.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + t + + + <String | String[]> + + + + + + A single term or an array or terms. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +
Retrieves the internal query object. This is typically used by + internal API functions so use with caution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal query property. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.TopChildrenQuery.html b/dist/docs/ejs.TopChildrenQuery.html new file mode 100644 index 0000000..fc4c6b4 --- /dev/null +++ b/dist/docs/ejs.TopChildrenQuery.html @@ -0,0 +1,1061 @@ + + + + + elastic.js: Module: TopChildrenQuery + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsTopChildrenQuery
+

+ +

TThe top_children query runs the child query with an estimated hits size, + and out of the hit docs, aggregates it into parent docs. If there aren’t + enough parent docs matching the requested from/size search request, then it + is run again with a wider (more hits) search.

+ +

The top_children also provide scoring capabilities, with the ability to + specify max, sum or avg as the score type.

+
+ +
+

Module

+
+
+ +

 TopChildrenQuery

+
+ + TopChildrenQuery ( qry, type ) + + +
Returns child documents matching the query aggregated into the parent docs.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + qry + + + <Object> + + + + + + A valid query object. +
+ + + + + type + + + <String> + + + + + + The child type to execute the query on +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectboost(boost)Sets the boost value for documents matching the Query.
Objectfactor(f)Sets the factor which is the number of hits that are asked for in + the child query. Defaults to 5.
ObjectincrementalFactor(f)Sets the incremental factor. The incremental factor is used when not + enough child documents are returned so the factor is multiplied by + the incremental factor to fetch more results. Defaults to 52
Objectquery(q)Sets the query
Objectscope(s)Sets the scope of the query. A scope allows to run facets on the + same scope name that will work against the child documents.
Objectscore(s)Sets the scoring type. Valid values are max, sum, or avg. If + another value is passed it we silently ignore the value.
ObjectscoreMode(s)Sets the scoring type. Valid values are max, sum, total, or avg. + If another value is passed it we silently ignore the value.
StringtoJSON()Retrieves the internal query object. This is typically used by + internal API functions so use with caution.
Objecttype(t)Sets the child document type to search against
+
+ +

Method Detail

+ + + + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 boost

+
+ + Object boost ( boost ) + + +
Sets the boost value for documents matching the Query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + boost + + + <Double> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 factor

+
+ + Object factor ( f ) + + +
Sets the factor which is the number of hits that are asked for in + the child query. Defaults to 5.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + f + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 incrementalFactor

+
+ + Object incrementalFactor ( f ) + + +
Sets the incremental factor. The incremental factor is used when not + enough child documents are returned so the factor is multiplied by + the incremental factor to fetch more results. Defaults to 52

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + f + + + <Integer> + + + + + + A positive integer value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 query

+
+ + Object query ( q ) + + +
Sets the query

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + q + + + <Object> + + + + + + A valid Query object +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scope

+
+ + Object scope ( s ) + + +
Sets the scope of the query. A scope allows to run facets on the + same scope name that will work against the child documents.

+ +
+
+ + + + + +
Deprecated
since elasticsearch 0.90
+ + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + s + + + <String> + + + + + + The scope name as a string. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 score

+
+ + Object score ( s ) + + +
Sets the scoring type. Valid values are max, sum, or avg. If + another value is passed it we silently ignore the value.

+ +
+
+ + + + + +
Deprecated
since elasticsearch 0.90.1, use scoreMode
+ + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + s + + + <String> + + + + + + The scoring type as a string. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scoreMode

+
+ + Object scoreMode ( s ) + + +
Sets the scoring type. Valid values are max, sum, total, or avg. + If another value is passed it we silently ignore the value.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + s + + + <String> + + + + + + The scoring type as a string. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +
Retrieves the internal query object. This is typically used by + internal API functions so use with caution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal query property. + + + +
+ + + +
+ +
+
+
+ +

 type

+
+ + Object type ( t ) + + +
Sets the child document type to search against

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + t + + + <String> + + + + + + A valid type name +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.TopHitsAggregation.html b/dist/docs/ejs.TopHitsAggregation.html new file mode 100644 index 0000000..93aed67 --- /dev/null +++ b/dist/docs/ejs.TopHitsAggregation.html @@ -0,0 +1,1381 @@ + + + + + elastic.js: Module: TopHitsAggregation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsTopHitsAggregation
+

+ +

A top_hits metric aggregator keeps track of the most relevant document being + aggregated. This aggregator is intended to be used as a sub aggregator, so that + the top matching documents can be aggregated per bucket.

+
+ +
+

Module

+
+
+ +

 TopHitsAggregation

+
+ + TopHitsAggregation ( name ) + + +

top_hits metric aggregator keeps track of the most relevant document being + aggregated.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + name + + + <String> + + + + + + The name which be used to refer to this aggregation. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectagg(agg)Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method.
Objectaggregation(agg)Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation.
Objectexplain(trueFalse)

Enable/Disable explanation of score for each hi.

ObjectfieldDataFields(Fields)

Allows to return the field data representation of a field for each hit.

Objectfrom(from)

The offset from the first result you want to fetch.

Objecthighlight(h)

Performs highlighting based on the Highlight settings.

ObjectscriptField(oScriptField)

Computes a document property dynamically based on the supplied ScriptField.

Objectsize(size)

Sets the maximum number of top matching hits to return per bucket.

Objectsort(sort)

The maximum number of top matching hits to return per bucket.

Objectsource(includes,excludes)

Allows to control how the _source field is returned with every hit. + By default operations return the contents of the _source field + unless you have used the fields parameter or if the _source field + is disabled. Set the includes parameter to false to completely + disable returning the source field.

StringtoJSON()

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.

ObjecttrackScores(trueFalse)

Enables score computation and tracking during sorting. + By default, sorting scores are not computed.

Objectversion(trueFalse)

Enable/Disable returning version number for each hit.

+
+ +

Method Detail

+ + + + + + + + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 agg

+
+ + Object agg ( agg ) + + +
Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation. Alias for the + aggregation method.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + agg + + + <Aggregation> + + + + + + Any valid Aggregation object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 aggregation

+
+ + Object aggregation ( agg ) + + +
Add a nesated aggregation. This method can be called multiple times + in order to set multiple nested aggregations what will be executed + at the same time as the parent aggregation.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + agg + + + <Aggregation> + + + + + + Any valid Aggregation object. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 explain

+
+ + Object explain ( trueFalse ) + + +

Enable/Disable explanation of score for each hi.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + true to enable, false to disable +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 fieldDataFields

+
+ + Object fieldDataFields ( Fields ) + + +

Allows to return the field data representation of a field for each hit.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + Fields + + + <Array> + + + + + + to return field data representation for. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 from

+
+ + Object from ( from ) + + +

The offset from the first result you want to fetch.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + from + + + <Integer> + + + + + + The offset from the first result you want to fetch. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 highlight

+
+ + Object highlight ( h ) + + +

Performs highlighting based on the Highlight settings.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + h + + + <Highlight> + + + + + + A valid Highlight object +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scriptField

+
+ + Object scriptField ( oScriptField ) + + +

Computes a document property dynamically based on the supplied ScriptField.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + oScriptField + + + <ScriptField> + + + + + + A valid ScriptField. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 size

+
+ + Object size ( size ) + + +

Sets the maximum number of top matching hits to return per bucket.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + size + + + <Integer> + + + + + + The numer of aggregation entries to be returned per bucket. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 sort

+
+ + Object sort ( sort ) + + +

The maximum number of top matching hits to return per bucket.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + sort + + + <Array> + + + + + + How to sort the the top matching hits +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 source

+
+ + Object source ( includes, excludes ) + + +

Allows to control how the _source field is returned with every hit. + By default operations return the contents of the _source field + unless you have used the fields parameter or if the _source field + is disabled. Set the includes parameter to false to completely + disable returning the source field.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + includes + + + <String | Boolean | String[]> + + + + + + The field or list of fields to include as array. + Set to a boolean false to disable the source completely. +
+ + + + + excludes + + + <String | String[]> + + + + + + The optional field or list of fields to exclude. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal object. + + + +
+ + + +
+ +
+
+
+ +

 trackScores

+
+ + Object trackScores ( trueFalse ) + + +

Enables score computation and tracking during sorting. + By default, sorting scores are not computed.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + If scores should be computed and tracked. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 version

+
+ + Object version ( trueFalse ) + + +

Enable/Disable returning version number for each hit.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + trueFalse + + + <Boolean> + + + + + + true to enable, false to disable +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.TypeFilter.html b/dist/docs/ejs.TypeFilter.html new file mode 100644 index 0000000..0a0a87e --- /dev/null +++ b/dist/docs/ejs.TypeFilter.html @@ -0,0 +1,700 @@ + + + + + elastic.js: Module: TypeFilter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsTypeFilter
+

+ +

A Filter that filters results by a specified index type.

+
+ +
+

Module

+
+
+ +

 TypeFilter

+
+ + TypeFilter ( type ) + + +
Filter results by a specified index type.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + type + + + <String> + + + + + + the index type to filter on. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
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.
Objectname(name)Sets the filter name.
ObjecttoJSON()Returns the filter object.
Objecttype(type)Sets the type
+
+ +

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. + + + +
+ + + +
+ +
+
+
+ +

 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. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + Object toJSON ( ) + + +
Returns the filter object.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ filter object + + + +
+ + + +
+ +
+
+
+ +

 type

+
+ + Object type ( type ) + + +
Sets the type

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + type + + + <String> + + + + + + the index type to filter on +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.ValueCountAggregation.html b/dist/docs/ejs.ValueCountAggregation.html new file mode 100644 index 0000000..e112f35 --- /dev/null +++ b/dist/docs/ejs.ValueCountAggregation.html @@ -0,0 +1,870 @@ + + + + + elastic.js: Module: ValueCountAggregation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsValueCountAggregation
+

+ +

A single-value metrics aggregation that counts the number of values that + are extracted from the aggregated documents. These values can be extracted + either from specific fields in the documents, or be generated by a provided + script. Typically, this aggregator will be used in conjunction with other + single-value aggregations.

+
+ +
+

Module

+
+
+ +

 ValueCountAggregation

+
+ + ValueCountAggregation ( name ) + + +

Aggregation that counts the number of values that are extracted from the + aggregated documents.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + name + + + <String> + + + + + + The name which be used to refer to this aggregation. +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectfield(field)

Sets the field to operate on.

Objectlang(language)The script language being used.
Objectparams(p)Sets parameters that will be applied to the script. Overwrites + any existing params.
Objectscript(scriptCode)Allows you generate or modify the terms/values using a script.
ObjectscriptFile(scriptFile)Allows you generate or modify the terms/values using a script.
ObjectscriptId(scriptId)Allows you generate or modify the terms/values using a script.
StringtoJSON()

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.

+
+ +

Method Detail

+ + + + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( field ) + + +

Sets the field to operate on.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + field + + + <String> + + + + + + a valid field name.. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 lang

+
+ + Object lang ( language ) + + +
The script language being used.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + language + + + <String> + + + + + + The language of the script. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 params

+
+ + Object params ( p ) + + +
Sets parameters that will be applied to the script. Overwrites + any existing params.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + p + + + <Object> + + + + + + An object where the keys are the parameter name and + values are the parameter value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 script

+
+ + Object script ( scriptCode ) + + +
Allows you generate or modify the terms/values using a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptCode + + + <String> + + + + + + A valid script string to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scriptFile

+
+ + Object scriptFile ( scriptFile ) + + +
Allows you generate or modify the terms/values using a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptFile + + + <String> + + + + + + A valid script file to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 scriptId

+
+ + Object scriptId ( scriptId ) + + +
Allows you generate or modify the terms/values using a script.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + scriptId + + + <String> + + + + + + A valid script id to execute. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +

Retrieves the internal agg object. This is typically used by + internal API functions so use with caution.


+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal object. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.WildcardQuery.html b/dist/docs/ejs.WildcardQuery.html new file mode 100644 index 0000000..04c1ed3 --- /dev/null +++ b/dist/docs/ejs.WildcardQuery.html @@ -0,0 +1,772 @@ + + + + + elastic.js: Module: WildcardQuery + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejsWildcardQuery
+

+ +

Matches documents that have fields matching a wildcard expression + (not analyzed). Supported wildcards are *, which matches any character + sequence (including the empty one), and ?, which matches any single + character. Note this query can be slow, as it needs to iterate over many + wildcards. In order to prevent extremely slow wildcard queries, a wildcard + wildcard should not start with one of the wildcards * or ?. The wildcard query + maps to Lucene WildcardQuery.

+
+ +
+

Module

+
+
+ +

 WildcardQuery

+
+ + WildcardQuery ( field, value ) + + +
A Query that matches documents containing a wildcard. This may be + combined with other wildcards with a BooleanQuery.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + field + + + <String> + + + + + + the document field/key to query against +
+ + + + + value + + + <String> + + + + + + the literal value to be matched +
+ + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +

Method Summary

+ + + + + + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
ReturnsNameDescription
String_type()The type of ejs object. For internal use only.
Objectboost(boost)Sets the boost value for documents matching the Query.
Objectfield(f)Sets the fields to query against.
Objectrewrite(m)Sets rewrite method. Valid values are: + + constant_score_auto - tries to pick the best constant-score rewrite + method based on term and document counts from the query + + scoring_boolean - translates each term into boolean should and + keeps the scores as computed by the query + + constant_score_boolean - same as scoring_boolean, expect no scores + are computed. + + constant_score_filter - first creates a private Filter, by visiting + each term in sequence and marking all docs for that term + + top_terms_boost_N - first translates each term into boolean should + and scores are only computed as the boost using the top N + scoring terms. Replace N with an integer value. + + top_terms_N - first translates each term into boolean should + and keeps the scores as computed by the query. Only the top N + scoring terms are used. Replace N with an integer value. + + Default is constant_score_auto. + + This is an advanced option, use with care.
StringtoJSON()Retrieves the internal query object. This is typically used by + internal API functions so use with caution.
Objectvalue(v)Sets the wildcard query value.
+
+ +

Method Detail

+ + + + + + + + + + + +
+
+ +

 _type

+
+ + String _type ( ) + + +
The type of ejs object. For internal use only.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ the type of object + + + +
+ + + +
+ +
+
+
+ +

 boost

+
+ + Object boost ( boost ) + + +
Sets the boost value for documents matching the Query.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + boost + + + <Number> + + + + + + A positive double value. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 field

+
+ + Object field ( f ) + + +
Sets the fields to query against.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + f + + + <String> + + + + + + A valid field name. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 rewrite

+
+ + Object rewrite ( m ) + + +
Sets rewrite method. Valid values are: + + constant_score_auto - tries to pick the best constant-score rewrite + method based on term and document counts from the query + + scoring_boolean - translates each term into boolean should and + keeps the scores as computed by the query + + constant_score_boolean - same as scoring_boolean, expect no scores + are computed. + + constant_score_filter - first creates a private Filter, by visiting + each term in sequence and marking all docs for that term + + top_terms_boost_N - first translates each term into boolean should + and scores are only computed as the boost using the top N + scoring terms. Replace N with an integer value. + + top_terms_N - first translates each term into boolean should + and keeps the scores as computed by the query. Only the top N + scoring terms are used. Replace N with an integer value. + + Default is constant_score_auto. + + This is an advanced option, use with care.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + m + + + <String> + + + + + + The rewrite method as a string. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+
+ +

 toJSON

+
+ + String toJSON ( ) + + +
Retrieves the internal query object. This is typically used by + internal API functions so use with caution.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + +
Returns
+
+ returns this object's internal query property. + + + +
+ + + +
+ +
+
+
+ +

 value

+
+ + Object value ( v ) + + +
Sets the wildcard query value.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + v + + + <String> + + + + + + A single term. +
+ + +
+ + + + + + +
Returns
+
+ returns this so that calls can be chained. + + + +
+ + + +
+ +
+
+ + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/ejs.html b/dist/docs/ejs.html new file mode 100644 index 0000000..ff7b59e --- /dev/null +++ b/dist/docs/ejs.html @@ -0,0 +1,823 @@ + + + + + elastic.js: Namespace: ejs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

+
ejs
+

+ + +
+ +
+

All elastic.js modules are organized under the ejs namespace.

+
+ + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + +

Modules

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
AndFilterA container Filter that allows Boolean AND composition of Filters.
AvgAggregation

Aggregation that computes the average of numeric values that are extracted + from the aggregated documents.

BoolFilterA Filter that matches documents matching boolean combinations of other + filters.
BoolQueryA Query that matches documents matching boolean combinations of other + queries, e.g. termQuerys, phraseQuerys or other boolQuerys.
BoostFactorScoreFunction

Multiply the score by the provided boost_factor.

BoostingQuery

Constructs a query that can demote search results. A negative boost.

CardinalityAggregation

Aggregation that calculates an approximate count of distinct values.

ChildrenAggregation

A special single bucket aggregation that enables aggregating children + documents.

CommonTermsQueryA query that executes high-frequency terms in a optional sub-query.
CompletionSuggester

A suggester that allows basic auto-complete functionality.

ConstantScoreQuery

Constructs a query where each documents returned by the internal + query or filter have a constant score equal to the boost factor.

DateHistogramAggregation

Aggregation similar to the histogram except it can only be applied on + date values.

DateHistogramFacet

A facet which returns the N most frequent terms within a collection + or set of collections.

DateRangeAggregation

Aggregation that is dedicated for date value ranges.

DecayScoreFunction

Score a document with a function that decays depending on the distance + of a numeric field value of the document from given origin.

DirectGenerator

A candidate generator that generates terms based on edit distance.

DisMaxQueryA query that generates the union of documents produced by its subqueries such + as termQuerys, phraseQuerys, boolQuerys, etc.
ExistsFilterFilters documents where a specified field exists and contains a value.
ExtendedStatsAggregation

Aggregation that computes extra stats over numeric values extracted from + the aggregated documents.

FieldMaskingSpanQueryWraps a SpanQuery and hides the real field being searched across.
FieldValueFactorFunction

Multiply the score by the value of the field, multiplied by the factor.

FilterAggregation

Defines a single bucket of all the documents that match a given filter.

FilteredQuery

A query that applies a filter to the results of another query.

FilterFacet

A facet that return a count of the hits matching the given filter.

FiltersAggregation

Defines a multi bucket aggregations where each bucket is + associated with a filter. Each bucket will collect all documents + that match its associated filter.

FunctionScoreQuery

A query that allows you to modify the score of matching documents.

FuzzyLikeThisFieldQuery

Constructs a query where each documents returned are “like†provided text

FuzzyLikeThisQuery

Constructs a query where each documents returned are “like†provided text

FuzzyQuery

Constructs a query where each documents returned are “like†provided text

GeoBboxFilterFilter results to those which are contained within the defined bounding box.
GeoBoundsAggregation

Aggregation that computes the bounding box containing all geo_point values for a field.

GeoDistanceAggregation

Aggregation that works on geo_point fields and conceptually works very + similar to the range aggregation.

GeoDistanceFacet

A facet which provides information over a range of distances from a provided point.

GeoDistanceFilterFilter results to those which fall within the given distance of the point of origin.
GeoDistanceRangeFilterFilter results to those which fall within the given distance range of the point of origin.
GeoHashGridAggregation

Aggregation that works on geo_point fields and groups points into buckets + that represent cells in a grid.

GeoPoint

Defines a point

GeoPolygonFilterFilter results to those which are contained within the polygon of points.
GeoShapeFilterA Filter to find documents with a geo_shapes matching a specific shape.
GeoShapeQueryA Query to find documents with a geo_shapes matching a specific shape.
GlobalAggregation

Defines a single bucket of all the documents within the search context.

HasChildFilterReturns results that have child documents matching the filter.
HasChildQueryReturns results that have child documents matching the query.
HasParentFilterReturns results that have parent documents matching the filter.
HasParentQueryReturns results that have parent documents matching the query.
Highlight

Allows to highlight search results on one or more fields.

HistogramAggregation

Aggregation that can be applied on numeric values extracted from the + documents.

HistogramFacet

A facet which returns the N most frequent terms within a collection + or set of collections.

IdsFilterMatches documents with the specified id(s).
IdsQueryMatches documents with the specified id(s).
IndexedShape

Defines a shape that already exists in an index/type.

IndicesFilterA configurable filter that is dependent on the index name.
IndicesQueryA configurable query that is dependent on the index name.
InnerHits

Include additional nested hits in the response.

IPv4RangeAggregation

A dedicated range aggregation for IPv4 typed fields.

LimitFilterLimits the number of documents to execute on.
MatchAllFilter

A filter that matches on all documents

MatchAllQuery

A query that returns all documents.

MatchQueryA Query that appects text, analyzes it, generates internal query based + on the MatchQuery type.
MaxAggregation

Aggregation that keeps track and returns the maximum value among the + numeric values extracted from the aggregated documents.

MinAggregation

Aggregation that keeps track and returns the minimum value among numeric + values extracted from the aggregated documents.

MissingAggregation

Defines a bucket of all documents that are missing a field value.

MissingFilterFilters documents where a specific field has no value present.
MoreLikeThisFieldQuery

Constructs a query where each documents returned are “like†provided text

MoreLikeThisQuery

Constructs a query where each documents returned are “like†provided text

MultiMatchQueryA Query that allow to more easily build a MatchQuery + over multiple fields
NestedAggregation

A special single bucket aggregation that enables aggregating nested + documents.

NestedFilter

Constructs a filter that is capable of executing a filter against objects + nested within a document.

NestedQuery

Constructs a query that is capable of executing a search against objects + nested within a document.

NotFilterContainer filter that excludes the matched documents of the contained filter.
NumericRangeFilterA Filter that only accepts numeric values within a specified range.
OrFilterA container Filter that allows Boolean OR composition of filters.
PartialField

Control what part of the _source will be loaded.

PercentilesAggregation

Aggregation that calculates one or more percentiles over numeric values + extracted from the aggregated documents.

PhraseSuggester

A suggester that suggests entire corrected phrases.

PrefixFilterFilters documents that have fields containing terms with a specified prefix.
PrefixQueryMatches documents containing the specified un-analyzed prefix.
QueryFacet

A facet that return a count of the hits matching the given query.

QueryFilterFilters documents matching the wrapped query.
QueryStringQueryA query that is parsed using Lucene's default query parser.
RandomScoreFunction

Randomly score documents.

RangeAggregation

Aggregation that enables the user to define a set of ranges that each + represent a bucket.

RangeFacet

A facet which provides information over a range of numeric intervals.

RangeFilterFilters documents with fields that have terms within a certain range.
RangeQueryMatches documents with fields that have terms within a certain range.
RegexpFilterMatches documents that have fields matching a regular expression.
RegexpQueryMatches documents that have fields matching a regular expression.
Request

Provides methods for generating request bodies.

Rescore

Defines an operation that rescores a query with another query.

ScoreFunction

Randomly score documents.

ScriptedMetricAggregation

Aggregation that keeps track and returns the minimum value among numeric + values extracted from the aggregated documents.

ScriptField

Computes dynamic document properties based on information from other fields.

ScriptFilterA filter allowing to define scripts as filters.
ScriptScoreFunction

Modify a documents score using a script.

Shape

Defines a shape

SignificantTermsAggregation

An aggregation that returns interesting or unusual occurrences of terms in + a set.

Sort

Defines a sort value

SpanFirstQueryMatches spans near the beginning of a field.
SpanMultiTermQueryUse MultiTermQueries as a SpanQuery.
SpanNearQueryMatches spans which are near one another.
SpanNotQueryRemoves matches which overlap with another span query.
SpanOrQueryMatches the union of its span clauses.
SpanTermQueryMatches spans containing a term
StatisticalFacet

A facet which returns statistical information about a numeric field

StatsAggregation

Aggregation that computes stats over numeric values extracted from the + aggregated documents.

SumAggregation

Aggregation that sums up numeric values that are extracted from the + aggregated documents.

TermFilterConstructs a filter for docs matching the term added to this object.
TermQueryA Query that matches documents containing a term. This may be + combined with other terms with a BooleanQuery.
TermsAggregation

Defines an aggregation of unique values/terms.

TermsFacet

A facet which returns the N most frequent terms within a collection + or set of collections.

TermsFilterA Filter that matches documents containing provided terms.
TermsQueryA Query that matches documents containing provided terms.
TermStatsFacet

A facet which computes statistical data based on an aggregate key.

TermSuggester

A suggester that suggests terms based on edit distance.

TopChildrenQueryReturns child documents matching the query aggregated into the parent docs.
TopHitsAggregation

top_hits metric aggregator keeps track of the most relevant document being + aggregated.

TypeFilterFilter results by a specified index type.
ValueCountAggregation

Aggregation that counts the number of values that are extracted from the + aggregated documents.

WildcardQueryA Query that matches documents containing a wildcard. This may be + combined with other wildcards with a BooleanQuery.
+ + + + + + + + + +
+ + +
+ +
+

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo

+
+ +
+
+ + +
+ + diff --git a/dist/docs/img/glyphicons-halflings-white.png b/dist/docs/img/glyphicons-halflings-white.png new file mode 100644 index 0000000..3bf6484 Binary files /dev/null and b/dist/docs/img/glyphicons-halflings-white.png differ diff --git a/dist/docs/img/glyphicons-halflings.png b/dist/docs/img/glyphicons-halflings.png new file mode 100644 index 0000000..a996999 Binary files /dev/null and b/dist/docs/img/glyphicons-halflings.png differ diff --git a/dist/docs/scripts/lang-apollo.js b/dist/docs/scripts/lang-apollo.js new file mode 100644 index 0000000..7098baf --- /dev/null +++ b/dist/docs/scripts/lang-apollo.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["com",/^#[^\n\r]*/,null,"#"],["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r Â\xa0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,null,'"']],[["kwd",/^(?:ADS|AD|AUG|BZF|BZMF|CAE|CAF|CA|CCS|COM|CS|DAS|DCA|DCOM|DCS|DDOUBL|DIM|DOUBLE|DTCB|DTCF|DV|DXCH|EDRUPT|EXTEND|INCR|INDEX|NDX|INHINT|LXCH|MASK|MSK|MP|MSU|NOOP|OVSK|QXCH|RAND|READ|RELINT|RESUME|RETURN|ROR|RXOR|SQUARE|SU|TCR|TCAA|OVSK|TCF|TC|TS|WAND|WOR|WRITE|XCH|XLQ|XXALQ|ZL|ZQ|ADD|ADZ|SUB|SUZ|MPY|MPR|MPZ|DVP|COM|ABS|CLA|CLZ|LDQ|STO|STQ|ALS|LLS|LRS|TRA|TSQ|TMI|TOV|AXT|TIX|DLY|INP|OUT)\s/, +null],["typ",/^(?:-?GENADR|=MINUS|2BCADR|VN|BOF|MM|-?2CADR|-?[1-6]DNADR|ADRES|BBCON|[ES]?BANK=?|BLOCK|BNKSUM|E?CADR|COUNT\*?|2?DEC\*?|-?DNCHAN|-?DNPTR|EQUALS|ERASE|MEMORY|2?OCT|REMADR|SETLOC|SUBRO|ORG|BSS|BES|SYN|EQU|DEFINE|END)\s/,null],["lit",/^'(?:-*(?:\w|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?)?/],["pln",/^-*(?:[!-z]|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?/],["pun",/^[^\w\t\n\r "'-);\\\xa0]+/]]),["apollo","agc","aea"]); diff --git a/dist/docs/scripts/lang-clj.js b/dist/docs/scripts/lang-clj.js new file mode 100644 index 0000000..542a220 --- /dev/null +++ b/dist/docs/scripts/lang-clj.js @@ -0,0 +1,18 @@ +/* + Copyright (C) 2011 Google Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +var a=null; +PR.registerLangHandler(PR.createSimpleLexer([["opn",/^[([{]+/,a,"([{"],["clo",/^[)\]}]+/,a,")]}"],["com",/^;[^\n\r]*/,a,";"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \xa0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:def|if|do|let|quote|var|fn|loop|recur|throw|try|monitor-enter|monitor-exit|defmacro|defn|defn-|macroexpand|macroexpand-1|for|doseq|dosync|dotimes|and|or|when|not|assert|doto|proxy|defstruct|first|rest|cons|defprotocol|deftype|defrecord|reify|defmulti|defmethod|meta|with-meta|ns|in-ns|create-ns|import|intern|refer|alias|namespace|resolve|ref|deref|refset|new|set!|memfn|to-array|into-array|aset|gen-class|reduce|map|filter|find|nil?|empty?|hash-map|hash-set|vec|vector|seq|flatten|reverse|assoc|dissoc|list|list?|disj|get|union|difference|intersection|extend|extend-type|extend-protocol|prn)\b/,a], +["typ",/^:[\dA-Za-z-]+/]]),["clj"]); diff --git a/dist/docs/scripts/lang-css.js b/dist/docs/scripts/lang-css.js new file mode 100644 index 0000000..041e1f5 --- /dev/null +++ b/dist/docs/scripts/lang-css.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n "]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]*)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["com", +/^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]); diff --git a/dist/docs/scripts/lang-go.js b/dist/docs/scripts/lang-go.js new file mode 100644 index 0000000..fc18dc0 --- /dev/null +++ b/dist/docs/scripts/lang-go.js @@ -0,0 +1 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r Â\xa0"],["pln",/^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])+(?:'|$)|`[^`]*(?:`|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\n\r]*|\/\*[\S\s]*?\*\/)/],["pln",/^(?:[^"'/`]|\/(?![*/]))+/]]),["go"]); diff --git a/dist/docs/scripts/lang-hs.js b/dist/docs/scripts/lang-hs.js new file mode 100644 index 0000000..9d77b08 --- /dev/null +++ b/dist/docs/scripts/lang-hs.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t-\r ]+/,null,"\t\n \r "],["str",/^"(?:[^\n\f\r"\\]|\\[\S\s])*(?:"|$)/,null,'"'],["str",/^'(?:[^\n\f\r'\\]|\\[^&])'?/,null,"'"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)/i,null,"0123456789"]],[["com",/^(?:--+[^\n\f\r]*|{-(?:[^-]|-+[^}-])*-})/],["kwd",/^(?:case|class|data|default|deriving|do|else|if|import|in|infix|infixl|infixr|instance|let|module|newtype|of|then|type|where|_)(?=[^\d'A-Za-z]|$)/, +null],["pln",/^(?:[A-Z][\w']*\.)*[A-Za-z][\w']*/],["pun",/^[^\d\t-\r "'A-Za-z]+/]]),["hs"]); diff --git a/dist/docs/scripts/lang-lisp.js b/dist/docs/scripts/lang-lisp.js new file mode 100644 index 0000000..02a30e8 --- /dev/null +++ b/dist/docs/scripts/lang-lisp.js @@ -0,0 +1,3 @@ +var a=null; +PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,a,"("],["clo",/^\)+/,a,")"],["com",/^;[^\n\r]*/,a,";"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \xa0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/,a], +["lit",/^[+-]?(?:[#0]x[\da-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[de][+-]?\d+)?)/i],["lit",/^'(?:-*(?:\w|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?)?/],["pln",/^-*(?:[_a-z]|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?/i],["pun",/^[^\w\t\n\r "'-);\\\xa0]+/]]),["cl","el","lisp","scm"]); diff --git a/dist/docs/scripts/lang-lua.js b/dist/docs/scripts/lang-lua.js new file mode 100644 index 0000000..e83a3c4 --- /dev/null +++ b/dist/docs/scripts/lang-lua.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r Â\xa0"],["str",/^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$))/,null,"\"'"]],[["com",/^--(?:\[(=*)\[[\S\s]*?(?:]\1]|$)|[^\n\r]*)/],["str",/^\[(=*)\[[\S\s]*?(?:]\1]|$)/],["kwd",/^(?:and|break|do|else|elseif|end|false|for|function|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,null],["lit",/^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i], +["pln",/^[_a-z]\w*/i],["pun",/^[^\w\t\n\r \xa0][^\w\t\n\r "'+=\xa0-]*/]]),["lua"]); diff --git a/dist/docs/scripts/lang-ml.js b/dist/docs/scripts/lang-ml.js new file mode 100644 index 0000000..6df02d7 --- /dev/null +++ b/dist/docs/scripts/lang-ml.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r Â\xa0"],["com",/^#(?:if[\t\n\r \xa0]+(?:[$_a-z][\w']*|``[^\t\n\r`]*(?:``|$))|else|endif|light)/i,null,"#"],["str",/^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])(?:'|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\n\r]*|\(\*[\S\s]*?\*\))/],["kwd",/^(?:abstract|and|as|assert|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|if|in|inherit|inline|interface|internal|lazy|let|match|member|module|mutable|namespace|new|null|of|open|or|override|private|public|rec|return|static|struct|then|to|true|try|type|upcast|use|val|void|when|while|with|yield|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|global|include|method|mixin|object|parallel|process|protected|pure|sealed|trait|virtual|volatile)\b/], +["lit",/^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i],["pln",/^(?:[_a-z][\w']*[!#?]?|``[^\t\n\r`]*(?:``|$))/i],["pun",/^[^\w\t\n\r "'\xa0]+/]]),["fs","ml"]); diff --git a/dist/docs/scripts/lang-n.js b/dist/docs/scripts/lang-n.js new file mode 100644 index 0000000..6c2e85b --- /dev/null +++ b/dist/docs/scripts/lang-n.js @@ -0,0 +1,4 @@ +var a=null; +PR.registerLangHandler(PR.createSimpleLexer([["str",/^(?:'(?:[^\n\r'\\]|\\.)*'|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,a,'"'],["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,a,"#"],["pln",/^\s+/,a," \r\n\t\xa0"]],[["str",/^@"(?:[^"]|"")*(?:"|$)/,a],["str",/^<#[^#>]*(?:#>|$)/,a],["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,a],["com",/^\/\/[^\n\r]*/,a],["com",/^\/\*[\S\s]*?(?:\*\/|$)/, +a],["kwd",/^(?:abstract|and|as|base|catch|class|def|delegate|enum|event|extern|false|finally|fun|implements|interface|internal|is|macro|match|matches|module|mutable|namespace|new|null|out|override|params|partial|private|protected|public|ref|sealed|static|struct|syntax|this|throw|true|try|type|typeof|using|variant|virtual|volatile|when|where|with|assert|assert2|async|break|checked|continue|do|else|ensures|for|foreach|if|late|lock|new|nolate|otherwise|regexp|repeat|requires|return|surroundwith|unchecked|unless|using|while|yield)\b/, +a],["typ",/^(?:array|bool|byte|char|decimal|double|float|int|list|long|object|sbyte|short|string|ulong|uint|ufloat|ulong|ushort|void)\b/,a],["lit",/^@[$_a-z][\w$@]*/i,a],["typ",/^@[A-Z]+[a-z][\w$@]*/,a],["pln",/^'?[$_a-z][\w$@]*/i,a],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,a,"0123456789"],["pun",/^.[^\s\w"-$'./@`]*/,a]]),["n","nemerle"]); diff --git a/dist/docs/scripts/lang-proto.js b/dist/docs/scripts/lang-proto.js new file mode 100644 index 0000000..f006ad8 --- /dev/null +++ b/dist/docs/scripts/lang-proto.js @@ -0,0 +1 @@ +PR.registerLangHandler(PR.sourceDecorator({keywords:"bytes,default,double,enum,extend,extensions,false,group,import,max,message,option,optional,package,repeated,required,returns,rpc,service,syntax,to,true",types:/^(bool|(double|s?fixed|[su]?int)(32|64)|float|string)\b/,cStyleComments:!0}),["proto"]); diff --git a/dist/docs/scripts/lang-scala.js b/dist/docs/scripts/lang-scala.js new file mode 100644 index 0000000..60d034d --- /dev/null +++ b/dist/docs/scripts/lang-scala.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r Â\xa0"],["str",/^"(?:""(?:""?(?!")|[^"\\]|\\.)*"{0,3}|(?:[^\n\r"\\]|\\.)*"?)/,null,'"'],["lit",/^`(?:[^\n\r\\`]|\\.)*`?/,null,"`"],["pun",/^[!#%&(--:-@[-^{-~]+/,null,"!#%&()*+,-:;<=>?@[\\]^{|}~"]],[["str",/^'(?:[^\n\r'\\]|\\(?:'|[^\n\r']+))'/],["lit",/^'[$A-Z_a-z][\w$]*(?![\w$'])/],["kwd",/^(?:abstract|case|catch|class|def|do|else|extends|final|finally|for|forSome|if|implicit|import|lazy|match|new|object|override|package|private|protected|requires|return|sealed|super|throw|trait|try|type|val|var|while|with|yield)\b/], +["lit",/^(?:true|false|null|this)\b/],["lit",/^(?:0(?:[0-7]+|x[\da-f]+)l?|(?:0|[1-9]\d*)(?:(?:\.\d+)?(?:e[+-]?\d+)?f?|l?)|\\.\d+(?:e[+-]?\d+)?f?)/i],["typ",/^[$_]*[A-Z][\d$A-Z_]*[a-z][\w$]*/],["pln",/^[$A-Z_a-z][\w$]*/],["com",/^\/(?:\/.*|\*(?:\/|\**[^*/])*(?:\*+\/?)?)/],["pun",/^(?:\.+|\/)/]]),["scala"]); diff --git a/dist/docs/scripts/lang-sql.js b/dist/docs/scripts/lang-sql.js new file mode 100644 index 0000000..da705b0 --- /dev/null +++ b/dist/docs/scripts/lang-sql.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r Â\xa0"],["str",/^(?:"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')/,null,"\"'"]],[["com",/^(?:--[^\n\r]*|\/\*[\S\s]*?(?:\*\/|$))/],["kwd",/^(?:add|all|alter|and|any|as|asc|authorization|backup|begin|between|break|browse|bulk|by|cascade|case|check|checkpoint|close|clustered|coalesce|collate|column|commit|compute|constraint|contains|containstable|continue|convert|create|cross|current|current_date|current_time|current_timestamp|current_user|cursor|database|dbcc|deallocate|declare|default|delete|deny|desc|disk|distinct|distributed|double|drop|dummy|dump|else|end|errlvl|escape|except|exec|execute|exists|exit|fetch|file|fillfactor|for|foreign|freetext|freetexttable|from|full|function|goto|grant|group|having|holdlock|identity|identitycol|identity_insert|if|in|index|inner|insert|intersect|into|is|join|key|kill|left|like|lineno|load|match|merge|national|nocheck|nonclustered|not|null|nullif|of|off|offsets|on|open|opendatasource|openquery|openrowset|openxml|option|or|order|outer|over|percent|plan|precision|primary|print|proc|procedure|public|raiserror|read|readtext|reconfigure|references|replication|restore|restrict|return|revoke|right|rollback|rowcount|rowguidcol|rule|save|schema|select|session_user|set|setuser|shutdown|some|statistics|system_user|table|textsize|then|to|top|tran|transaction|trigger|truncate|tsequal|union|unique|update|updatetext|use|user|using|values|varying|view|waitfor|when|where|while|with|writetext)(?=[^\w-]|$)/i, +null],["lit",/^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i],["pln",/^[_a-z][\w-]*/i],["pun",/^[^\w\t\n\r "'\xa0][^\w\t\n\r "'+\xa0-]*/]]),["sql"]); diff --git a/dist/docs/scripts/lang-tex.js b/dist/docs/scripts/lang-tex.js new file mode 100644 index 0000000..ce96fbb --- /dev/null +++ b/dist/docs/scripts/lang-tex.js @@ -0,0 +1 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r Â\xa0"],["com",/^%[^\n\r]*/,null,"%"]],[["kwd",/^\\[@-Za-z]+/],["kwd",/^\\./],["typ",/^[$&]/],["lit",/[+-]?(?:\.\d+|\d+(?:\.\d*)?)(cm|em|ex|in|pc|pt|bp|mm)/i],["pun",/^[()=[\]{}]+/]]),["latex","tex"]); diff --git a/dist/docs/scripts/lang-vb.js b/dist/docs/scripts/lang-vb.js new file mode 100644 index 0000000..07506b0 --- /dev/null +++ b/dist/docs/scripts/lang-vb.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0\u2028\u2029]+/,null,"\t\n\r Â\xa0

"],["str",/^(?:["\u201c\u201d](?:[^"\u201c\u201d]|["\u201c\u201d]{2})(?:["\u201c\u201d]c|$)|["\u201c\u201d](?:[^"\u201c\u201d]|["\u201c\u201d]{2})*(?:["\u201c\u201d]|$))/i,null,'"“â€'],["com",/^['\u2018\u2019].*/,null,"'‘’"]],[["kwd",/^(?:addhandler|addressof|alias|and|andalso|ansi|as|assembly|auto|boolean|byref|byte|byval|call|case|catch|cbool|cbyte|cchar|cdate|cdbl|cdec|char|cint|class|clng|cobj|const|cshort|csng|cstr|ctype|date|decimal|declare|default|delegate|dim|directcast|do|double|each|else|elseif|end|endif|enum|erase|error|event|exit|finally|for|friend|function|get|gettype|gosub|goto|handles|if|implements|imports|in|inherits|integer|interface|is|let|lib|like|long|loop|me|mod|module|mustinherit|mustoverride|mybase|myclass|namespace|new|next|not|notinheritable|notoverridable|object|on|option|optional|or|orelse|overloads|overridable|overrides|paramarray|preserve|private|property|protected|public|raiseevent|readonly|redim|removehandler|resume|return|select|set|shadows|shared|short|single|static|step|stop|string|structure|sub|synclock|then|throw|to|try|typeof|unicode|until|variant|wend|when|while|with|withevents|writeonly|xor|endif|gosub|let|variant|wend)\b/i, +null],["com",/^rem.*/i],["lit",/^(?:true\b|false\b|nothing\b|\d+(?:e[+-]?\d+[dfr]?|[dfilrs])?|(?:&h[\da-f]+|&o[0-7]+)[ils]?|\d*\.\d+(?:e[+-]?\d+)?[dfr]?|#\s+(?:\d+[/-]\d+[/-]\d+(?:\s+\d+:\d+(?::\d+)?(\s*(?:am|pm))?)?|\d+:\d+(?::\d+)?(\s*(?:am|pm))?)\s+#)/i],["pln",/^(?:(?:[a-z]|_\w)\w*|\[(?:[a-z]|_\w)\w*])/i],["pun",/^[^\w\t\n\r "'[\]\xa0\u2018\u2019\u201c\u201d\u2028\u2029]+/],["pun",/^(?:\[|])/]]),["vb","vbs"]); diff --git a/dist/docs/scripts/lang-vhdl.js b/dist/docs/scripts/lang-vhdl.js new file mode 100644 index 0000000..128b5b6 --- /dev/null +++ b/dist/docs/scripts/lang-vhdl.js @@ -0,0 +1,3 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r Â\xa0"]],[["str",/^(?:[box]?"(?:[^"]|"")*"|'.')/i],["com",/^--[^\n\r]*/],["kwd",/^(?:abs|access|after|alias|all|and|architecture|array|assert|attribute|begin|block|body|buffer|bus|case|component|configuration|constant|disconnect|downto|else|elsif|end|entity|exit|file|for|function|generate|generic|group|guarded|if|impure|in|inertial|inout|is|label|library|linkage|literal|loop|map|mod|nand|new|next|nor|not|null|of|on|open|or|others|out|package|port|postponed|procedure|process|pure|range|record|register|reject|rem|report|return|rol|ror|select|severity|shared|signal|sla|sll|sra|srl|subtype|then|to|transport|type|unaffected|units|until|use|variable|wait|when|while|with|xnor|xor)(?=[^\w-]|$)/i, +null],["typ",/^(?:bit|bit_vector|character|boolean|integer|real|time|string|severity_level|positive|natural|signed|unsigned|line|text|std_u?logic(?:_vector)?)(?=[^\w-]|$)/i,null],["typ",/^'(?:active|ascending|base|delayed|driving|driving_value|event|high|image|instance_name|last_active|last_event|last_value|left|leftof|length|low|path_name|pos|pred|quiet|range|reverse_range|right|rightof|simple_name|stable|succ|transaction|val|value)(?=[^\w-]|$)/i,null],["lit",/^\d+(?:_\d+)*(?:#[\w.\\]+#(?:[+-]?\d+(?:_\d+)*)?|(?:\.\d+(?:_\d+)*)?(?:e[+-]?\d+(?:_\d+)*)?)/i], +["pln",/^(?:[a-z]\w*|\\[^\\]*\\)/i],["pun",/^[^\w\t\n\r "'\xa0][^\w\t\n\r "'\xa0-]*/]]),["vhdl","vhd"]); diff --git a/dist/docs/scripts/lang-wiki.js b/dist/docs/scripts/lang-wiki.js new file mode 100644 index 0000000..9b0b448 --- /dev/null +++ b/dist/docs/scripts/lang-wiki.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\d\t a-gi-z\xa0]+/,null,"\t Â\xa0abcdefgijklmnopqrstuvwxyz0123456789"],["pun",/^[*=[\]^~]+/,null,"=*~^[]"]],[["lang-wiki.meta",/(?:^^|\r\n?|\n)(#[a-z]+)\b/],["lit",/^[A-Z][a-z][\da-z]+[A-Z][a-z][^\W_]+\b/],["lang-",/^{{{([\S\s]+?)}}}/],["lang-",/^`([^\n\r`]+)`/],["str",/^https?:\/\/[^\s#/?]*(?:\/[^\s#?]*)?(?:\?[^\s#]*)?(?:#\S*)?/i],["pln",/^(?:\r\n|[\S\s])[^\n\r#*=A-[^`h{~]*/]]),["wiki"]); +PR.registerLangHandler(PR.createSimpleLexer([["kwd",/^#[a-z]+/i,null,"#"]],[]),["wiki.meta"]); diff --git a/dist/docs/scripts/lang-xq.js b/dist/docs/scripts/lang-xq.js new file mode 100644 index 0000000..e323ae3 --- /dev/null +++ b/dist/docs/scripts/lang-xq.js @@ -0,0 +1,3 @@ +PR.registerLangHandler(PR.createSimpleLexer([["var pln",/^\$[\w-]+/,null,"$"]],[["pln",/^[\s=][<>][\s=]/],["lit",/^@[\w-]+/],["tag",/^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["com",/^\(:[\S\s]*?:\)/],["pln",/^[(),/;[\]{}]$/],["str",/^(?:"(?:[^"\\{]|\\[\S\s])*(?:"|$)|'(?:[^'\\{]|\\[\S\s])*(?:'|$))/,null,"\"'"],["kwd",/^(?:xquery|where|version|variable|union|typeswitch|treat|to|then|text|stable|sortby|some|self|schema|satisfies|returns|return|ref|processing-instruction|preceding-sibling|preceding|precedes|parent|only|of|node|namespace|module|let|item|intersect|instance|in|import|if|function|for|follows|following-sibling|following|external|except|every|else|element|descending|descendant-or-self|descendant|define|default|declare|comment|child|cast|case|before|attribute|assert|ascending|as|ancestor-or-self|ancestor|after|eq|order|by|or|and|schema-element|document-node|node|at)\b/], +["typ",/^(?:xs:yearMonthDuration|xs:unsignedLong|xs:time|xs:string|xs:short|xs:QName|xs:Name|xs:long|xs:integer|xs:int|xs:gYearMonth|xs:gYear|xs:gMonthDay|xs:gDay|xs:float|xs:duration|xs:double|xs:decimal|xs:dayTimeDuration|xs:dateTime|xs:date|xs:byte|xs:boolean|xs:anyURI|xf:yearMonthDuration)\b/,null],["fun pln",/^(?:xp:dereference|xinc:node-expand|xinc:link-references|xinc:link-expand|xhtml:restructure|xhtml:clean|xhtml:add-lists|xdmp:zip-manifest|xdmp:zip-get|xdmp:zip-create|xdmp:xquery-version|xdmp:word-convert|xdmp:with-namespaces|xdmp:version|xdmp:value|xdmp:user-roles|xdmp:user-last-login|xdmp:user|xdmp:url-encode|xdmp:url-decode|xdmp:uri-is-file|xdmp:uri-format|xdmp:uri-content-type|xdmp:unquote|xdmp:unpath|xdmp:triggers-database|xdmp:trace|xdmp:to-json|xdmp:tidy|xdmp:subbinary|xdmp:strftime|xdmp:spawn-in|xdmp:spawn|xdmp:sleep|xdmp:shutdown|xdmp:set-session-field|xdmp:set-response-encoding|xdmp:set-response-content-type|xdmp:set-response-code|xdmp:set-request-time-limit|xdmp:set|xdmp:servers|xdmp:server-status|xdmp:server-name|xdmp:server|xdmp:security-database|xdmp:security-assert|xdmp:schema-database|xdmp:save|xdmp:role-roles|xdmp:role|xdmp:rethrow|xdmp:restart|xdmp:request-timestamp|xdmp:request-status|xdmp:request-cancel|xdmp:request|xdmp:redirect-response|xdmp:random|xdmp:quote|xdmp:query-trace|xdmp:query-meters|xdmp:product-edition|xdmp:privilege-roles|xdmp:privilege|xdmp:pretty-print|xdmp:powerpoint-convert|xdmp:platform|xdmp:permission|xdmp:pdf-convert|xdmp:path|xdmp:octal-to-integer|xdmp:node-uri|xdmp:node-replace|xdmp:node-kind|xdmp:node-insert-child|xdmp:node-insert-before|xdmp:node-insert-after|xdmp:node-delete|xdmp:node-database|xdmp:mul64|xdmp:modules-root|xdmp:modules-database|xdmp:merging|xdmp:merge-cancel|xdmp:merge|xdmp:md5|xdmp:logout|xdmp:login|xdmp:log-level|xdmp:log|xdmp:lock-release|xdmp:lock-acquire|xdmp:load|xdmp:invoke-in|xdmp:invoke|xdmp:integer-to-octal|xdmp:integer-to-hex|xdmp:http-put|xdmp:http-post|xdmp:http-options|xdmp:http-head|xdmp:http-get|xdmp:http-delete|xdmp:hosts|xdmp:host-status|xdmp:host-name|xdmp:host|xdmp:hex-to-integer|xdmp:hash64|xdmp:hash32|xdmp:has-privilege|xdmp:groups|xdmp:group-serves|xdmp:group-servers|xdmp:group-name|xdmp:group-hosts|xdmp:group|xdmp:get-session-field-names|xdmp:get-session-field|xdmp:get-response-encoding|xdmp:get-response-code|xdmp:get-request-username|xdmp:get-request-user|xdmp:get-request-url|xdmp:get-request-protocol|xdmp:get-request-path|xdmp:get-request-method|xdmp:get-request-header-names|xdmp:get-request-header|xdmp:get-request-field-names|xdmp:get-request-field-filename|xdmp:get-request-field-content-type|xdmp:get-request-field|xdmp:get-request-client-certificate|xdmp:get-request-client-address|xdmp:get-request-body|xdmp:get-current-user|xdmp:get-current-roles|xdmp:get|xdmp:function-name|xdmp:function-module|xdmp:function|xdmp:from-json|xdmp:forests|xdmp:forest-status|xdmp:forest-restore|xdmp:forest-restart|xdmp:forest-name|xdmp:forest-delete|xdmp:forest-databases|xdmp:forest-counts|xdmp:forest-clear|xdmp:forest-backup|xdmp:forest|xdmp:filesystem-file|xdmp:filesystem-directory|xdmp:exists|xdmp:excel-convert|xdmp:eval-in|xdmp:eval|xdmp:estimate|xdmp:email|xdmp:element-content-type|xdmp:elapsed-time|xdmp:document-set-quality|xdmp:document-set-property|xdmp:document-set-properties|xdmp:document-set-permissions|xdmp:document-set-collections|xdmp:document-remove-properties|xdmp:document-remove-permissions|xdmp:document-remove-collections|xdmp:document-properties|xdmp:document-locks|xdmp:document-load|xdmp:document-insert|xdmp:document-get-quality|xdmp:document-get-properties|xdmp:document-get-permissions|xdmp:document-get-collections|xdmp:document-get|xdmp:document-forest|xdmp:document-delete|xdmp:document-add-properties|xdmp:document-add-permissions|xdmp:document-add-collections|xdmp:directory-properties|xdmp:directory-locks|xdmp:directory-delete|xdmp:directory-create|xdmp:directory|xdmp:diacritic-less|xdmp:describe|xdmp:default-permissions|xdmp:default-collections|xdmp:databases|xdmp:database-restore-validate|xdmp:database-restore-status|xdmp:database-restore-cancel|xdmp:database-restore|xdmp:database-name|xdmp:database-forests|xdmp:database-backup-validate|xdmp:database-backup-status|xdmp:database-backup-purge|xdmp:database-backup-cancel|xdmp:database-backup|xdmp:database|xdmp:collection-properties|xdmp:collection-locks|xdmp:collection-delete|xdmp:collation-canonical-uri|xdmp:castable-as|xdmp:can-grant-roles|xdmp:base64-encode|xdmp:base64-decode|xdmp:architecture|xdmp:apply|xdmp:amp-roles|xdmp:amp|xdmp:add64|xdmp:add-response-header|xdmp:access|trgr:trigger-set-recursive|trgr:trigger-set-permissions|trgr:trigger-set-name|trgr:trigger-set-module|trgr:trigger-set-event|trgr:trigger-set-description|trgr:trigger-remove-permissions|trgr:trigger-module|trgr:trigger-get-permissions|trgr:trigger-enable|trgr:trigger-disable|trgr:trigger-database-online-event|trgr:trigger-data-event|trgr:trigger-add-permissions|trgr:remove-trigger|trgr:property-content|trgr:pre-commit|trgr:post-commit|trgr:get-trigger-by-id|trgr:get-trigger|trgr:document-scope|trgr:document-content|trgr:directory-scope|trgr:create-trigger|trgr:collection-scope|trgr:any-property-content|thsr:set-entry|thsr:remove-term|thsr:remove-synonym|thsr:remove-entry|thsr:query-lookup|thsr:lookup|thsr:load|thsr:insert|thsr:expand|thsr:add-synonym|spell:suggest-detailed|spell:suggest|spell:remove-word|spell:make-dictionary|spell:load|spell:levenshtein-distance|spell:is-correct|spell:insert|spell:double-metaphone|spell:add-word|sec:users-collection|sec:user-set-roles|sec:user-set-password|sec:user-set-name|sec:user-set-description|sec:user-set-default-permissions|sec:user-set-default-collections|sec:user-remove-roles|sec:user-privileges|sec:user-get-roles|sec:user-get-description|sec:user-get-default-permissions|sec:user-get-default-collections|sec:user-doc-permissions|sec:user-doc-collections|sec:user-add-roles|sec:unprotect-collection|sec:uid-for-name|sec:set-realm|sec:security-version|sec:security-namespace|sec:security-installed|sec:security-collection|sec:roles-collection|sec:role-set-roles|sec:role-set-name|sec:role-set-description|sec:role-set-default-permissions|sec:role-set-default-collections|sec:role-remove-roles|sec:role-privileges|sec:role-get-roles|sec:role-get-description|sec:role-get-default-permissions|sec:role-get-default-collections|sec:role-doc-permissions|sec:role-doc-collections|sec:role-add-roles|sec:remove-user|sec:remove-role-from-users|sec:remove-role-from-role|sec:remove-role-from-privileges|sec:remove-role-from-amps|sec:remove-role|sec:remove-privilege|sec:remove-amp|sec:protect-collection|sec:privileges-collection|sec:privilege-set-roles|sec:privilege-set-name|sec:privilege-remove-roles|sec:privilege-get-roles|sec:privilege-add-roles|sec:priv-doc-permissions|sec:priv-doc-collections|sec:get-user-names|sec:get-unique-elem-id|sec:get-role-names|sec:get-role-ids|sec:get-privilege|sec:get-distinct-permissions|sec:get-collection|sec:get-amp|sec:create-user-with-role|sec:create-user|sec:create-role|sec:create-privilege|sec:create-amp|sec:collections-collection|sec:collection-set-permissions|sec:collection-remove-permissions|sec:collection-get-permissions|sec:collection-add-permissions|sec:check-admin|sec:amps-collection|sec:amp-set-roles|sec:amp-remove-roles|sec:amp-get-roles|sec:amp-doc-permissions|sec:amp-doc-collections|sec:amp-add-roles|search:unparse|search:suggest|search:snippet|search:search|search:resolve-nodes|search:resolve|search:remove-constraint|search:parse|search:get-default-options|search:estimate|search:check-options|prof:value|prof:reset|prof:report|prof:invoke|prof:eval|prof:enable|prof:disable|prof:allowed|ppt:clean|pki:template-set-request|pki:template-set-name|pki:template-set-key-type|pki:template-set-key-options|pki:template-set-description|pki:template-in-use|pki:template-get-version|pki:template-get-request|pki:template-get-name|pki:template-get-key-type|pki:template-get-key-options|pki:template-get-id|pki:template-get-description|pki:need-certificate|pki:is-temporary|pki:insert-trusted-certificates|pki:insert-template|pki:insert-signed-certificates|pki:insert-certificate-revocation-list|pki:get-trusted-certificate-ids|pki:get-template-ids|pki:get-template-certificate-authority|pki:get-template-by-name|pki:get-template|pki:get-pending-certificate-requests-xml|pki:get-pending-certificate-requests-pem|pki:get-pending-certificate-request|pki:get-certificates-for-template-xml|pki:get-certificates-for-template|pki:get-certificates|pki:get-certificate-xml|pki:get-certificate-pem|pki:get-certificate|pki:generate-temporary-certificate-if-necessary|pki:generate-temporary-certificate|pki:generate-template-certificate-authority|pki:generate-certificate-request|pki:delete-template|pki:delete-certificate|pki:create-template|pdf:make-toc|pdf:insert-toc-headers|pdf:get-toc|pdf:clean|p:status-transition|p:state-transition|p:remove|p:pipelines|p:insert|p:get-by-id|p:get|p:execute|p:create|p:condition|p:collection|p:action|ooxml:runs-merge|ooxml:package-uris|ooxml:package-parts-insert|ooxml:package-parts|msword:clean|mcgm:polygon|mcgm:point|mcgm:geospatial-query-from-elements|mcgm:geospatial-query|mcgm:circle|math:tanh|math:tan|math:sqrt|math:sinh|math:sin|math:pow|math:modf|math:log10|math:log|math:ldexp|math:frexp|math:fmod|math:floor|math:fabs|math:exp|math:cosh|math:cos|math:ceil|math:atan2|math:atan|math:asin|math:acos|map:put|map:map|map:keys|map:get|map:delete|map:count|map:clear|lnk:to|lnk:remove|lnk:insert|lnk:get|lnk:from|lnk:create|kml:polygon|kml:point|kml:interior-polygon|kml:geospatial-query-from-elements|kml:geospatial-query|kml:circle|kml:box|gml:polygon|gml:point|gml:interior-polygon|gml:geospatial-query-from-elements|gml:geospatial-query|gml:circle|gml:box|georss:point|georss:geospatial-query|georss:circle|geo:polygon|geo:point|geo:interior-polygon|geo:geospatial-query-from-elements|geo:geospatial-query|geo:circle|geo:box|fn:zero-or-one|fn:years-from-duration|fn:year-from-dateTime|fn:year-from-date|fn:upper-case|fn:unordered|fn:true|fn:translate|fn:trace|fn:tokenize|fn:timezone-from-time|fn:timezone-from-dateTime|fn:timezone-from-date|fn:sum|fn:subtract-dateTimes-yielding-yearMonthDuration|fn:subtract-dateTimes-yielding-dayTimeDuration|fn:substring-before|fn:substring-after|fn:substring|fn:subsequence|fn:string-to-codepoints|fn:string-pad|fn:string-length|fn:string-join|fn:string|fn:static-base-uri|fn:starts-with|fn:seconds-from-time|fn:seconds-from-duration|fn:seconds-from-dateTime|fn:round-half-to-even|fn:round|fn:root|fn:reverse|fn:resolve-uri|fn:resolve-QName|fn:replace|fn:remove|fn:QName|fn:prefix-from-QName|fn:position|fn:one-or-more|fn:number|fn:not|fn:normalize-unicode|fn:normalize-space|fn:node-name|fn:node-kind|fn:nilled|fn:namespace-uri-from-QName|fn:namespace-uri-for-prefix|fn:namespace-uri|fn:name|fn:months-from-duration|fn:month-from-dateTime|fn:month-from-date|fn:minutes-from-time|fn:minutes-from-duration|fn:minutes-from-dateTime|fn:min|fn:max|fn:matches|fn:lower-case|fn:local-name-from-QName|fn:local-name|fn:last|fn:lang|fn:iri-to-uri|fn:insert-before|fn:index-of|fn:in-scope-prefixes|fn:implicit-timezone|fn:idref|fn:id|fn:hours-from-time|fn:hours-from-duration|fn:hours-from-dateTime|fn:floor|fn:false|fn:expanded-QName|fn:exists|fn:exactly-one|fn:escape-uri|fn:escape-html-uri|fn:error|fn:ends-with|fn:encode-for-uri|fn:empty|fn:document-uri|fn:doc-available|fn:doc|fn:distinct-values|fn:distinct-nodes|fn:default-collation|fn:deep-equal|fn:days-from-duration|fn:day-from-dateTime|fn:day-from-date|fn:data|fn:current-time|fn:current-dateTime|fn:current-date|fn:count|fn:contains|fn:concat|fn:compare|fn:collection|fn:codepoints-to-string|fn:codepoint-equal|fn:ceiling|fn:boolean|fn:base-uri|fn:avg|fn:adjust-time-to-timezone|fn:adjust-dateTime-to-timezone|fn:adjust-date-to-timezone|fn:abs|feed:unsubscribe|feed:subscription|feed:subscribe|feed:request|feed:item|feed:description|excel:clean|entity:enrich|dom:set-pipelines|dom:set-permissions|dom:set-name|dom:set-evaluation-context|dom:set-domain-scope|dom:set-description|dom:remove-pipeline|dom:remove-permissions|dom:remove|dom:get|dom:evaluation-context|dom:domains|dom:domain-scope|dom:create|dom:configuration-set-restart-user|dom:configuration-set-permissions|dom:configuration-set-evaluation-context|dom:configuration-set-default-domain|dom:configuration-get|dom:configuration-create|dom:collection|dom:add-pipeline|dom:add-permissions|dls:retention-rules|dls:retention-rule-remove|dls:retention-rule-insert|dls:retention-rule|dls:purge|dls:node-expand|dls:link-references|dls:link-expand|dls:documents-query|dls:document-versions-query|dls:document-version-uri|dls:document-version-query|dls:document-version-delete|dls:document-version-as-of|dls:document-version|dls:document-update|dls:document-unmanage|dls:document-set-quality|dls:document-set-property|dls:document-set-properties|dls:document-set-permissions|dls:document-set-collections|dls:document-retention-rules|dls:document-remove-properties|dls:document-remove-permissions|dls:document-remove-collections|dls:document-purge|dls:document-manage|dls:document-is-managed|dls:document-insert-and-manage|dls:document-include-query|dls:document-history|dls:document-get-permissions|dls:document-extract-part|dls:document-delete|dls:document-checkout-status|dls:document-checkout|dls:document-checkin|dls:document-add-properties|dls:document-add-permissions|dls:document-add-collections|dls:break-checkout|dls:author-query|dls:as-of-query|dbk:convert|dbg:wait|dbg:value|dbg:stopped|dbg:stop|dbg:step|dbg:status|dbg:stack|dbg:out|dbg:next|dbg:line|dbg:invoke|dbg:function|dbg:finish|dbg:expr|dbg:eval|dbg:disconnect|dbg:detach|dbg:continue|dbg:connect|dbg:clear|dbg:breakpoints|dbg:break|dbg:attached|dbg:attach|cvt:save-converted-documents|cvt:part-uri|cvt:destination-uri|cvt:basepath|cvt:basename|cts:words|cts:word-query-weight|cts:word-query-text|cts:word-query-options|cts:word-query|cts:word-match|cts:walk|cts:uris|cts:uri-match|cts:train|cts:tokenize|cts:thresholds|cts:stem|cts:similar-query-weight|cts:similar-query-nodes|cts:similar-query|cts:shortest-distance|cts:search|cts:score|cts:reverse-query-weight|cts:reverse-query-nodes|cts:reverse-query|cts:remainder|cts:registered-query-weight|cts:registered-query-options|cts:registered-query-ids|cts:registered-query|cts:register|cts:query|cts:quality|cts:properties-query-query|cts:properties-query|cts:polygon-vertices|cts:polygon|cts:point-longitude|cts:point-latitude|cts:point|cts:or-query-queries|cts:or-query|cts:not-query-weight|cts:not-query-query|cts:not-query|cts:near-query-weight|cts:near-query-queries|cts:near-query-options|cts:near-query-distance|cts:near-query|cts:highlight|cts:geospatial-co-occurrences|cts:frequency|cts:fitness|cts:field-words|cts:field-word-query-weight|cts:field-word-query-text|cts:field-word-query-options|cts:field-word-query-field-name|cts:field-word-query|cts:field-word-match|cts:entity-highlight|cts:element-words|cts:element-word-query-weight|cts:element-word-query-text|cts:element-word-query-options|cts:element-word-query-element-name|cts:element-word-query|cts:element-word-match|cts:element-values|cts:element-value-ranges|cts:element-value-query-weight|cts:element-value-query-text|cts:element-value-query-options|cts:element-value-query-element-name|cts:element-value-query|cts:element-value-match|cts:element-value-geospatial-co-occurrences|cts:element-value-co-occurrences|cts:element-range-query-weight|cts:element-range-query-value|cts:element-range-query-options|cts:element-range-query-operator|cts:element-range-query-element-name|cts:element-range-query|cts:element-query-query|cts:element-query-element-name|cts:element-query|cts:element-pair-geospatial-values|cts:element-pair-geospatial-value-match|cts:element-pair-geospatial-query-weight|cts:element-pair-geospatial-query-region|cts:element-pair-geospatial-query-options|cts:element-pair-geospatial-query-longitude-name|cts:element-pair-geospatial-query-latitude-name|cts:element-pair-geospatial-query-element-name|cts:element-pair-geospatial-query|cts:element-pair-geospatial-boxes|cts:element-geospatial-values|cts:element-geospatial-value-match|cts:element-geospatial-query-weight|cts:element-geospatial-query-region|cts:element-geospatial-query-options|cts:element-geospatial-query-element-name|cts:element-geospatial-query|cts:element-geospatial-boxes|cts:element-child-geospatial-values|cts:element-child-geospatial-value-match|cts:element-child-geospatial-query-weight|cts:element-child-geospatial-query-region|cts:element-child-geospatial-query-options|cts:element-child-geospatial-query-element-name|cts:element-child-geospatial-query-child-name|cts:element-child-geospatial-query|cts:element-child-geospatial-boxes|cts:element-attribute-words|cts:element-attribute-word-query-weight|cts:element-attribute-word-query-text|cts:element-attribute-word-query-options|cts:element-attribute-word-query-element-name|cts:element-attribute-word-query-attribute-name|cts:element-attribute-word-query|cts:element-attribute-word-match|cts:element-attribute-values|cts:element-attribute-value-ranges|cts:element-attribute-value-query-weight|cts:element-attribute-value-query-text|cts:element-attribute-value-query-options|cts:element-attribute-value-query-element-name|cts:element-attribute-value-query-attribute-name|cts:element-attribute-value-query|cts:element-attribute-value-match|cts:element-attribute-value-geospatial-co-occurrences|cts:element-attribute-value-co-occurrences|cts:element-attribute-range-query-weight|cts:element-attribute-range-query-value|cts:element-attribute-range-query-options|cts:element-attribute-range-query-operator|cts:element-attribute-range-query-element-name|cts:element-attribute-range-query-attribute-name|cts:element-attribute-range-query|cts:element-attribute-pair-geospatial-values|cts:element-attribute-pair-geospatial-value-match|cts:element-attribute-pair-geospatial-query-weight|cts:element-attribute-pair-geospatial-query-region|cts:element-attribute-pair-geospatial-query-options|cts:element-attribute-pair-geospatial-query-longitude-name|cts:element-attribute-pair-geospatial-query-latitude-name|cts:element-attribute-pair-geospatial-query-element-name|cts:element-attribute-pair-geospatial-query|cts:element-attribute-pair-geospatial-boxes|cts:document-query-uris|cts:document-query|cts:distance|cts:directory-query-uris|cts:directory-query-depth|cts:directory-query|cts:destination|cts:deregister|cts:contains|cts:confidence|cts:collections|cts:collection-query-uris|cts:collection-query|cts:collection-match|cts:classify|cts:circle-radius|cts:circle-center|cts:circle|cts:box-west|cts:box-south|cts:box-north|cts:box-east|cts:box|cts:bearing|cts:arc-intersection|cts:and-query-queries|cts:and-query-options|cts:and-query|cts:and-not-query-positive-query|cts:and-not-query-negative-query|cts:and-not-query|css:get|css:convert|cpf:success|cpf:failure|cpf:document-set-state|cpf:document-set-processing-status|cpf:document-set-last-updated|cpf:document-set-error|cpf:document-get-state|cpf:document-get-processing-status|cpf:document-get-last-updated|cpf:document-get-error|cpf:check-transition|alert:spawn-matching-actions|alert:rule-user-id-query|alert:rule-set-user-id|alert:rule-set-query|alert:rule-set-options|alert:rule-set-name|alert:rule-set-description|alert:rule-set-action|alert:rule-remove|alert:rule-name-query|alert:rule-insert|alert:rule-id-query|alert:rule-get-user-id|alert:rule-get-query|alert:rule-get-options|alert:rule-get-name|alert:rule-get-id|alert:rule-get-description|alert:rule-get-action|alert:rule-action-query|alert:remove-triggers|alert:make-rule|alert:make-log-action|alert:make-config|alert:make-action|alert:invoke-matching-actions|alert:get-my-rules|alert:get-all-rules|alert:get-actions|alert:find-matching-rules|alert:create-triggers|alert:config-set-uri|alert:config-set-trigger-ids|alert:config-set-options|alert:config-set-name|alert:config-set-description|alert:config-set-cpf-domain-names|alert:config-set-cpf-domain-ids|alert:config-insert|alert:config-get-uri|alert:config-get-trigger-ids|alert:config-get-options|alert:config-get-name|alert:config-get-id|alert:config-get-description|alert:config-get-cpf-domain-names|alert:config-get-cpf-domain-ids|alert:config-get|alert:config-delete|alert:action-set-options|alert:action-set-name|alert:action-set-module-root|alert:action-set-module-db|alert:action-set-module|alert:action-set-description|alert:action-remove|alert:action-insert|alert:action-get-options|alert:action-get-name|alert:action-get-module-root|alert:action-get-module-db|alert:action-get-module|alert:action-get-description|zero-or-one|years-from-duration|year-from-dateTime|year-from-date|upper-case|unordered|true|translate|trace|tokenize|timezone-from-time|timezone-from-dateTime|timezone-from-date|sum|subtract-dateTimes-yielding-yearMonthDuration|subtract-dateTimes-yielding-dayTimeDuration|substring-before|substring-after|substring|subsequence|string-to-codepoints|string-pad|string-length|string-join|string|static-base-uri|starts-with|seconds-from-time|seconds-from-duration|seconds-from-dateTime|round-half-to-even|round|root|reverse|resolve-uri|resolve-QName|replace|remove|QName|prefix-from-QName|position|one-or-more|number|not|normalize-unicode|normalize-space|node-name|node-kind|nilled|namespace-uri-from-QName|namespace-uri-for-prefix|namespace-uri|name|months-from-duration|month-from-dateTime|month-from-date|minutes-from-time|minutes-from-duration|minutes-from-dateTime|min|max|matches|lower-case|local-name-from-QName|local-name|last|lang|iri-to-uri|insert-before|index-of|in-scope-prefixes|implicit-timezone|idref|id|hours-from-time|hours-from-duration|hours-from-dateTime|floor|false|expanded-QName|exists|exactly-one|escape-uri|escape-html-uri|error|ends-with|encode-for-uri|empty|document-uri|doc-available|doc|distinct-values|distinct-nodes|default-collation|deep-equal|days-from-duration|day-from-dateTime|day-from-date|data|current-time|current-dateTime|current-date|count|contains|concat|compare|collection|codepoints-to-string|codepoint-equal|ceiling|boolean|base-uri|avg|adjust-time-to-timezone|adjust-dateTime-to-timezone|adjust-date-to-timezone|abs)\b/], +["pln",/^[\w:-]+/],["pln",/^[\t\n\r \xa0]+/]]),["xq","xquery"]); diff --git a/dist/docs/scripts/lang-yaml.js b/dist/docs/scripts/lang-yaml.js new file mode 100644 index 0000000..c38729b --- /dev/null +++ b/dist/docs/scripts/lang-yaml.js @@ -0,0 +1,2 @@ +var a=null; +PR.registerLangHandler(PR.createSimpleLexer([["pun",/^[:>?|]+/,a,":|>?"],["dec",/^%(?:YAML|TAG)[^\n\r#]+/,a,"%"],["typ",/^&\S+/,a,"&"],["typ",/^!\S*/,a,"!"],["str",/^"(?:[^"\\]|\\.)*(?:"|$)/,a,'"'],["str",/^'(?:[^']|'')*(?:'|$)/,a,"'"],["com",/^#[^\n\r]*/,a,"#"],["pln",/^\s+/,a," \t\r\n"]],[["dec",/^(?:---|\.\.\.)(?:[\n\r]|$)/],["pun",/^-/],["kwd",/^\w+:[\n\r ]/],["pln",/^\w+/]]),["yaml","yml"]); diff --git a/dist/docs/scripts/prettify.js b/dist/docs/scripts/prettify.js new file mode 100644 index 0000000..eef5ad7 --- /dev/null +++ b/dist/docs/scripts/prettify.js @@ -0,0 +1,28 @@ +var q=null;window.PR_SHOULD_USE_CONTINUATION=!0; +(function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a= +[],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;ci[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m), +l=[],p={},d=0,g=e.length;d=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/, +q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/, +q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g, +"");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a), +a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e} +for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], +"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"], +H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"], +J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+ +I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]), +["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css", +/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}), +["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes", +hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p=0){var k=k.match(g),f,b;if(b= +!k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p.radio:first-child,.controls>.checkbox:first-child{padding-top:5px}.radio.inline,.checkbox.inline{display:inline-block;padding-top:5px;margin-bottom:0;vertical-align:middle}.radio.inline+.radio.inline,.checkbox.inline+.checkbox.inline{margin-left:10px}.input-mini{width:60px}.input-small{width:90px}.input-medium{width:150px}.input-large{width:210px}.input-xlarge{width:270px}.input-xxlarge{width:530px}input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input[class*="span"],.row-fluid input[class*="span"],.row-fluid select[class*="span"],.row-fluid textarea[class*="span"],.row-fluid .uneditable-input[class*="span"]{float:none;margin-left:0}.input-append input[class*="span"],.input-append .uneditable-input[class*="span"],.input-prepend input[class*="span"],.input-prepend .uneditable-input[class*="span"],.row-fluid input[class*="span"],.row-fluid select[class*="span"],.row-fluid textarea[class*="span"],.row-fluid .uneditable-input[class*="span"],.row-fluid .input-prepend [class*="span"],.row-fluid .input-append [class*="span"]{display:inline-block}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:20px}input.span12,textarea.span12,.uneditable-input.span12{width:926px}input.span11,textarea.span11,.uneditable-input.span11{width:846px}input.span10,textarea.span10,.uneditable-input.span10{width:766px}input.span9,textarea.span9,.uneditable-input.span9{width:686px}input.span8,textarea.span8,.uneditable-input.span8{width:606px}input.span7,textarea.span7,.uneditable-input.span7{width:526px}input.span6,textarea.span6,.uneditable-input.span6{width:446px}input.span5,textarea.span5,.uneditable-input.span5{width:366px}input.span4,textarea.span4,.uneditable-input.span4{width:286px}input.span3,textarea.span3,.uneditable-input.span3{width:206px}input.span2,textarea.span2,.uneditable-input.span2{width:126px}input.span1,textarea.span1,.uneditable-input.span1{width:46px}.controls-row{*zoom:1}.controls-row:before,.controls-row:after{display:table;line-height:0;content:""}.controls-row:after{clear:both}.controls-row [class*="span"],.row-fluid .controls-row [class*="span"]{float:left}.controls-row .checkbox[class*="span"],.controls-row .radio[class*="span"]{padding-top:5px}input[disabled],select[disabled],textarea[disabled],input[readonly],select[readonly],textarea[readonly]{cursor:not-allowed;background-color:#eee}input[type="radio"][disabled],input[type="checkbox"][disabled],input[type="radio"][readonly],input[type="checkbox"][readonly]{background-color:transparent}.control-group.warning>label,.control-group.warning .help-block,.control-group.warning .help-inline{color:#c09853}.control-group.warning .checkbox,.control-group.warning .radio,.control-group.warning input,.control-group.warning select,.control-group.warning textarea{color:#c09853}.control-group.warning input,.control-group.warning select,.control-group.warning textarea{border-color:#c09853;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.warning input:focus,.control-group.warning select:focus,.control-group.warning textarea:focus{border-color:#a47e3c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e}.control-group.warning .input-prepend .add-on,.control-group.warning .input-append .add-on{color:#c09853;background-color:#fcf8e3;border-color:#c09853}.control-group.error>label,.control-group.error .help-block,.control-group.error .help-inline{color:#b94a48}.control-group.error .checkbox,.control-group.error .radio,.control-group.error input,.control-group.error select,.control-group.error textarea{color:#b94a48}.control-group.error input,.control-group.error select,.control-group.error textarea{border-color:#b94a48;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.error input:focus,.control-group.error select:focus,.control-group.error textarea:focus{border-color:#953b39;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392}.control-group.error .input-prepend .add-on,.control-group.error .input-append .add-on{color:#b94a48;background-color:#f2dede;border-color:#b94a48}.control-group.success>label,.control-group.success .help-block,.control-group.success .help-inline{color:#468847}.control-group.success .checkbox,.control-group.success .radio,.control-group.success input,.control-group.success select,.control-group.success textarea{color:#468847}.control-group.success input,.control-group.success select,.control-group.success textarea{border-color:#468847;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.success input:focus,.control-group.success select:focus,.control-group.success textarea:focus{border-color:#356635;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b}.control-group.success .input-prepend .add-on,.control-group.success .input-append .add-on{color:#468847;background-color:#dff0d8;border-color:#468847}.control-group.info>label,.control-group.info .help-block,.control-group.info .help-inline{color:#3a87ad}.control-group.info .checkbox,.control-group.info .radio,.control-group.info input,.control-group.info select,.control-group.info textarea{color:#3a87ad}.control-group.info input,.control-group.info select,.control-group.info textarea{border-color:#3a87ad;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.info input:focus,.control-group.info select:focus,.control-group.info textarea:focus{border-color:#2d6987;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7ab5d3;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7ab5d3;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7ab5d3}.control-group.info .input-prepend .add-on,.control-group.info .input-append .add-on{color:#3a87ad;background-color:#d9edf7;border-color:#3a87ad}input:focus:required:invalid,textarea:focus:required:invalid,select:focus:required:invalid{color:#b94a48;border-color:#ee5f5b}input:focus:required:invalid:focus,textarea:focus:required:invalid:focus,select:focus:required:invalid:focus{border-color:#e9322d;-webkit-box-shadow:0 0 6px #f8b9b7;-moz-box-shadow:0 0 6px #f8b9b7;box-shadow:0 0 6px #f8b9b7}.form-actions{padding:19px 20px 20px;margin-top:20px;margin-bottom:20px;background-color:#f5f5f5;border-top:1px solid #e5e5e5;*zoom:1}.form-actions:before,.form-actions:after{display:table;line-height:0;content:""}.form-actions:after{clear:both}.help-block,.help-inline{color:#595959}.help-block{display:block;margin-bottom:10px}.help-inline{display:inline-block;*display:inline;padding-left:5px;vertical-align:middle;*zoom:1}.input-append,.input-prepend{margin-bottom:5px;font-size:0;white-space:nowrap}.input-append input,.input-prepend input,.input-append select,.input-prepend select,.input-append .uneditable-input,.input-prepend .uneditable-input,.input-append .dropdown-menu,.input-prepend .dropdown-menu{font-size:14px}.input-append input,.input-prepend input,.input-append select,.input-prepend select,.input-append .uneditable-input,.input-prepend .uneditable-input{position:relative;margin-bottom:0;*margin-left:0;vertical-align:top;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-append input:focus,.input-prepend input:focus,.input-append select:focus,.input-prepend select:focus,.input-append .uneditable-input:focus,.input-prepend .uneditable-input:focus{z-index:2}.input-append .add-on,.input-prepend .add-on{display:inline-block;width:auto;height:20px;min-width:16px;padding:4px 5px;font-size:14px;font-weight:normal;line-height:20px;text-align:center;text-shadow:0 1px 0 #fff;background-color:#eee;border:1px solid #ccc}.input-append .add-on,.input-prepend .add-on,.input-append .btn,.input-prepend .btn{vertical-align:top;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.input-append .active,.input-prepend .active{background-color:#a9dba9;border-color:#46a546}.input-prepend .add-on,.input-prepend .btn{margin-right:-1px}.input-prepend .add-on:first-child,.input-prepend .btn:first-child{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.input-append input,.input-append select,.input-append .uneditable-input{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.input-append input+.btn-group .btn,.input-append select+.btn-group .btn,.input-append .uneditable-input+.btn-group .btn{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-append .add-on,.input-append .btn,.input-append .btn-group{margin-left:-1px}.input-append .add-on:last-child,.input-append .btn:last-child{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-prepend.input-append input,.input-prepend.input-append select,.input-prepend.input-append .uneditable-input{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.input-prepend.input-append input+.btn-group .btn,.input-prepend.input-append select+.btn-group .btn,.input-prepend.input-append .uneditable-input+.btn-group .btn{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-prepend.input-append .add-on:first-child,.input-prepend.input-append .btn:first-child{margin-right:-1px;-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.input-prepend.input-append .add-on:last-child,.input-prepend.input-append .btn:last-child{margin-left:-1px;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-prepend.input-append .btn-group:first-child{margin-left:0}input.search-query{padding-right:14px;padding-right:4px \9;padding-left:14px;padding-left:4px \9;margin-bottom:0;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.form-search .input-append .search-query,.form-search .input-prepend .search-query{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.form-search .input-append .search-query{-webkit-border-radius:14px 0 0 14px;-moz-border-radius:14px 0 0 14px;border-radius:14px 0 0 14px}.form-search .input-append .btn{-webkit-border-radius:0 14px 14px 0;-moz-border-radius:0 14px 14px 0;border-radius:0 14px 14px 0}.form-search .input-prepend .search-query{-webkit-border-radius:0 14px 14px 0;-moz-border-radius:0 14px 14px 0;border-radius:0 14px 14px 0}.form-search .input-prepend .btn{-webkit-border-radius:14px 0 0 14px;-moz-border-radius:14px 0 0 14px;border-radius:14px 0 0 14px}.form-search input,.form-inline input,.form-horizontal input,.form-search textarea,.form-inline textarea,.form-horizontal textarea,.form-search select,.form-inline select,.form-horizontal select,.form-search .help-inline,.form-inline .help-inline,.form-horizontal .help-inline,.form-search .uneditable-input,.form-inline .uneditable-input,.form-horizontal .uneditable-input,.form-search .input-prepend,.form-inline .input-prepend,.form-horizontal .input-prepend,.form-search .input-append,.form-inline .input-append,.form-horizontal .input-append{display:inline-block;*display:inline;margin-bottom:0;vertical-align:middle;*zoom:1}.form-search .hide,.form-inline .hide,.form-horizontal .hide{display:none}.form-search label,.form-inline label,.form-search .btn-group,.form-inline .btn-group{display:inline-block}.form-search .input-append,.form-inline .input-append,.form-search .input-prepend,.form-inline .input-prepend{margin-bottom:0}.form-search .radio,.form-search .checkbox,.form-inline .radio,.form-inline .checkbox{padding-left:0;margin-bottom:0;vertical-align:middle}.form-search .radio input[type="radio"],.form-search .checkbox input[type="checkbox"],.form-inline .radio input[type="radio"],.form-inline .checkbox input[type="checkbox"]{float:left;margin-right:3px;margin-left:0}.control-group{margin-bottom:10px}legend+.control-group{margin-top:20px;-webkit-margin-top-collapse:separate}.form-horizontal .control-group{margin-bottom:20px;*zoom:1}.form-horizontal .control-group:before,.form-horizontal .control-group:after{display:table;line-height:0;content:""}.form-horizontal .control-group:after{clear:both}.form-horizontal .control-label{float:left;width:160px;padding-top:5px;text-align:right}.form-horizontal .controls{*display:inline-block;*padding-left:20px;margin-left:180px;*margin-left:0}.form-horizontal .controls:first-child{*padding-left:180px}.form-horizontal .help-block{margin-bottom:0}.form-horizontal input+.help-block,.form-horizontal select+.help-block,.form-horizontal textarea+.help-block{margin-top:10px}.form-horizontal .form-actions{padding-left:180px}table{max-width:100%;background-color:transparent;border-collapse:collapse;border-spacing:0}.table{width:100%;margin-bottom:20px}.table th,.table td{padding:8px;line-height:20px;text-align:left;vertical-align:top;border-top:1px solid #ddd}.table th{font-weight:bold}.table thead th{vertical-align:bottom}.table caption+thead tr:first-child th,.table caption+thead tr:first-child td,.table colgroup+thead tr:first-child th,.table colgroup+thead tr:first-child td,.table thead:first-child tr:first-child th,.table thead:first-child tr:first-child td{border-top:0}.table tbody+tbody{border-top:2px solid #ddd}.table-condensed th,.table-condensed td{padding:4px 5px}.table-bordered{border:1px solid #ddd;border-collapse:separate;*border-collapse:collapse;border-left:0;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.table-bordered th,.table-bordered td{border-left:1px solid #ddd}.table-bordered caption+thead tr:first-child th,.table-bordered caption+tbody tr:first-child th,.table-bordered caption+tbody tr:first-child td,.table-bordered colgroup+thead tr:first-child th,.table-bordered colgroup+tbody tr:first-child th,.table-bordered colgroup+tbody tr:first-child td,.table-bordered thead:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child td{border-top:0}.table-bordered thead:first-child tr:first-child th:first-child,.table-bordered tbody:first-child tr:first-child td:first-child{-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topleft:4px}.table-bordered thead:first-child tr:first-child th:last-child,.table-bordered tbody:first-child tr:first-child td:last-child{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-topright:4px}.table-bordered thead:last-child tr:last-child th:first-child,.table-bordered tbody:last-child tr:last-child td:first-child,.table-bordered tfoot:last-child tr:last-child td:first-child{-webkit-border-radius:0 0 0 4px;-moz-border-radius:0 0 0 4px;border-radius:0 0 0 4px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px}.table-bordered thead:last-child tr:last-child th:last-child,.table-bordered tbody:last-child tr:last-child td:last-child,.table-bordered tfoot:last-child tr:last-child td:last-child{-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px}.table-bordered caption+thead tr:first-child th:first-child,.table-bordered caption+tbody tr:first-child td:first-child,.table-bordered colgroup+thead tr:first-child th:first-child,.table-bordered colgroup+tbody tr:first-child td:first-child{-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topleft:4px}.table-bordered caption+thead tr:first-child th:last-child,.table-bordered caption+tbody tr:first-child td:last-child,.table-bordered colgroup+thead tr:first-child th:last-child,.table-bordered colgroup+tbody tr:first-child td:last-child{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-topright:4px}.table-striped tbody tr:nth-child(odd) td,.table-striped tbody tr:nth-child(odd) th{background-color:#f9f9f9}.table-hover tbody tr:hover td,.table-hover tbody tr:hover th{background-color:#f5f5f5}table td[class*="span"],table th[class*="span"],.row-fluid table td[class*="span"],.row-fluid table th[class*="span"]{display:table-cell;float:none;margin-left:0}.table td.span1,.table th.span1{float:none;width:44px;margin-left:0}.table td.span2,.table th.span2{float:none;width:124px;margin-left:0}.table td.span3,.table th.span3{float:none;width:204px;margin-left:0}.table td.span4,.table th.span4{float:none;width:284px;margin-left:0}.table td.span5,.table th.span5{float:none;width:364px;margin-left:0}.table td.span6,.table th.span6{float:none;width:444px;margin-left:0}.table td.span7,.table th.span7{float:none;width:524px;margin-left:0}.table td.span8,.table th.span8{float:none;width:604px;margin-left:0}.table td.span9,.table th.span9{float:none;width:684px;margin-left:0}.table td.span10,.table th.span10{float:none;width:764px;margin-left:0}.table td.span11,.table th.span11{float:none;width:844px;margin-left:0}.table td.span12,.table th.span12{float:none;width:924px;margin-left:0}.table tbody tr.success td{background-color:#dff0d8}.table tbody tr.error td{background-color:#f2dede}.table tbody tr.warning td{background-color:#fcf8e3}.table tbody tr.info td{background-color:#d9edf7}.table-hover tbody tr.success:hover td{background-color:#d0e9c6}.table-hover tbody tr.error:hover td{background-color:#ebcccc}.table-hover tbody tr.warning:hover td{background-color:#faf2cc}.table-hover tbody tr.info:hover td{background-color:#c4e3f3}[class^="icon-"],[class*=" icon-"]{display:inline-block;width:14px;height:14px;margin-top:1px;*margin-right:.3em;line-height:14px;vertical-align:text-top;background-image:url("../img/glyphicons-halflings.png");background-position:14px 14px;background-repeat:no-repeat}.icon-white,.nav-pills>.active>a>[class^="icon-"],.nav-pills>.active>a>[class*=" icon-"],.nav-list>.active>a>[class^="icon-"],.nav-list>.active>a>[class*=" icon-"],.navbar-inverse .nav>.active>a>[class^="icon-"],.navbar-inverse .nav>.active>a>[class*=" icon-"],.dropdown-menu>li>a:hover>[class^="icon-"],.dropdown-menu>li>a:hover>[class*=" icon-"],.dropdown-menu>.active>a>[class^="icon-"],.dropdown-menu>.active>a>[class*=" icon-"],.dropdown-submenu:hover>a>[class^="icon-"],.dropdown-submenu:hover>a>[class*=" icon-"]{background-image:url("../img/glyphicons-halflings-white.png")}.icon-glass{background-position:0 0}.icon-music{background-position:-24px 0}.icon-search{background-position:-48px 0}.icon-envelope{background-position:-72px 0}.icon-heart{background-position:-96px 0}.icon-star{background-position:-120px 0}.icon-star-empty{background-position:-144px 0}.icon-user{background-position:-168px 0}.icon-film{background-position:-192px 0}.icon-th-large{background-position:-216px 0}.icon-th{background-position:-240px 0}.icon-th-list{background-position:-264px 0}.icon-ok{background-position:-288px 0}.icon-remove{background-position:-312px 0}.icon-zoom-in{background-position:-336px 0}.icon-zoom-out{background-position:-360px 0}.icon-off{background-position:-384px 0}.icon-signal{background-position:-408px 0}.icon-cog{background-position:-432px 0}.icon-trash{background-position:-456px 0}.icon-home{background-position:0 -24px}.icon-file{background-position:-24px -24px}.icon-time{background-position:-48px -24px}.icon-road{background-position:-72px -24px}.icon-download-alt{background-position:-96px -24px}.icon-download{background-position:-120px -24px}.icon-upload{background-position:-144px -24px}.icon-inbox{background-position:-168px -24px}.icon-play-circle{background-position:-192px -24px}.icon-repeat{background-position:-216px -24px}.icon-refresh{background-position:-240px -24px}.icon-list-alt{background-position:-264px -24px}.icon-lock{background-position:-287px -24px}.icon-flag{background-position:-312px -24px}.icon-headphones{background-position:-336px -24px}.icon-volume-off{background-position:-360px -24px}.icon-volume-down{background-position:-384px -24px}.icon-volume-up{background-position:-408px -24px}.icon-qrcode{background-position:-432px -24px}.icon-barcode{background-position:-456px -24px}.icon-tag{background-position:0 -48px}.icon-tags{background-position:-25px -48px}.icon-book{background-position:-48px -48px}.icon-bookmark{background-position:-72px -48px}.icon-print{background-position:-96px -48px}.icon-camera{background-position:-120px -48px}.icon-font{background-position:-144px -48px}.icon-bold{background-position:-167px -48px}.icon-italic{background-position:-192px -48px}.icon-text-height{background-position:-216px -48px}.icon-text-width{background-position:-240px -48px}.icon-align-left{background-position:-264px -48px}.icon-align-center{background-position:-288px -48px}.icon-align-right{background-position:-312px -48px}.icon-align-justify{background-position:-336px -48px}.icon-list{background-position:-360px -48px}.icon-indent-left{background-position:-384px -48px}.icon-indent-right{background-position:-408px -48px}.icon-facetime-video{background-position:-432px -48px}.icon-picture{background-position:-456px -48px}.icon-pencil{background-position:0 -72px}.icon-map-marker{background-position:-24px -72px}.icon-adjust{background-position:-48px -72px}.icon-tint{background-position:-72px -72px}.icon-edit{background-position:-96px -72px}.icon-share{background-position:-120px -72px}.icon-check{background-position:-144px -72px}.icon-move{background-position:-168px -72px}.icon-step-backward{background-position:-192px -72px}.icon-fast-backward{background-position:-216px -72px}.icon-backward{background-position:-240px -72px}.icon-play{background-position:-264px -72px}.icon-pause{background-position:-288px -72px}.icon-stop{background-position:-312px -72px}.icon-forward{background-position:-336px -72px}.icon-fast-forward{background-position:-360px -72px}.icon-step-forward{background-position:-384px -72px}.icon-eject{background-position:-408px -72px}.icon-chevron-left{background-position:-432px -72px}.icon-chevron-right{background-position:-456px -72px}.icon-plus-sign{background-position:0 -96px}.icon-minus-sign{background-position:-24px -96px}.icon-remove-sign{background-position:-48px -96px}.icon-ok-sign{background-position:-72px -96px}.icon-question-sign{background-position:-96px -96px}.icon-info-sign{background-position:-120px -96px}.icon-screenshot{background-position:-144px -96px}.icon-remove-circle{background-position:-168px -96px}.icon-ok-circle{background-position:-192px -96px}.icon-ban-circle{background-position:-216px -96px}.icon-arrow-left{background-position:-240px -96px}.icon-arrow-right{background-position:-264px -96px}.icon-arrow-up{background-position:-289px -96px}.icon-arrow-down{background-position:-312px -96px}.icon-share-alt{background-position:-336px -96px}.icon-resize-full{background-position:-360px -96px}.icon-resize-small{background-position:-384px -96px}.icon-plus{background-position:-408px -96px}.icon-minus{background-position:-433px -96px}.icon-asterisk{background-position:-456px -96px}.icon-exclamation-sign{background-position:0 -120px}.icon-gift{background-position:-24px -120px}.icon-leaf{background-position:-48px -120px}.icon-fire{background-position:-72px -120px}.icon-eye-open{background-position:-96px -120px}.icon-eye-close{background-position:-120px -120px}.icon-warning-sign{background-position:-144px -120px}.icon-plane{background-position:-168px -120px}.icon-calendar{background-position:-192px -120px}.icon-random{width:16px;background-position:-216px -120px}.icon-comment{background-position:-240px -120px}.icon-magnet{background-position:-264px -120px}.icon-chevron-up{background-position:-288px -120px}.icon-chevron-down{background-position:-313px -119px}.icon-retweet{background-position:-336px -120px}.icon-shopping-cart{background-position:-360px -120px}.icon-folder-close{background-position:-384px -120px}.icon-folder-open{width:16px;background-position:-408px -120px}.icon-resize-vertical{background-position:-432px -119px}.icon-resize-horizontal{background-position:-456px -118px}.icon-hdd{background-position:0 -144px}.icon-bullhorn{background-position:-24px -144px}.icon-bell{background-position:-48px -144px}.icon-certificate{background-position:-72px -144px}.icon-thumbs-up{background-position:-96px -144px}.icon-thumbs-down{background-position:-120px -144px}.icon-hand-right{background-position:-144px -144px}.icon-hand-left{background-position:-168px -144px}.icon-hand-up{background-position:-192px -144px}.icon-hand-down{background-position:-216px -144px}.icon-circle-arrow-right{background-position:-240px -144px}.icon-circle-arrow-left{background-position:-264px -144px}.icon-circle-arrow-up{background-position:-288px -144px}.icon-circle-arrow-down{background-position:-312px -144px}.icon-globe{background-position:-336px -144px}.icon-wrench{background-position:-360px -144px}.icon-tasks{background-position:-384px -144px}.icon-filter{background-position:-408px -144px}.icon-briefcase{background-position:-432px -144px}.icon-fullscreen{background-position:-456px -144px}.dropup,.dropdown{position:relative}.dropdown-toggle{*margin-bottom:-3px}.dropdown-toggle:active,.open .dropdown-toggle{outline:0}.caret{display:inline-block;width:0;height:0;vertical-align:top;border-top:4px solid #000;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.dropdown .caret{margin-top:8px;margin-left:2px}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);*border-right-width:2px;*border-bottom-width:2px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{*width:100%;height:1px;margin:9px 1px;*margin:-5px 0 5px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #fff}.dropdown-menu li>a{display:block;padding:3px 20px;clear:both;font-weight:normal;line-height:20px;color:#333;white-space:nowrap}.dropdown-menu li>a:hover,.dropdown-menu li>a:focus,.dropdown-submenu:hover>a{color:#fff;text-decoration:none;background-color:#0081c2;background-image:-moz-linear-gradient(top,#08c,#0077b3);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#0077b3));background-image:-webkit-linear-gradient(top,#08c,#0077b3);background-image:-o-linear-gradient(top,#08c,#0077b3);background-image:linear-gradient(to bottom,#08c,#0077b3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0077b3',GradientType=0)}.dropdown-menu .active>a,.dropdown-menu .active>a:hover{color:#333;text-decoration:none;background-color:#0081c2;background-image:-moz-linear-gradient(top,#08c,#0077b3);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#0077b3));background-image:-webkit-linear-gradient(top,#08c,#0077b3);background-image:-o-linear-gradient(top,#08c,#0077b3);background-image:linear-gradient(to bottom,#08c,#0077b3);background-repeat:repeat-x;outline:0;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0077b3',GradientType=0)}.dropdown-menu .disabled>a,.dropdown-menu .disabled>a:hover{color:#999}.dropdown-menu .disabled>a:hover{text-decoration:none;cursor:default;background-color:transparent;background-image:none}.open{*z-index:1000}.open>.dropdown-menu{display:block}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px solid #000;content:""}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px}.dropdown-submenu{position:relative}.dropdown-submenu>.dropdown-menu{top:0;left:100%;margin-top:-6px;margin-left:-1px;-webkit-border-radius:0 6px 6px 6px;-moz-border-radius:0 6px 6px 6px;border-radius:0 6px 6px 6px}.dropdown-submenu:hover>.dropdown-menu{display:block}.dropup .dropdown-submenu>.dropdown-menu{top:auto;bottom:0;margin-top:0;margin-bottom:-2px;-webkit-border-radius:5px 5px 5px 0;-moz-border-radius:5px 5px 5px 0;border-radius:5px 5px 5px 0}.dropdown-submenu>a:after{display:block;float:right;width:0;height:0;margin-top:5px;margin-right:-10px;border-color:transparent;border-left-color:#ccc;border-style:solid;border-width:5px 0 5px 5px;content:" "}.dropdown-submenu:hover>a:after{border-left-color:#fff}.dropdown-submenu.pull-left{float:none}.dropdown-submenu.pull-left>.dropdown-menu{left:-100%;margin-left:10px;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px}.dropdown .dropdown-menu .nav-header{padding-right:20px;padding-left:20px}.typeahead{margin-top:2px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);box-shadow:inset 0 1px 1px rgba(0,0,0,0.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,0.15)}.well-large{padding:24px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.well-small{padding:9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.fade{opacity:0;-webkit-transition:opacity .15s linear;-moz-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{position:relative;height:0;overflow:hidden;-webkit-transition:height .35s ease;-moz-transition:height .35s ease;-o-transition:height .35s ease;transition:height .35s ease}.collapse.in{height:auto}.close{float:right;font-size:20px;font-weight:bold;line-height:20px;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.close:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.4;filter:alpha(opacity=40)}button.close{padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}.btn{display:inline-block;*display:inline;padding:4px 12px;margin-bottom:0;*margin-left:.3em;font-size:14px;line-height:20px;*line-height:20px;color:#333;text-align:center;text-shadow:0 1px 1px rgba(255,255,255,0.75);vertical-align:middle;cursor:pointer;background-color:#f5f5f5;*background-color:#e6e6e6;background-image:-moz-linear-gradient(top,#fff,#e6e6e6);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#e6e6e6));background-image:-webkit-linear-gradient(top,#fff,#e6e6e6);background-image:-o-linear-gradient(top,#fff,#e6e6e6);background-image:linear-gradient(to bottom,#fff,#e6e6e6);background-repeat:repeat-x;border:1px solid #bbb;*border:0;border-color:#e6e6e6 #e6e6e6 #bfbfbf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-bottom-color:#a2a2a2;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffe6e6e6',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);*zoom:1;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05)}.btn:hover,.btn:active,.btn.active,.btn.disabled,.btn[disabled]{color:#333;background-color:#e6e6e6;*background-color:#d9d9d9}.btn:active,.btn.active{background-color:#ccc \9}.btn:first-child{*margin-left:0}.btn:hover{color:#333;text-decoration:none;background-color:#e6e6e6;*background-color:#d9d9d9;background-position:0 -15px;-webkit-transition:background-position .1s linear;-moz-transition:background-position .1s linear;-o-transition:background-position .1s linear;transition:background-position .1s linear}.btn:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.active,.btn:active{background-color:#e6e6e6;background-color:#d9d9d9 \9;background-image:none;outline:0;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05)}.btn.disabled,.btn[disabled]{cursor:default;background-color:#e6e6e6;background-image:none;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-large{padding:11px 19px;font-size:17.5px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.btn-large [class^="icon-"],.btn-large [class*=" icon-"]{margin-top:2px}.btn-small{padding:2px 10px;font-size:11.9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-small [class^="icon-"],.btn-small [class*=" icon-"]{margin-top:0}.btn-mini{padding:1px 6px;font-size:10.5px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-block{display:block;width:100%;padding-right:0;padding-left:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.btn-block+.btn-block{margin-top:5px}input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%}.btn-primary.active,.btn-warning.active,.btn-danger.active,.btn-success.active,.btn-info.active,.btn-inverse.active{color:rgba(255,255,255,0.75)}.btn{border-color:#c5c5c5;border-color:rgba(0,0,0,0.15) rgba(0,0,0,0.15) rgba(0,0,0,0.25)}.btn-primary{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#006dcc;*background-color:#04c;background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(to bottom,#08c,#04c);background-repeat:repeat-x;border-color:#04c #04c #002a80;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0044cc',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-primary:hover,.btn-primary:active,.btn-primary.active,.btn-primary.disabled,.btn-primary[disabled]{color:#fff;background-color:#04c;*background-color:#003bb3}.btn-primary:active,.btn-primary.active{background-color:#039 \9}.btn-warning{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#faa732;*background-color:#f89406;background-image:-moz-linear-gradient(top,#fbb450,#f89406);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fbb450),to(#f89406));background-image:-webkit-linear-gradient(top,#fbb450,#f89406);background-image:-o-linear-gradient(top,#fbb450,#f89406);background-image:linear-gradient(to bottom,#fbb450,#f89406);background-repeat:repeat-x;border-color:#f89406 #f89406 #ad6704;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450',endColorstr='#fff89406',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-warning:hover,.btn-warning:active,.btn-warning.active,.btn-warning.disabled,.btn-warning[disabled]{color:#fff;background-color:#f89406;*background-color:#df8505}.btn-warning:active,.btn-warning.active{background-color:#c67605 \9}.btn-danger{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#da4f49;*background-color:#bd362f;background-image:-moz-linear-gradient(top,#ee5f5b,#bd362f);background-image:-webkit-gradient(linear,0 0,0 100%,from(#ee5f5b),to(#bd362f));background-image:-webkit-linear-gradient(top,#ee5f5b,#bd362f);background-image:-o-linear-gradient(top,#ee5f5b,#bd362f);background-image:linear-gradient(to bottom,#ee5f5b,#bd362f);background-repeat:repeat-x;border-color:#bd362f #bd362f #802420;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b',endColorstr='#ffbd362f',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-danger:hover,.btn-danger:active,.btn-danger.active,.btn-danger.disabled,.btn-danger[disabled]{color:#fff;background-color:#bd362f;*background-color:#a9302a}.btn-danger:active,.btn-danger.active{background-color:#942a25 \9}.btn-success{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#5bb75b;*background-color:#51a351;background-image:-moz-linear-gradient(top,#62c462,#51a351);background-image:-webkit-gradient(linear,0 0,0 100%,from(#62c462),to(#51a351));background-image:-webkit-linear-gradient(top,#62c462,#51a351);background-image:-o-linear-gradient(top,#62c462,#51a351);background-image:linear-gradient(to bottom,#62c462,#51a351);background-repeat:repeat-x;border-color:#51a351 #51a351 #387038;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462',endColorstr='#ff51a351',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-success:hover,.btn-success:active,.btn-success.active,.btn-success.disabled,.btn-success[disabled]{color:#fff;background-color:#51a351;*background-color:#499249}.btn-success:active,.btn-success.active{background-color:#408140 \9}.btn-info{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#49afcd;*background-color:#2f96b4;background-image:-moz-linear-gradient(top,#5bc0de,#2f96b4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#5bc0de),to(#2f96b4));background-image:-webkit-linear-gradient(top,#5bc0de,#2f96b4);background-image:-o-linear-gradient(top,#5bc0de,#2f96b4);background-image:linear-gradient(to bottom,#5bc0de,#2f96b4);background-repeat:repeat-x;border-color:#2f96b4 #2f96b4 #1f6377;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de',endColorstr='#ff2f96b4',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-info:hover,.btn-info:active,.btn-info.active,.btn-info.disabled,.btn-info[disabled]{color:#fff;background-color:#2f96b4;*background-color:#2a85a0}.btn-info:active,.btn-info.active{background-color:#24748c \9}.btn-inverse{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#363636;*background-color:#222;background-image:-moz-linear-gradient(top,#444,#222);background-image:-webkit-gradient(linear,0 0,0 100%,from(#444),to(#222));background-image:-webkit-linear-gradient(top,#444,#222);background-image:-o-linear-gradient(top,#444,#222);background-image:linear-gradient(to bottom,#444,#222);background-repeat:repeat-x;border-color:#222 #222 #000;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff444444',endColorstr='#ff222222',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-inverse:hover,.btn-inverse:active,.btn-inverse.active,.btn-inverse.disabled,.btn-inverse[disabled]{color:#fff;background-color:#222;*background-color:#151515}.btn-inverse:active,.btn-inverse.active{background-color:#080808 \9}button.btn,input[type="submit"].btn{*padding-top:3px;*padding-bottom:3px}button.btn::-moz-focus-inner,input[type="submit"].btn::-moz-focus-inner{padding:0;border:0}button.btn.btn-large,input[type="submit"].btn.btn-large{*padding-top:7px;*padding-bottom:7px}button.btn.btn-small,input[type="submit"].btn.btn-small{*padding-top:3px;*padding-bottom:3px}button.btn.btn-mini,input[type="submit"].btn.btn-mini{*padding-top:1px;*padding-bottom:1px}.btn-link,.btn-link:active,.btn-link[disabled]{background-color:transparent;background-image:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-link{color:#08c;cursor:pointer;border-color:transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-link:hover{color:#005580;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover{color:#333;text-decoration:none}.btn-group{position:relative;display:inline-block;*display:inline;*margin-left:.3em;font-size:0;white-space:nowrap;vertical-align:middle;*zoom:1}.btn-group:first-child{*margin-left:0}.btn-group+.btn-group{margin-left:5px}.btn-toolbar{margin-top:10px;margin-bottom:10px;font-size:0}.btn-toolbar .btn+.btn,.btn-toolbar .btn-group+.btn,.btn-toolbar .btn+.btn-group{margin-left:5px}.btn-group>.btn{position:relative;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-group>.btn+.btn{margin-left:-1px}.btn-group>.btn,.btn-group>.dropdown-menu{font-size:14px}.btn-group>.btn-mini{font-size:11px}.btn-group>.btn-small{font-size:12px}.btn-group>.btn-large{font-size:16px}.btn-group>.btn:first-child{margin-left:0;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-bottomleft:4px;-moz-border-radius-topleft:4px}.btn-group>.btn:last-child,.btn-group>.dropdown-toggle{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-topright:4px;-moz-border-radius-bottomright:4px}.btn-group>.btn.large:first-child{margin-left:0;-webkit-border-bottom-left-radius:6px;border-bottom-left-radius:6px;-webkit-border-top-left-radius:6px;border-top-left-radius:6px;-moz-border-radius-bottomleft:6px;-moz-border-radius-topleft:6px}.btn-group>.btn.large:last-child,.btn-group>.large.dropdown-toggle{-webkit-border-top-right-radius:6px;border-top-right-radius:6px;-webkit-border-bottom-right-radius:6px;border-bottom-right-radius:6px;-moz-border-radius-topright:6px;-moz-border-radius-bottomright:6px}.btn-group>.btn:hover,.btn-group>.btn:focus,.btn-group>.btn:active,.btn-group>.btn.active{z-index:2}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{*padding-top:5px;padding-right:8px;*padding-bottom:5px;padding-left:8px;-webkit-box-shadow:inset 1px 0 0 rgba(255,255,255,0.125),inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 1px 0 0 rgba(255,255,255,0.125),inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 1px 0 0 rgba(255,255,255,0.125),inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05)}.btn-group>.btn-mini+.dropdown-toggle{*padding-top:2px;padding-right:5px;*padding-bottom:2px;padding-left:5px}.btn-group>.btn-small+.dropdown-toggle{*padding-top:5px;*padding-bottom:4px}.btn-group>.btn-large+.dropdown-toggle{*padding-top:7px;padding-right:12px;*padding-bottom:7px;padding-left:12px}.btn-group.open .dropdown-toggle{background-image:none;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05)}.btn-group.open .btn.dropdown-toggle{background-color:#e6e6e6}.btn-group.open .btn-primary.dropdown-toggle{background-color:#04c}.btn-group.open .btn-warning.dropdown-toggle{background-color:#f89406}.btn-group.open .btn-danger.dropdown-toggle{background-color:#bd362f}.btn-group.open .btn-success.dropdown-toggle{background-color:#51a351}.btn-group.open .btn-info.dropdown-toggle{background-color:#2f96b4}.btn-group.open .btn-inverse.dropdown-toggle{background-color:#222}.btn .caret{margin-top:8px;margin-left:0}.btn-mini .caret,.btn-small .caret,.btn-large .caret{margin-top:6px}.btn-large .caret{border-top-width:5px;border-right-width:5px;border-left-width:5px}.dropup .btn-large .caret{border-bottom-width:5px}.btn-primary .caret,.btn-warning .caret,.btn-danger .caret,.btn-info .caret,.btn-success .caret,.btn-inverse .caret{border-top-color:#fff;border-bottom-color:#fff}.btn-group-vertical{display:inline-block;*display:inline;*zoom:1}.btn-group-vertical .btn{display:block;float:none;width:100%;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-group-vertical .btn+.btn{margin-top:-1px;margin-left:0}.btn-group-vertical .btn:first-child{-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0}.btn-group-vertical .btn:last-child{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px}.btn-group-vertical .btn-large:first-child{-webkit-border-radius:6px 6px 0 0;-moz-border-radius:6px 6px 0 0;border-radius:6px 6px 0 0}.btn-group-vertical .btn-large:last-child{-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.alert{padding:8px 35px 8px 14px;margin-bottom:20px;color:#c09853;text-shadow:0 1px 0 rgba(255,255,255,0.5);background-color:#fcf8e3;border:1px solid #fbeed5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.alert h4{margin:0}.alert .close{position:relative;top:-2px;right:-21px;line-height:20px}.alert-success{color:#468847;background-color:#dff0d8;border-color:#d6e9c6}.alert-danger,.alert-error{color:#b94a48;background-color:#f2dede;border-color:#eed3d7}.alert-info{color:#3a87ad;background-color:#d9edf7;border-color:#bce8f1}.alert-block{padding-top:14px;padding-bottom:14px}.alert-block>p,.alert-block>ul{margin-bottom:0}.alert-block p+p{margin-top:5px}.nav{margin-bottom:20px;margin-left:0;list-style:none}.nav>li>a{display:block}.nav>li>a:hover{text-decoration:none;background-color:#eee}.nav>.pull-right{float:right}.nav-header{display:block;padding:3px 15px;font-size:11px;font-weight:bold;line-height:20px;color:#999;text-shadow:0 1px 0 rgba(255,255,255,0.5);text-transform:uppercase}.nav li+.nav-header{margin-top:9px}.nav-list{padding-right:15px;padding-left:15px;margin-bottom:0}.nav-list>li>a,.nav-list .nav-header{margin-right:-15px;margin-left:-15px;text-shadow:0 1px 0 rgba(255,255,255,0.5)}.nav-list>li>a{padding:3px 15px}.nav-list>.active>a,.nav-list>.active>a:hover{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.2);background-color:#08c}.nav-list [class^="icon-"],.nav-list [class*=" icon-"]{margin-right:2px}.nav-list .divider{*width:100%;height:1px;margin:9px 1px;*margin:-5px 0 5px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #fff}.nav-tabs,.nav-pills{*zoom:1}.nav-tabs:before,.nav-pills:before,.nav-tabs:after,.nav-pills:after{display:table;line-height:0;content:""}.nav-tabs:after,.nav-pills:after{clear:both}.nav-tabs>li,.nav-pills>li{float:left}.nav-tabs>li>a,.nav-pills>li>a{padding-right:12px;padding-left:12px;margin-right:2px;line-height:14px}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{margin-bottom:-1px}.nav-tabs>li>a{padding-top:8px;padding-bottom:8px;line-height:20px;border:1px solid transparent;-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>.active>a,.nav-tabs>.active>a:hover{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-pills>li>a{padding-top:8px;padding-bottom:8px;margin-top:2px;margin-bottom:2px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.nav-pills>.active>a,.nav-pills>.active>a:hover{color:#fff;background-color:#08c}.nav-stacked>li{float:none}.nav-stacked>li>a{margin-right:0}.nav-tabs.nav-stacked{border-bottom:0}.nav-tabs.nav-stacked>li>a{border:1px solid #ddd;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.nav-tabs.nav-stacked>li:first-child>a{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topright:4px;-moz-border-radius-topleft:4px}.nav-tabs.nav-stacked>li:last-child>a{-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-bottomright:4px;-moz-border-radius-bottomleft:4px}.nav-tabs.nav-stacked>li>a:hover{z-index:2;border-color:#ddd}.nav-pills.nav-stacked>li>a{margin-bottom:3px}.nav-pills.nav-stacked>li:last-child>a{margin-bottom:1px}.nav-tabs .dropdown-menu{-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.nav-pills .dropdown-menu{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.nav .dropdown-toggle .caret{margin-top:6px;border-top-color:#08c;border-bottom-color:#08c}.nav .dropdown-toggle:hover .caret{border-top-color:#005580;border-bottom-color:#005580}.nav-tabs .dropdown-toggle .caret{margin-top:8px}.nav .active .dropdown-toggle .caret{border-top-color:#fff;border-bottom-color:#fff}.nav-tabs .active .dropdown-toggle .caret{border-top-color:#555;border-bottom-color:#555}.nav>.dropdown.active>a:hover{cursor:pointer}.nav-tabs .open .dropdown-toggle,.nav-pills .open .dropdown-toggle,.nav>li.dropdown.open.active>a:hover{color:#fff;background-color:#999;border-color:#999}.nav li.dropdown.open .caret,.nav li.dropdown.open.active .caret,.nav li.dropdown.open a:hover .caret{border-top-color:#fff;border-bottom-color:#fff;opacity:1;filter:alpha(opacity=100)}.tabs-stacked .open>a:hover{border-color:#999}.tabbable{*zoom:1}.tabbable:before,.tabbable:after{display:table;line-height:0;content:""}.tabbable:after{clear:both}.tab-content{overflow:auto}.tabs-below>.nav-tabs,.tabs-right>.nav-tabs,.tabs-left>.nav-tabs{border-bottom:0}.tab-content>.tab-pane,.pill-content>.pill-pane{display:none}.tab-content>.active,.pill-content>.active{display:block}.tabs-below>.nav-tabs{border-top:1px solid #ddd}.tabs-below>.nav-tabs>li{margin-top:-1px;margin-bottom:0}.tabs-below>.nav-tabs>li>a{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px}.tabs-below>.nav-tabs>li>a:hover{border-top-color:#ddd;border-bottom-color:transparent}.tabs-below>.nav-tabs>.active>a,.tabs-below>.nav-tabs>.active>a:hover{border-color:transparent #ddd #ddd #ddd}.tabs-left>.nav-tabs>li,.tabs-right>.nav-tabs>li{float:none}.tabs-left>.nav-tabs>li>a,.tabs-right>.nav-tabs>li>a{min-width:74px;margin-right:0;margin-bottom:3px}.tabs-left>.nav-tabs{float:left;margin-right:19px;border-right:1px solid #ddd}.tabs-left>.nav-tabs>li>a{margin-right:-1px;-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.tabs-left>.nav-tabs>li>a:hover{border-color:#eee #ddd #eee #eee}.tabs-left>.nav-tabs .active>a,.tabs-left>.nav-tabs .active>a:hover{border-color:#ddd transparent #ddd #ddd;*border-right-color:#fff}.tabs-right>.nav-tabs{float:right;margin-left:19px;border-left:1px solid #ddd}.tabs-right>.nav-tabs>li>a{margin-left:-1px;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.tabs-right>.nav-tabs>li>a:hover{border-color:#eee #eee #eee #ddd}.tabs-right>.nav-tabs .active>a,.tabs-right>.nav-tabs .active>a:hover{border-color:#ddd #ddd #ddd transparent;*border-left-color:#fff}.nav>.disabled>a{color:#999}.nav>.disabled>a:hover{text-decoration:none;cursor:default;background-color:transparent}.navbar{*position:relative;*z-index:2;margin-bottom:20px;overflow:visible;color:#777}.navbar-inner{min-height:40px;padding-right:20px;padding-left:20px;background-color:#fafafa;background-image:-moz-linear-gradient(top,#fff,#f2f2f2);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#f2f2f2));background-image:-webkit-linear-gradient(top,#fff,#f2f2f2);background-image:-o-linear-gradient(top,#fff,#f2f2f2);background-image:linear-gradient(to bottom,#fff,#f2f2f2);background-repeat:repeat-x;border:1px solid #d4d4d4;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#fff2f2f2',GradientType=0);*zoom:1;-webkit-box-shadow:0 1px 4px rgba(0,0,0,0.065);-moz-box-shadow:0 1px 4px rgba(0,0,0,0.065);box-shadow:0 1px 4px rgba(0,0,0,0.065)}.navbar-inner:before,.navbar-inner:after{display:table;line-height:0;content:""}.navbar-inner:after{clear:both}.navbar .container{width:auto}.nav-collapse.collapse{height:auto;overflow:visible}.navbar .brand{display:block;float:left;padding:10px 20px 10px;margin-left:-20px;font-size:20px;font-weight:200;color:#777;text-shadow:0 1px 0 #fff}.navbar .brand:hover{text-decoration:none}.navbar-text{margin-bottom:0;line-height:40px}.navbar-link{color:#777}.navbar-link:hover{color:#333}.navbar .divider-vertical{height:40px;margin:0 9px;border-right:1px solid #fff;border-left:1px solid #f2f2f2}.navbar .btn,.navbar .btn-group{margin-top:5px}.navbar .btn-group .btn,.navbar .input-prepend .btn,.navbar .input-append .btn{margin-top:0}.navbar-form{margin-bottom:0;*zoom:1}.navbar-form:before,.navbar-form:after{display:table;line-height:0;content:""}.navbar-form:after{clear:both}.navbar-form input,.navbar-form select,.navbar-form .radio,.navbar-form .checkbox{margin-top:5px}.navbar-form input,.navbar-form select,.navbar-form .btn{display:inline-block;margin-bottom:0}.navbar-form input[type="image"],.navbar-form input[type="checkbox"],.navbar-form input[type="radio"]{margin-top:3px}.navbar-form .input-append,.navbar-form .input-prepend{margin-top:6px;white-space:nowrap}.navbar-form .input-append input,.navbar-form .input-prepend input{margin-top:0}.navbar-search{position:relative;float:left;margin-top:5px;margin-bottom:0}.navbar-search .search-query{padding:4px 14px;margin-bottom:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;font-weight:normal;line-height:1;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.navbar-static-top{position:static;margin-bottom:0}.navbar-static-top .navbar-inner{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030;margin-bottom:0}.navbar-fixed-top .navbar-inner,.navbar-static-top .navbar-inner{border-width:0 0 1px}.navbar-fixed-bottom .navbar-inner{border-width:1px 0 0}.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding-right:0;padding-left:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px}.navbar-fixed-top{top:0}.navbar-fixed-top .navbar-inner,.navbar-static-top .navbar-inner{-webkit-box-shadow:0 1px 10px rgba(0,0,0,0.1);-moz-box-shadow:0 1px 10px rgba(0,0,0,0.1);box-shadow:0 1px 10px rgba(0,0,0,0.1)}.navbar-fixed-bottom{bottom:0}.navbar-fixed-bottom .navbar-inner{-webkit-box-shadow:0 -1px 10px rgba(0,0,0,0.1);-moz-box-shadow:0 -1px 10px rgba(0,0,0,0.1);box-shadow:0 -1px 10px rgba(0,0,0,0.1)}.navbar .nav{position:relative;left:0;display:block;float:left;margin:0 10px 0 0}.navbar .nav.pull-right{float:right;margin-right:0}.navbar .nav>li{float:left}.navbar .nav>li>a{float:none;padding:10px 15px 10px;color:#777;text-decoration:none;text-shadow:0 1px 0 #fff}.navbar .nav .dropdown-toggle .caret{margin-top:8px}.navbar .nav>li>a:focus,.navbar .nav>li>a:hover{color:#333;text-decoration:none;background-color:transparent}.navbar .nav>.active>a,.navbar .nav>.active>a:hover,.navbar .nav>.active>a:focus{color:#555;text-decoration:none;background-color:#e5e5e5;-webkit-box-shadow:inset 0 3px 8px rgba(0,0,0,0.125);-moz-box-shadow:inset 0 3px 8px rgba(0,0,0,0.125);box-shadow:inset 0 3px 8px rgba(0,0,0,0.125)}.navbar .btn-navbar{display:none;float:right;padding:7px 10px;margin-right:5px;margin-left:5px;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#ededed;*background-color:#e5e5e5;background-image:-moz-linear-gradient(top,#f2f2f2,#e5e5e5);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f2f2f2),to(#e5e5e5));background-image:-webkit-linear-gradient(top,#f2f2f2,#e5e5e5);background-image:-o-linear-gradient(top,#f2f2f2,#e5e5e5);background-image:linear-gradient(to bottom,#f2f2f2,#e5e5e5);background-repeat:repeat-x;border-color:#e5e5e5 #e5e5e5 #bfbfbf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2',endColorstr='#ffe5e5e5',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.075);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.075);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.075)}.navbar .btn-navbar:hover,.navbar .btn-navbar:active,.navbar .btn-navbar.active,.navbar .btn-navbar.disabled,.navbar .btn-navbar[disabled]{color:#fff;background-color:#e5e5e5;*background-color:#d9d9d9}.navbar .btn-navbar:active,.navbar .btn-navbar.active{background-color:#ccc \9}.navbar .btn-navbar .icon-bar{display:block;width:18px;height:2px;background-color:#f5f5f5;-webkit-border-radius:1px;-moz-border-radius:1px;border-radius:1px;-webkit-box-shadow:0 1px 0 rgba(0,0,0,0.25);-moz-box-shadow:0 1px 0 rgba(0,0,0,0.25);box-shadow:0 1px 0 rgba(0,0,0,0.25)}.btn-navbar .icon-bar+.icon-bar{margin-top:3px}.navbar .nav>li>.dropdown-menu:before{position:absolute;top:-7px;left:9px;display:inline-block;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-left:7px solid transparent;border-bottom-color:rgba(0,0,0,0.2);content:''}.navbar .nav>li>.dropdown-menu:after{position:absolute;top:-6px;left:10px;display:inline-block;border-right:6px solid transparent;border-bottom:6px solid #fff;border-left:6px solid transparent;content:''}.navbar-fixed-bottom .nav>li>.dropdown-menu:before{top:auto;bottom:-7px;border-top:7px solid #ccc;border-bottom:0;border-top-color:rgba(0,0,0,0.2)}.navbar-fixed-bottom .nav>li>.dropdown-menu:after{top:auto;bottom:-6px;border-top:6px solid #fff;border-bottom:0}.navbar .nav li.dropdown.open>.dropdown-toggle,.navbar .nav li.dropdown.active>.dropdown-toggle,.navbar .nav li.dropdown.open.active>.dropdown-toggle{color:#555;background-color:#e5e5e5}.navbar .nav li.dropdown>.dropdown-toggle .caret{border-top-color:#777;border-bottom-color:#777}.navbar .nav li.dropdown.open>.dropdown-toggle .caret,.navbar .nav li.dropdown.active>.dropdown-toggle .caret,.navbar .nav li.dropdown.open.active>.dropdown-toggle .caret{border-top-color:#555;border-bottom-color:#555}.navbar .pull-right>li>.dropdown-menu,.navbar .nav>li>.dropdown-menu.pull-right{right:0;left:auto}.navbar .pull-right>li>.dropdown-menu:before,.navbar .nav>li>.dropdown-menu.pull-right:before{right:12px;left:auto}.navbar .pull-right>li>.dropdown-menu:after,.navbar .nav>li>.dropdown-menu.pull-right:after{right:13px;left:auto}.navbar .pull-right>li>.dropdown-menu .dropdown-menu,.navbar .nav>li>.dropdown-menu.pull-right .dropdown-menu{right:100%;left:auto;margin-right:-1px;margin-left:0;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px}.navbar-inverse{color:#999}.navbar-inverse .navbar-inner{background-color:#1b1b1b;background-image:-moz-linear-gradient(top,#222,#111);background-image:-webkit-gradient(linear,0 0,0 100%,from(#222),to(#111));background-image:-webkit-linear-gradient(top,#222,#111);background-image:-o-linear-gradient(top,#222,#111);background-image:linear-gradient(to bottom,#222,#111);background-repeat:repeat-x;border-color:#252525;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222',endColorstr='#ff111111',GradientType=0)}.navbar-inverse .brand,.navbar-inverse .nav>li>a{color:#999;text-shadow:0 -1px 0 rgba(0,0,0,0.25)}.navbar-inverse .brand:hover,.navbar-inverse .nav>li>a:hover{color:#fff}.navbar-inverse .nav>li>a:focus,.navbar-inverse .nav>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .nav .active>a,.navbar-inverse .nav .active>a:hover,.navbar-inverse .nav .active>a:focus{color:#fff;background-color:#111}.navbar-inverse .navbar-link{color:#999}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .divider-vertical{border-right-color:#222;border-left-color:#111}.navbar-inverse .nav li.dropdown.open>.dropdown-toggle,.navbar-inverse .nav li.dropdown.active>.dropdown-toggle,.navbar-inverse .nav li.dropdown.open.active>.dropdown-toggle{color:#fff;background-color:#111}.navbar-inverse .nav li.dropdown>.dropdown-toggle .caret{border-top-color:#999;border-bottom-color:#999}.navbar-inverse .nav li.dropdown.open>.dropdown-toggle .caret,.navbar-inverse .nav li.dropdown.active>.dropdown-toggle .caret,.navbar-inverse .nav li.dropdown.open.active>.dropdown-toggle .caret{border-top-color:#fff;border-bottom-color:#fff}.navbar-inverse .navbar-search .search-query{color:#fff;background-color:#515151;border-color:#111;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1),0 1px 0 rgba(255,255,255,0.15);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1),0 1px 0 rgba(255,255,255,0.15);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1),0 1px 0 rgba(255,255,255,0.15);-webkit-transition:none;-moz-transition:none;-o-transition:none;transition:none}.navbar-inverse .navbar-search .search-query:-moz-placeholder{color:#ccc}.navbar-inverse .navbar-search .search-query:-ms-input-placeholder{color:#ccc}.navbar-inverse .navbar-search .search-query::-webkit-input-placeholder{color:#ccc}.navbar-inverse .navbar-search .search-query:focus,.navbar-inverse .navbar-search .search-query.focused{padding:5px 15px;color:#333;text-shadow:0 1px 0 #fff;background-color:#fff;border:0;outline:0;-webkit-box-shadow:0 0 3px rgba(0,0,0,0.15);-moz-box-shadow:0 0 3px rgba(0,0,0,0.15);box-shadow:0 0 3px rgba(0,0,0,0.15)}.navbar-inverse .btn-navbar{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#0e0e0e;*background-color:#040404;background-image:-moz-linear-gradient(top,#151515,#040404);background-image:-webkit-gradient(linear,0 0,0 100%,from(#151515),to(#040404));background-image:-webkit-linear-gradient(top,#151515,#040404);background-image:-o-linear-gradient(top,#151515,#040404);background-image:linear-gradient(to bottom,#151515,#040404);background-repeat:repeat-x;border-color:#040404 #040404 #000;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff151515',endColorstr='#ff040404',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.navbar-inverse .btn-navbar:hover,.navbar-inverse .btn-navbar:active,.navbar-inverse .btn-navbar.active,.navbar-inverse .btn-navbar.disabled,.navbar-inverse .btn-navbar[disabled]{color:#fff;background-color:#040404;*background-color:#000}.navbar-inverse .btn-navbar:active,.navbar-inverse .btn-navbar.active{background-color:#000 \9}.breadcrumb{padding:8px 15px;margin:0 0 20px;list-style:none;background-color:#f5f5f5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.breadcrumb li{display:inline-block;*display:inline;text-shadow:0 1px 0 #fff;*zoom:1}.breadcrumb .divider{padding:0 5px;color:#ccc}.breadcrumb .active{color:#999}.pagination{margin:20px 0}.pagination ul{display:inline-block;*display:inline;margin-bottom:0;margin-left:0;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;*zoom:1;-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:0 1px 2px rgba(0,0,0,0.05);box-shadow:0 1px 2px rgba(0,0,0,0.05)}.pagination ul>li{display:inline}.pagination ul>li>a,.pagination ul>li>span{float:left;padding:4px 12px;line-height:20px;text-decoration:none;background-color:#fff;border:1px solid #ddd;border-left-width:0}.pagination ul>li>a:hover,.pagination ul>.active>a,.pagination ul>.active>span{background-color:#f5f5f5}.pagination ul>.active>a,.pagination ul>.active>span{color:#999;cursor:default}.pagination ul>.disabled>span,.pagination ul>.disabled>a,.pagination ul>.disabled>a:hover{color:#999;cursor:default;background-color:transparent}.pagination ul>li:first-child>a,.pagination ul>li:first-child>span{border-left-width:1px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-bottomleft:4px;-moz-border-radius-topleft:4px}.pagination ul>li:last-child>a,.pagination ul>li:last-child>span{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-topright:4px;-moz-border-radius-bottomright:4px}.pagination-centered{text-align:center}.pagination-right{text-align:right}.pagination-large ul>li>a,.pagination-large ul>li>span{padding:11px 19px;font-size:17.5px}.pagination-large ul>li:first-child>a,.pagination-large ul>li:first-child>span{-webkit-border-bottom-left-radius:6px;border-bottom-left-radius:6px;-webkit-border-top-left-radius:6px;border-top-left-radius:6px;-moz-border-radius-bottomleft:6px;-moz-border-radius-topleft:6px}.pagination-large ul>li:last-child>a,.pagination-large ul>li:last-child>span{-webkit-border-top-right-radius:6px;border-top-right-radius:6px;-webkit-border-bottom-right-radius:6px;border-bottom-right-radius:6px;-moz-border-radius-topright:6px;-moz-border-radius-bottomright:6px}.pagination-mini ul>li:first-child>a,.pagination-small ul>li:first-child>a,.pagination-mini ul>li:first-child>span,.pagination-small ul>li:first-child>span{-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px;-webkit-border-top-left-radius:3px;border-top-left-radius:3px;-moz-border-radius-bottomleft:3px;-moz-border-radius-topleft:3px}.pagination-mini ul>li:last-child>a,.pagination-small ul>li:last-child>a,.pagination-mini ul>li:last-child>span,.pagination-small ul>li:last-child>span{-webkit-border-top-right-radius:3px;border-top-right-radius:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px;-moz-border-radius-topright:3px;-moz-border-radius-bottomright:3px}.pagination-small ul>li>a,.pagination-small ul>li>span{padding:2px 10px;font-size:11.9px}.pagination-mini ul>li>a,.pagination-mini ul>li>span{padding:1px 6px;font-size:10.5px}.pager{margin:20px 0;text-align:center;list-style:none;*zoom:1}.pager:before,.pager:after{display:table;line-height:0;content:""}.pager:after{clear:both}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.pager li>a:hover{text-decoration:none;background-color:#f5f5f5}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>span{color:#999;cursor:default;background-color:#fff}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{opacity:0}.modal-backdrop,.modal-backdrop.fade.in{opacity:.8;filter:alpha(opacity=80)}.modal{position:fixed;top:50%;left:50%;z-index:1050;width:560px;margin:-250px 0 0 -280px;background-color:#fff;border:1px solid #999;border:1px solid rgba(0,0,0,0.3);*border:1px solid #999;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;outline:0;-webkit-box-shadow:0 3px 7px rgba(0,0,0,0.3);-moz-box-shadow:0 3px 7px rgba(0,0,0,0.3);box-shadow:0 3px 7px rgba(0,0,0,0.3);-webkit-background-clip:padding-box;-moz-background-clip:padding-box;background-clip:padding-box}.modal.fade{top:-25%;-webkit-transition:opacity .3s linear,top .3s ease-out;-moz-transition:opacity .3s linear,top .3s ease-out;-o-transition:opacity .3s linear,top .3s ease-out;transition:opacity .3s linear,top .3s ease-out}.modal.fade.in{top:50%}.modal-header{padding:9px 15px;border-bottom:1px solid #eee}.modal-header .close{margin-top:2px}.modal-header h3{margin:0;line-height:30px}.modal-body{max-height:400px;padding:15px;overflow-y:auto}.modal-form{margin-bottom:0}.modal-footer{padding:14px 15px 15px;margin-bottom:0;text-align:right;background-color:#f5f5f5;border-top:1px solid #ddd;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;*zoom:1;-webkit-box-shadow:inset 0 1px 0 #fff;-moz-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff}.modal-footer:before,.modal-footer:after{display:table;line-height:0;content:""}.modal-footer:after{clear:both}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.tooltip{position:absolute;z-index:1030;display:block;padding:5px;font-size:11px;opacity:0;filter:alpha(opacity=0);visibility:visible}.tooltip.in{opacity:.8;filter:alpha(opacity=80)}.tooltip.top{margin-top:-3px}.tooltip.right{margin-left:3px}.tooltip.bottom{margin-top:3px}.tooltip.left{margin-left:-3px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;text-decoration:none;background-color:#000;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-top-color:#000;border-width:5px 5px 0}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-right-color:#000;border-width:5px 5px 5px 0}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-left-color:#000;border-width:5px 0 5px 5px}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-bottom-color:#000;border-width:0 5px 5px}.popover{position:absolute;top:0;left:0;z-index:1010;display:none;width:236px;padding:1px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{padding:8px 14px;margin:0;font-size:14px;font-weight:normal;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;-webkit-border-radius:5px 5px 0 0;-moz-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover-content p,.popover-content ul,.popover-content ol{margin-bottom:0}.popover .arrow,.popover .arrow:after{position:absolute;display:inline-block;width:0;height:0;border-color:transparent;border-style:solid}.popover .arrow:after{z-index:-1;content:""}.popover.top .arrow{bottom:-10px;left:50%;margin-left:-10px;border-top-color:#fff;border-width:10px 10px 0}.popover.top .arrow:after{bottom:-1px;left:-11px;border-top-color:rgba(0,0,0,0.25);border-width:11px 11px 0}.popover.right .arrow{top:50%;left:-10px;margin-top:-10px;border-right-color:#fff;border-width:10px 10px 10px 0}.popover.right .arrow:after{bottom:-11px;left:-1px;border-right-color:rgba(0,0,0,0.25);border-width:11px 11px 11px 0}.popover.bottom .arrow{top:-10px;left:50%;margin-left:-10px;border-bottom-color:#fff;border-width:0 10px 10px}.popover.bottom .arrow:after{top:-1px;left:-11px;border-bottom-color:rgba(0,0,0,0.25);border-width:0 11px 11px}.popover.left .arrow{top:50%;right:-10px;margin-top:-10px;border-left-color:#fff;border-width:10px 0 10px 10px}.popover.left .arrow:after{right:-1px;bottom:-11px;border-left-color:rgba(0,0,0,0.25);border-width:11px 0 11px 11px}.thumbnails{margin-left:-20px;list-style:none;*zoom:1}.thumbnails:before,.thumbnails:after{display:table;line-height:0;content:""}.thumbnails:after{clear:both}.row-fluid .thumbnails{margin-left:0}.thumbnails>li{float:left;margin-bottom:20px;margin-left:20px}.thumbnail{display:block;padding:4px;line-height:20px;border:1px solid #ddd;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.055);-moz-box-shadow:0 1px 3px rgba(0,0,0,0.055);box-shadow:0 1px 3px rgba(0,0,0,0.055);-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}a.thumbnail:hover{border-color:#08c;-webkit-box-shadow:0 1px 4px rgba(0,105,214,0.25);-moz-box-shadow:0 1px 4px rgba(0,105,214,0.25);box-shadow:0 1px 4px rgba(0,105,214,0.25)}.thumbnail>img{display:block;max-width:100%;margin-right:auto;margin-left:auto}.thumbnail .caption{padding:9px;color:#555}.media,.media-body{overflow:hidden;*overflow:visible;zoom:1}.media,.media .media{margin-top:15px}.media:first-child{margin-top:0}.media-object{display:block}.media-heading{margin:0 0 5px}.media .pull-left{margin-right:10px}.media .pull-right{margin-left:10px}.media-list{margin-left:0;list-style:none}.label,.badge{display:inline-block;padding:2px 4px;font-size:11.844px;font-weight:bold;line-height:14px;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);white-space:nowrap;vertical-align:baseline;background-color:#999}.label{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.badge{padding-right:9px;padding-left:9px;-webkit-border-radius:9px;-moz-border-radius:9px;border-radius:9px}a.label:hover,a.badge:hover{color:#fff;text-decoration:none;cursor:pointer}.label-important,.badge-important{background-color:#b94a48}.label-important[href],.badge-important[href]{background-color:#953b39}.label-warning,.badge-warning{background-color:#f89406}.label-warning[href],.badge-warning[href]{background-color:#c67605}.label-success,.badge-success{background-color:#468847}.label-success[href],.badge-success[href]{background-color:#356635}.label-info,.badge-info{background-color:#3a87ad}.label-info[href],.badge-info[href]{background-color:#2d6987}.label-inverse,.badge-inverse{background-color:#333}.label-inverse[href],.badge-inverse[href]{background-color:#1a1a1a}.btn .label,.btn .badge{position:relative;top:-1px}.btn-mini .label,.btn-mini .badge{top:0}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-moz-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-ms-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:0 0}to{background-position:40px 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f7f7f7;background-image:-moz-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f5f5f5),to(#f9f9f9));background-image:-webkit-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:-o-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:linear-gradient(to bottom,#f5f5f5,#f9f9f9);background-repeat:repeat-x;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5',endColorstr='#fff9f9f9',GradientType=0);-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1)}.progress .bar{float:left;width:0;height:100%;font-size:12px;color:#fff;text-align:center;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#0e90d2;background-image:-moz-linear-gradient(top,#149bdf,#0480be);background-image:-webkit-gradient(linear,0 0,0 100%,from(#149bdf),to(#0480be));background-image:-webkit-linear-gradient(top,#149bdf,#0480be);background-image:-o-linear-gradient(top,#149bdf,#0480be);background-image:linear-gradient(to bottom,#149bdf,#0480be);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff149bdf',endColorstr='#ff0480be',GradientType=0);-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-moz-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:width .6s ease;-moz-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress .bar+.bar{-webkit-box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15);-moz-box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15)}.progress-striped .bar{background-color:#149bdf;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;-moz-background-size:40px 40px;-o-background-size:40px 40px;background-size:40px 40px}.progress.active .bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-moz-animation:progress-bar-stripes 2s linear infinite;-ms-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-danger .bar,.progress .bar-danger{background-color:#dd514c;background-image:-moz-linear-gradient(top,#ee5f5b,#c43c35);background-image:-webkit-gradient(linear,0 0,0 100%,from(#ee5f5b),to(#c43c35));background-image:-webkit-linear-gradient(top,#ee5f5b,#c43c35);background-image:-o-linear-gradient(top,#ee5f5b,#c43c35);background-image:linear-gradient(to bottom,#ee5f5b,#c43c35);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b',endColorstr='#ffc43c35',GradientType=0)}.progress-danger.progress-striped .bar,.progress-striped .bar-danger{background-color:#ee5f5b;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-success .bar,.progress .bar-success{background-color:#5eb95e;background-image:-moz-linear-gradient(top,#62c462,#57a957);background-image:-webkit-gradient(linear,0 0,0 100%,from(#62c462),to(#57a957));background-image:-webkit-linear-gradient(top,#62c462,#57a957);background-image:-o-linear-gradient(top,#62c462,#57a957);background-image:linear-gradient(to bottom,#62c462,#57a957);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462',endColorstr='#ff57a957',GradientType=0)}.progress-success.progress-striped .bar,.progress-striped .bar-success{background-color:#62c462;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-info .bar,.progress .bar-info{background-color:#4bb1cf;background-image:-moz-linear-gradient(top,#5bc0de,#339bb9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#5bc0de),to(#339bb9));background-image:-webkit-linear-gradient(top,#5bc0de,#339bb9);background-image:-o-linear-gradient(top,#5bc0de,#339bb9);background-image:linear-gradient(to bottom,#5bc0de,#339bb9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de',endColorstr='#ff339bb9',GradientType=0)}.progress-info.progress-striped .bar,.progress-striped .bar-info{background-color:#5bc0de;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-warning .bar,.progress .bar-warning{background-color:#faa732;background-image:-moz-linear-gradient(top,#fbb450,#f89406);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fbb450),to(#f89406));background-image:-webkit-linear-gradient(top,#fbb450,#f89406);background-image:-o-linear-gradient(top,#fbb450,#f89406);background-image:linear-gradient(to bottom,#fbb450,#f89406);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450',endColorstr='#fff89406',GradientType=0)}.progress-warning.progress-striped .bar,.progress-striped .bar-warning{background-color:#fbb450;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.accordion{margin-bottom:20px}.accordion-group{margin-bottom:2px;border:1px solid #e5e5e5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.accordion-heading{border-bottom:0}.accordion-heading .accordion-toggle{display:block;padding:8px 15px}.accordion-toggle{cursor:pointer}.accordion-inner{padding:9px 15px;border-top:1px solid #e5e5e5}.carousel{position:relative;margin-bottom:20px;line-height:1}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel .item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-moz-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel .item>img{display:block;line-height:1}.carousel .active,.carousel .next,.carousel .prev{display:block}.carousel .active{left:0}.carousel .next,.carousel .prev{position:absolute;top:0;width:100%}.carousel .next{left:100%}.carousel .prev{left:-100%}.carousel .next.left,.carousel .prev.right{left:0}.carousel .active.left{left:-100%}.carousel .active.right{left:100%}.carousel-control{position:absolute;top:40%;left:15px;width:40px;height:40px;margin-top:-20px;font-size:60px;font-weight:100;line-height:30px;color:#fff;text-align:center;background:#222;border:3px solid #fff;-webkit-border-radius:23px;-moz-border-radius:23px;border-radius:23px;opacity:.5;filter:alpha(opacity=50)}.carousel-control.right{right:15px;left:auto}.carousel-control:hover{color:#fff;text-decoration:none;opacity:.9;filter:alpha(opacity=90)}.carousel-caption{position:absolute;right:0;bottom:0;left:0;padding:15px;background:#333;background:rgba(0,0,0,0.75)}.carousel-caption h4,.carousel-caption p{line-height:20px;color:#fff}.carousel-caption h4{margin:0 0 5px}.carousel-caption p{margin-bottom:0}.hero-unit{padding:60px;margin-bottom:30px;font-size:18px;font-weight:200;line-height:30px;color:inherit;background-color:#eee;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.hero-unit h1{margin-bottom:0;font-size:60px;line-height:1;letter-spacing:-1px;color:inherit}.hero-unit li{line-height:30px}.pull-right{float:right}.pull-left{float:left}.hide{display:none}.show{display:block}.invisible{visibility:hidden}.affix{position:fixed} diff --git a/dist/docs/styles/prettify.css b/dist/docs/styles/prettify.css new file mode 100644 index 0000000..e3c9497 --- /dev/null +++ b/dist/docs/styles/prettify.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} diff --git a/dist/docs/styles/style.css b/dist/docs/styles/style.css new file mode 100644 index 0000000..5a2a147 --- /dev/null +++ b/dist/docs/styles/style.css @@ -0,0 +1,16 @@ +.btn.c9 { + color: white; + background-color: #557e2f; + background-repeat: repeat-x; + background-image: -khtml-gradient(linear, left top, left bottom, from(#78ab44), to(#557e2f)); + background-image: -moz-linear-gradient(top, #78ab44, #557e2f); + background-image: -ms-linear-gradient(top, #78ab44, #557e2f); + background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #78ab44), color-stop(100%, #557e2f)); + background-image: -webkit-linear-gradient(top, #78ab44, #557e2f); + background-image: -o-linear-gradient(top, #78ab44, #557e2f); + background-image: linear-gradient(top, #78ab44, #557e2f); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#78ab44', endColorstr='#557e2f', GradientType=0); + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + border-color: #557e2f #557e2f #003F81; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) +} diff --git a/dist/elastic.js b/dist/elastic.js index 7aca7ed..81fe26c 100644 --- a/dist/elastic.js +++ b/dist/elastic.js @@ -1,6 +1,6 @@ -/*! elastic.js - v1.2.0 - 2014-10-13 +/*! elastic.js - v1.3.9 - 2016-04-13 * https://github.com/fullscale/elastic.js - * Copyright (c) 2014 FullScale Labs, LLC; Licensed MIT */ + * Copyright (c) 2016 FullScale Labs, LLC; Licensed MIT */ /** @namespace @@ -46,6 +46,7 @@ isFilter, // checks valid ejs Filter object isFacet, // checks valid ejs Facet object isAggregation, // checks valid ejs Aggregation object + isPartialField, // checks valid ejs PartialField object isScriptField, // checks valid ejs ScriptField object isGeoPoint, // checks valid ejs GeoPoint object isIndexedShape, // checks valid ejs IndexedShape object @@ -55,6 +56,7 @@ isSuggest, // checks valid ejs Suggest object isGenerator, // checks valid ejs Generator object isScoreFunction, // checks valid ejs ScoreFunction object + isInnerHits, // checks valid ejs InnerHits object // create ejs object ejs; @@ -200,6 +202,10 @@ return (isEJSObject(obj) && obj._type() === 'script field'); }; + isPartialField = function (obj) { + return (isEJSObject(obj) && obj._type() === 'partial field'); + }; + isGeoPoint = function (obj) { return (isEJSObject(obj) && obj._type() === 'geo point'); }; @@ -232,6 +238,9 @@ return (isEJSObject(obj) && obj._type() === 'score function'); }; + isInnerHits = function(obj) { + return (isEJSObject(obj) && obj._type() === 'inner hits'); + }; /** @mixin

The AggregationMixin provides support for common options used across @@ -312,6 +321,132 @@ }; }; + /** + @mixin +

The BucketsAggregationMixin provides support for common options used across + various buckets Aggregation implementations. This object should + not be used directly.

+ + @name ejs.BucketsAggregationMixin + @ejs aggregation + @borrows ejs.AggregationMixin.aggregation as aggregation + @borrows ejs.AggregationMixin.agg as agg + @borrows ejs.AggregationMixin._type as _type + @borrows ejs.AggregationMixin.toJSON as toJSON + + */ + ejs.BucketsAggregationMixin = function (name, type) { + + var + _common = ejs.AggregationMixin(name), + agg = _common.toJSON(); + + + agg[name][type] = {}; + + return extend(_common, { + + /** +

Sets the field to operate on.

+ + @member ejs.BucketsAggregationMixin + @param {String} field a valid field name.. + @returns {Object} returns this so that calls can be chained. + */ + field: function (field) { + if (field == null) { + return agg[name][type].field; + } + + agg[name][type].field = field; + return this; + }, + + /** + Allows you generate or modify the terms/values using a script. + + @member ejs.BucketsAggregationMixin + @param {String} scriptCode A valid script string to execute. + @returns {Object} returns this so that calls can be chained. + */ + script: function (scriptCode) { + if (scriptCode == null) { + return agg[name][type].script; + } + + agg[name][type].script = scriptCode; + return this; + }, + + /** + Allows you generate or modify the terms/values using a script. + + @member ejs.BucketsAggregationMixin + @param {String} scriptId A valid script id to execute. + @returns {Object} returns this so that calls can be chained. + */ + scriptId: function (scriptId) { + if (scriptId == null) { + return agg[name][type].script_id; + } + + agg[name][type].script_id = scriptId; + return this; + }, + + /** + Allows you generate or modify the terms/values using a script. + + @member ejs.BucketsAggregationMixin + @param {String} scriptFile A valid script file to execute. + @returns {Object} returns this so that calls can be chained. + */ + scriptFile: function (scriptFile) { + if (scriptFile == null) { + return agg[name][type].script_file; + } + + agg[name][type].script_file = scriptFile; + return this; + }, + + /** + The script language being used. + + @member ejs.BucketsAggregationMixin + @param {String} language The language of the script. + @returns {Object} returns this so that calls can be chained. + */ + lang: function (language) { + if (language == null) { + return agg[name][type].lang; + } + + agg[name][type].lang = language; + return this; + }, + + /** + Sets parameters that will be applied to the script. Overwrites + any existing params. + + @member ejs.BucketsAggregationMixin + @param {Object} p An object where the keys are the parameter name and + values are the parameter value. + @returns {Object} returns this so that calls can be chained. + */ + params: function (p) { + if (p == null) { + return agg[name][type].params; + } + + agg[name][type].params = p; + return this; + } + + }); + }; + /** @mixin

The DirectSettingsMixin provides support for common options used across @@ -820,34 +955,50 @@ }, /** - The script language being used. + Allows you generate or modify the terms/values using a script. @member ejs.MetricsAggregationMixin - @param {String} language The language of the script. + @param {String} scriptId A valid script id to execute. @returns {Object} returns this so that calls can be chained. */ - lang: function (language) { - if (language == null) { - return agg[name][type].lang; + scriptId: function (scriptId) { + if (scriptId == null) { + return agg[name][type].script_id; } - agg[name][type].lang = language; + agg[name][type].script_id = scriptId; return this; }, /** - Set to true to assume script values are sorted. + Allows you generate or modify the terms/values using a script. @member ejs.MetricsAggregationMixin - @param {Boolean} trueFalse assume sorted values or not + @param {String} scriptFile A valid script file to execute. @returns {Object} returns this so that calls can be chained. */ - scriptValuesSorted: function (trueFalse) { - if (trueFalse == null) { - return agg[name][type].script_values_sorted; + scriptFile: function (scriptFile) { + if (scriptFile == null) { + return agg[name][type].script_file; + } + + agg[name][type].script_file = scriptFile; + return this; + }, + + /** + The script language being used. + + @member ejs.MetricsAggregationMixin + @param {String} language The language of the script. + @returns {Object} returns this so that calls can be chained. + */ + lang: function (language) { + if (language == null) { + return agg[name][type].lang; } - agg[name][type].script_values_sorted = trueFalse; + agg[name][type].lang = language; return this; }, @@ -938,7 +1089,10 @@ ejs.ScoreFunctionMixin = function (name) { var func = {}; - func[name] = {}; + + if (name != null) { + func[name] = {}; + } return { @@ -962,6 +1116,26 @@ return this; }, + /** + Sets the weight of the score function + + @member ejs.ScoreFunctionMixin + @param {Number} oWeight The weight of this score function. + @returns {Object} returns this so that calls can be chained. + */ + weight: function (oWeight) { + if (oWeight == null) { + return func.weight; + } + + if (!isNumber(oWeight)) { + throw new TypeError('Argument must be a Number'); + } + + func.weight = oWeight; + return this; + }, + /** The type of ejs object. For internal use only. @@ -3074,8 +3248,9 @@ @ejs aggregation @borrows ejs.MetricsAggregationMixin.field as field @borrows ejs.MetricsAggregationMixin.script as script + @borrows ejs.MetricsAggregationMixin.scriptId as scriptId + @borrows ejs.MetricsAggregationMixin.scriptFile as scriptFile @borrows ejs.MetricsAggregationMixin.lang as lang - @borrows ejs.MetricsAggregationMixin.scriptValuesSorted as scriptValuesSorted @borrows ejs.MetricsAggregationMixin.params as params @borrows ejs.AggregationMixin._type as _type @borrows ejs.AggregationMixin.toJSON as toJSON @@ -3106,6 +3281,8 @@ @ejs aggregation @borrows ejs.MetricsAggregationMixin.field as field @borrows ejs.MetricsAggregationMixin.script as script + @borrows ejs.MetricsAggregationMixin.scriptId as scriptId + @borrows ejs.MetricsAggregationMixin.scriptFile as scriptFile @borrows ejs.MetricsAggregationMixin.lang as lang @borrows ejs.MetricsAggregationMixin.params as params @borrows ejs.AggregationMixin._type as _type @@ -3123,9 +3300,6 @@ _common = ejs.MetricsAggregationMixin(name, 'cardinality'), agg = _common.toJSON(); - // not supported in cardinality aggregation - delete _common.scriptValuesSorted; - return extend(_common, { /** @@ -3172,17 +3346,10 @@ /** @class -

A multi-bucket aggregation similar to the histogram except it can only be - applied on date values. Since dates are represented in elasticsearch - internally as long values, it is possible to use the normal histogram on - dates as well, though accuracy will be compromised. The reason for this is - in the fact that time based intervals are not fixed (think of leap years and - on the number of days in a month). For this reason, we need a special - support for time based data. From a functionality perspective, this - histogram supports the same features as the normal histogram. The main - difference is that the interval can be specified by date/time expressions.

+

A special single bucket aggregation that enables aggregating children + documents.

- @name ejs.DateHistogramAggregation + @name ejs.ChildrenAggregation @ejs aggregation @borrows ejs.AggregationMixin.aggregation as aggregation @borrows ejs.AggregationMixin.agg as agg @@ -3190,69 +3357,74 @@ @borrows ejs.AggregationMixin.toJSON as toJSON @desc -

Aggregation similar to the histogram except it can only be applied on - date values.

+

A special single bucket aggregation that enables aggregating children + documents.

@param {String} name The name which be used to refer to this aggregation. */ - ejs.DateHistogramAggregation = function (name) { + ejs.ChildrenAggregation = function (name) { var _common = ejs.AggregationMixin(name), agg = _common.toJSON(); - agg[name].date_histogram = {}; + agg[name].children = {}; return extend(_common, { /** -

Sets the field to gather terms from.

+

Sets the children type.

- @member ejs.DateHistogramAggregation - @param {String} field a valid field name.. + @member ejs.ChildrenAggregation + @param {String} children The children type value. @returns {Object} returns this so that calls can be chained. */ - field: function (field) { - if (field == null) { - return agg[name].date_histogram.field; + children: function (children) { + if (children == null) { + return agg[name].children.type; } - agg[name].date_histogram.field = field; + agg[name].children.type = children; return this; - }, + } - /** - Allows you generate or modify the terms using a script. + }); + }; - @member ejs.DateHistogramAggregation - @param {String} scriptCode A valid script string to execute. - @returns {Object} returns this so that calls can be chained. - */ - script: function (scriptCode) { - if (scriptCode == null) { - return agg[name].date_histogram.script; - } + /** + @class +

A multi-bucket aggregation similar to the histogram except it can only be + applied on date values. Since dates are represented in elasticsearch + internally as long values, it is possible to use the normal histogram on + dates as well, though accuracy will be compromised. The reason for this is + in the fact that time based intervals are not fixed (think of leap years and + on the number of days in a month). For this reason, we need a special + support for time based data. From a functionality perspective, this + histogram supports the same features as the normal histogram. The main + difference is that the interval can be specified by date/time expressions.

- agg[name].date_histogram.script = scriptCode; - return this; - }, + @name ejs.DateHistogramAggregation + @ejs aggregation + @borrows ejs.AggregationMixin.aggregation as aggregation + @borrows ejs.AggregationMixin.agg as agg + @borrows ejs.AggregationMixin._type as _type + @borrows ejs.AggregationMixin.toJSON as toJSON - /** - The script language being used. + @desc +

Aggregation similar to the histogram except it can only be applied on + date values.

- @member ejs.DateHistogramAggregation - @param {String} language The language of the script. - @returns {Object} returns this so that calls can be chained. - */ - lang: function (language) { - if (language == null) { - return agg[name].date_histogram.lang; - } + @param {String} name The name which be used to refer to this aggregation. - agg[name].date_histogram.lang = language; - return this; - }, + */ + ejs.DateHistogramAggregation = function (name) { + + var + _common = ejs.BucketsAggregationMixin(name, 'date_histogram'), + agg = _common.toJSON(); + + return extend(_common, { /** Set the date time zone. @@ -3414,22 +3586,6 @@ return this; }, - /** - Set to true to assume script values are sorted. - - @member ejs.DateHistogramAggregation - @param {Boolean} trueFalse assume sorted values or not - @returns {Object} returns this so that calls can be chained. - */ - scriptValuesSorted: function (trueFalse) { - if (trueFalse == null) { - return agg[name].date_histogram.script_values_sorted; - } - - agg[name].date_histogram.script_values_sorted = trueFalse; - return this; - }, - /** Set to true to apply interval adjusts to day and above intervals. @@ -3462,24 +3618,6 @@ return this; }, - /** - Sets parameters that will be applied to the script. Overwrites - any existing params. - - @member ejs.DateHistogramAggregation - @param {Object} p An object where the keys are the parameter name and - values are the parameter value. - @returns {Object} returns this so that calls can be chained. - */ - params: function (p) { - if (p == null) { - return agg[name].date_histogram.params; - } - - agg[name].date_histogram.params = p; - return this; - }, - /** Sets order for the aggregated values. @@ -3524,6 +3662,12 @@ @name ejs.DateRangeAggregation @ejs aggregation + @borrows ejs.BucketsAggregationMixin.field as field + @borrows ejs.BucketsAggregationMixin.script as script + @borrows ejs.BucketsAggregationMixin.scriptId as scriptId + @borrows ejs.BucketsAggregationMixin.scriptFile as scriptFile + @borrows ejs.BucketsAggregationMixin.lang as lang + @borrows ejs.BucketsAggregationMixin.params as params @borrows ejs.AggregationMixin.aggregation as aggregation @borrows ejs.AggregationMixin.agg as agg @borrows ejs.AggregationMixin._type as _type @@ -3538,66 +3682,16 @@ ejs.DateRangeAggregation = function (name) { var - _common = ejs.AggregationMixin(name), + _common = ejs.BucketsAggregationMixin(name, 'date_range'), agg = _common.toJSON(); - agg[name].date_range = {}; - return extend(_common, { /** -

Sets the field to gather terms from.

+ Sets the date format expression. @member ejs.DateRangeAggregation - @param {String} field a valid field name.. - @returns {Object} returns this so that calls can be chained. - */ - field: function (field) { - if (field == null) { - return agg[name].date_range.field; - } - - agg[name].date_range.field = field; - return this; - }, - - /** - Allows you generate or modify the terms using a script. - - @member ejs.DateRangeAggregation - @param {String} scriptCode A valid script string to execute. - @returns {Object} returns this so that calls can be chained. - */ - script: function (scriptCode) { - if (scriptCode == null) { - return agg[name].date_range.script; - } - - agg[name].date_range.script = scriptCode; - return this; - }, - - /** - The script language being used. - - @member ejs.DateRangeAggregation - @param {String} language The language of the script. - @returns {Object} returns this so that calls can be chained. - */ - lang: function (language) { - if (language == null) { - return agg[name].date_range.lang; - } - - agg[name].date_range.lang = language; - return this; - }, - - /** - Sets the date format expression. - - @member ejs.DateRangeAggregation - @param {String} f the format string + @param {String} f the format string @returns {Object} returns this so that calls can be chained. */ format: function (f) { @@ -3659,42 +3753,8 @@ agg[name].date_range.keyed = trueFalse; return this; - }, - - /** - Set to true to assume script values are sorted. - - @member ejs.DateRangeAggregation - @param {Boolean} trueFalse assume sorted values or not - @returns {Object} returns this so that calls can be chained. - */ - scriptValuesSorted: function (trueFalse) { - if (trueFalse == null) { - return agg[name].date_range.script_values_sorted; - } - - agg[name].date_range.script_values_sorted = trueFalse; - return this; - }, - - /** - Sets parameters that will be applied to the script. Overwrites - any existing params. - - @member ejs.DateRangeAggregation - @param {Object} p An object where the keys are the parameter name and - values are the parameter value. - @returns {Object} returns this so that calls can be chained. - */ - params: function (p) { - if (p == null) { - return agg[name].date_range.params; - } - - agg[name].date_range.params = p; - return this; } - + }); }; @@ -3713,8 +3773,9 @@ @ejs aggregation @borrows ejs.MetricsAggregationMixin.field as field @borrows ejs.MetricsAggregationMixin.script as script + @borrows ejs.MetricsAggregationMixin.scriptId as scriptId + @borrows ejs.MetricsAggregationMixin.scriptFile as scriptFile @borrows ejs.MetricsAggregationMixin.lang as lang - @borrows ejs.MetricsAggregationMixin.scriptValuesSorted as scriptValuesSorted @borrows ejs.MetricsAggregationMixin.params as params @borrows ejs.AggregationMixin._type as _type @borrows ejs.AggregationMixin.toJSON as toJSON @@ -3785,6 +3846,118 @@ }); }; + /** + @class +

Defines a multi bucket aggregations where each bucket is + associated with a filter. Each bucket will collect all documents + that match its associated filter.

+ + @name ejs.FiltersAggregation + @ejs aggregation + @borrows ejs.AggregationMixin.aggregation as aggregation + @borrows ejs.AggregationMixin.agg as agg + @borrows ejs.AggregationMixin._type as _type + @borrows ejs.AggregationMixin.toJSON as toJSON + + @desc +

Defines a multi bucket aggregations where each bucket is + associated with a filter. Each bucket will collect all documents + that match its associated filter.

+ + @param {String} name The name which be used to refer to this aggregation. + + */ + ejs.FiltersAggregation = function (name) { + + var + _common = ejs.AggregationMixin(name), + agg = _common.toJSON(); + + agg[name].filters = {'filters':{}}; + + return extend(_common, { + + /** +

Sets the filters to be used for this aggregation.

+ + @member ejs.FiltersAggregation + @param {Filter} oFilter A valid Filter object. + @param {string} id A name for the filter. + @returns {Object} returns this so that calls can be chained. + */ + filter: function (oFilter, id) { + var filters = {}; + // if (agg[name].filters.filters == null) { + // agg[name].filters.filters = {}; + // } + + if (!isFilter(oFilter)) { + throw new TypeError('First argument must be a Filter'); + } + + if (id == null) { + throw new TypeError('Second argument must be a name for the filter'); + } + + agg[name].filters.filters[id] = oFilter.toJSON(); + return this; + } + + }); + }; + +/** + @class +

A metric aggregation that computes the bounding box containing all geo_point values for a field.

+ + @name ejs.GeoBoundsAggregation + @ejs aggregation + @borrows ejs.MetricsAggregationMixin.field as field + @borrows ejs.AggregationMixin._type as _type + @borrows ejs.AggregationMixin.toJSON as toJSON + + @desc +

Aggregation that computes the bounding box containing all geo_point values for a field.

+ + @param {String} name The name which be used to refer to this aggregation. + + */ + ejs.GeoBoundsAggregation = function (name) { + + var + _common = ejs.MetricsAggregationMixin(name, 'geo_bounds'), + agg = _common.toJSON(); + + // not supported in geo bounds aggregation + delete _common.script; + delete _common.scriptId; + delete _common.scriptFile; + delete _common.lang; + delete _common.params; + + + return extend(_common, { + + /** + Optional parameter which specifies whether the bounding box should be allowed to overlap the international date line. The default value is true + + @member ejs.GeoBoundsAggregation + @param {Boolean} trueFalse to overlap the international date line. + @returns {Object} returns this so that calls can be chained. + */ + wrapLongitude: function (trueFalse) { + if (trueFalse == null) { + return agg[name].geo_bounds.wrap_longitude; + } + + agg[name].geo_bounds.wrap_longitude = trueFalse; + return this; + } + + }); + + }; + /** @class

A multi-bucket aggregation that works on geo_point fields and conceptually @@ -4139,6 +4312,12 @@ @name ejs.HistogramAggregation @ejs aggregation + @borrows ejs.BucketsAggregationMixin.field as field + @borrows ejs.BucketsAggregationMixin.script as script + @borrows ejs.BucketsAggregationMixin.scriptId as scriptId + @borrows ejs.BucketsAggregationMixin.scriptFile as scriptFile + @borrows ejs.BucketsAggregationMixin.lang as lang + @borrows ejs.BucketsAggregationMixin.params as params @borrows ejs.AggregationMixin.aggregation as aggregation @borrows ejs.AggregationMixin.agg as agg @borrows ejs.AggregationMixin._type as _type @@ -4154,61 +4333,11 @@ ejs.HistogramAggregation = function (name) { var - _common = ejs.AggregationMixin(name), + _common = ejs.BucketsAggregationMixin(name, 'histogram'), agg = _common.toJSON(); - agg[name].histogram = {}; - return extend(_common, { - /** -

Sets the field to gather terms from.

- - @member ejs.HistogramAggregation - @param {String} field a valid field name.. - @returns {Object} returns this so that calls can be chained. - */ - field: function (field) { - if (field == null) { - return agg[name].histogram.field; - } - - agg[name].histogram.field = field; - return this; - }, - - /** - Allows you generate or modify the terms using a script. - - @member ejs.HistogramAggregation - @param {String} scriptCode A valid script string to execute. - @returns {Object} returns this so that calls can be chained. - */ - script: function (scriptCode) { - if (scriptCode == null) { - return agg[name].histogram.script; - } - - agg[name].histogram.script = scriptCode; - return this; - }, - - /** - The script language being used. - - @member ejs.HistogramAggregation - @param {String} language The language of the script. - @returns {Object} returns this so that calls can be chained. - */ - lang: function (language) { - if (language == null) { - return agg[name].histogram.lang; - } - - agg[name].histogram.lang = language; - return this; - }, - /** Sets the format expression for the terms. Use for number or date formatting @@ -4305,40 +4434,6 @@ return this; }, - /** - Set to true to assume script values are sorted. - - @member ejs.HistogramAggregation - @param {Boolean} trueFalse assume sorted values or not - @returns {Object} returns this so that calls can be chained. - */ - scriptValuesSorted: function (trueFalse) { - if (trueFalse == null) { - return agg[name].histogram.script_values_sorted; - } - - agg[name].histogram.script_values_sorted = trueFalse; - return this; - }, - - /** - Sets parameters that will be applied to the script. Overwrites - any existing params. - - @member ejs.HistogramAggregation - @param {Object} p An object where the keys are the parameter name and - values are the parameter value. - @returns {Object} returns this so that calls can be chained. - */ - params: function (p) { - if (p == null) { - return agg[name].histogram.params; - } - - agg[name].histogram.params = p; - return this; - }, - /** Sets order for the aggregated values. @@ -4378,6 +4473,12 @@ @name ejs.IPv4RangeAggregation @ejs aggregation + @borrows ejs.BucketsAggregationMixin.field as field + @borrows ejs.BucketsAggregationMixin.script as script + @borrows ejs.BucketsAggregationMixin.scriptId as scriptId + @borrows ejs.BucketsAggregationMixin.scriptFile as scriptFile + @borrows ejs.BucketsAggregationMixin.lang as lang + @borrows ejs.BucketsAggregationMixin.params as params @borrows ejs.AggregationMixin.aggregation as aggregation @borrows ejs.AggregationMixin.agg as agg @borrows ejs.AggregationMixin._type as _type @@ -4392,97 +4493,47 @@ ejs.IPv4RangeAggregation = function (name) { var - _common = ejs.AggregationMixin(name), + _common = ejs.BucketsAggregationMixin(name, 'ip_range'), agg = _common.toJSON(); - agg[name].ip_range = {}; - return extend(_common, { /** -

Sets the field to gather terms from.

+ Adds a range to the list of exsiting range expressions. @member ejs.IPv4RangeAggregation - @param {String} field a valid field name.. + @param {String} from The start value, use null to ignore + @param {String} to The end value, use null to ignore. + @param {String} key Optional key/bucket name for keyed responses. @returns {Object} returns this so that calls can be chained. */ - field: function (field) { - if (field == null) { - return agg[name].ip_range.field; + range: function (from, to, mask, key) { + var rangeObj = {}; + if (agg[name].ip_range.ranges == null) { + agg[name].ip_range.ranges = []; } - agg[name].ip_range.field = field; - return this; - }, + if (from == null && to == null && mask == null) { + return agg[name].ip_range.ranges; + } - /** - Allows you generate or modify the terms using a script. + if (from != null) { + rangeObj.from = from; + } - @member ejs.IPv4RangeAggregation - @param {String} scriptCode A valid script string to execute. - @returns {Object} returns this so that calls can be chained. - */ - script: function (scriptCode) { - if (scriptCode == null) { - return agg[name].ip_range.script; + if (to != null) { + rangeObj.to = to; + } + + if (mask != null) { + rangeObj.mask = mask; + } + + if (key != null) { + rangeObj.key = key; } - agg[name].ip_range.script = scriptCode; - return this; - }, - - /** - The script language being used. - - @member ejs.IPv4RangeAggregation - @param {String} language The language of the script. - @returns {Object} returns this so that calls can be chained. - */ - lang: function (language) { - if (language == null) { - return agg[name].ip_range.lang; - } - - agg[name].ip_range.lang = language; - return this; - }, - - /** - Adds a range to the list of exsiting range expressions. - - @member ejs.IPv4RangeAggregation - @param {String} from The start value, use null to ignore - @param {String} to The end value, use null to ignore. - @param {String} key Optional key/bucket name for keyed responses. - @returns {Object} returns this so that calls can be chained. - */ - range: function (from, to, mask, key) { - var rangeObj = {}; - if (agg[name].ip_range.ranges == null) { - agg[name].ip_range.ranges = []; - } - - if (from == null && to == null && mask == null) { - return agg[name].ip_range.ranges; - } - - if (from != null) { - rangeObj.from = from; - } - - if (to != null) { - rangeObj.to = to; - } - - if (mask != null) { - rangeObj.mask = mask; - } - - if (key != null) { - rangeObj.key = key; - } - - agg[name].ip_range.ranges.push(rangeObj); + agg[name].ip_range.ranges.push(rangeObj); return this; }, @@ -4501,40 +4552,6 @@ agg[name].ip_range.keyed = trueFalse; return this; - }, - - /** - Set to true to assume script values are sorted. - - @member ejs.IPv4RangeAggregation - @param {Boolean} trueFalse assume sorted values or not - @returns {Object} returns this so that calls can be chained. - */ - scriptValuesSorted: function (trueFalse) { - if (trueFalse == null) { - return agg[name].ip_range.script_values_sorted; - } - - agg[name].ip_range.script_values_sorted = trueFalse; - return this; - }, - - /** - Sets parameters that will be applied to the script. Overwrites - any existing params. - - @member ejs.IPv4RangeAggregation - @param {Object} p An object where the keys are the parameter name and - values are the parameter value. - @returns {Object} returns this so that calls can be chained. - */ - params: function (p) { - if (p == null) { - return agg[name].ip_range.params; - } - - agg[name].ip_range.params = p; - return this; } }); @@ -4551,8 +4568,9 @@ @ejs aggregation @borrows ejs.MetricsAggregationMixin.field as field @borrows ejs.MetricsAggregationMixin.script as script + @borrows ejs.MetricsAggregationMixin.scriptId as scriptId + @borrows ejs.MetricsAggregationMixin.scriptFile as scriptFile @borrows ejs.MetricsAggregationMixin.lang as lang - @borrows ejs.MetricsAggregationMixin.scriptValuesSorted as scriptValuesSorted @borrows ejs.MetricsAggregationMixin.params as params @borrows ejs.AggregationMixin._type as _type @borrows ejs.AggregationMixin.toJSON as toJSON @@ -4584,8 +4602,9 @@ @ejs aggregation @borrows ejs.MetricsAggregationMixin.field as field @borrows ejs.MetricsAggregationMixin.script as script + @borrows ejs.MetricsAggregationMixin.scriptId as scriptId + @borrows ejs.MetricsAggregationMixin.scriptFile as scriptFile @borrows ejs.MetricsAggregationMixin.lang as lang - @borrows ejs.MetricsAggregationMixin.scriptValuesSorted as scriptValuesSorted @borrows ejs.MetricsAggregationMixin.params as params @borrows ejs.AggregationMixin._type as _type @borrows ejs.AggregationMixin.toJSON as toJSON @@ -4713,8 +4732,9 @@ @ejs aggregation @borrows ejs.MetricsAggregationMixin.field as field @borrows ejs.MetricsAggregationMixin.script as script + @borrows ejs.MetricsAggregationMixin.scriptId as scriptId + @borrows ejs.MetricsAggregationMixin.scriptFile as scriptFile @borrows ejs.MetricsAggregationMixin.lang as lang - @borrows ejs.MetricsAggregationMixin.scriptValuesSorted as scriptValuesSorted @borrows ejs.MetricsAggregationMixin.params as params @borrows ejs.AggregationMixin._type as _type @borrows ejs.AggregationMixin.toJSON as toJSON @@ -4828,6 +4848,12 @@ @name ejs.RangeAggregation @ejs aggregation + @borrows ejs.BucketsAggregationMixin.field as field + @borrows ejs.BucketsAggregationMixin.script as script + @borrows ejs.BucketsAggregationMixin.scriptId as scriptId + @borrows ejs.BucketsAggregationMixin.scriptFile as scriptFile + @borrows ejs.BucketsAggregationMixin.lang as lang + @borrows ejs.BucketsAggregationMixin.params as params @borrows ejs.AggregationMixin.aggregation as aggregation @borrows ejs.AggregationMixin.agg as agg @borrows ejs.AggregationMixin._type as _type @@ -4843,61 +4869,11 @@ ejs.RangeAggregation = function (name) { var - _common = ejs.AggregationMixin(name), + _common = ejs.BucketsAggregationMixin(name, 'range'), agg = _common.toJSON(); - agg[name].range = {}; - return extend(_common, { - /** -

Sets the field to gather terms from.

- - @member ejs.RangeAggregation - @param {String} field a valid field name.. - @returns {Object} returns this so that calls can be chained. - */ - field: function (field) { - if (field == null) { - return agg[name].range.field; - } - - agg[name].range.field = field; - return this; - }, - - /** - Allows you generate or modify the terms using a script. - - @member ejs.RangeAggregation - @param {String} scriptCode A valid script string to execute. - @returns {Object} returns this so that calls can be chained. - */ - script: function (scriptCode) { - if (scriptCode == null) { - return agg[name].range.script; - } - - agg[name].range.script = scriptCode; - return this; - }, - - /** - The script language being used. - - @member ejs.RangeAggregation - @param {String} language The language of the script. - @returns {Object} returns this so that calls can be chained. - */ - lang: function (language) { - if (language == null) { - return agg[name].range.lang; - } - - agg[name].range.lang = language; - return this; - }, - /** Adds a range to the list of exsiting range expressions. @@ -4950,313 +4926,282 @@ return this; }, - /** - Set to true to assume script values are sorted. - - @member ejs.RangeAggregation - @param {Boolean} trueFalse assume sorted values or not - @returns {Object} returns this so that calls can be chained. - */ - scriptValuesSorted: function (trueFalse) { - if (trueFalse == null) { - return agg[name].range.script_values_sorted; - } - - agg[name].range.script_values_sorted = trueFalse; - return this; - }, - - /** - Sets parameters that will be applied to the script. Overwrites - any existing params. - - @member ejs.RangeAggregation - @param {Object} p An object where the keys are the parameter name and - values are the parameter value. - @returns {Object} returns this so that calls can be chained. - */ - params: function (p) { - if (p == null) { - return agg[name].range.params; - } - - agg[name].range.params = p; - return this; - } - }); }; /** @class -

An aggregation that returns interesting or unusual occurrences of terms in - a set.

+

A metric aggregation that executes using scripts to provide a metric output.

- @name ejs.SignificantTermsAggregation + @name ejs.ScriptedMetricAggregation @ejs aggregation - @borrows ejs.AggregationMixin.aggregation as aggregation - @borrows ejs.AggregationMixin.agg as agg + @borrows ejs.MetricsAggregationMixin.lang as lang + @borrows ejs.MetricsAggregationMixin.params as params @borrows ejs.AggregationMixin._type as _type @borrows ejs.AggregationMixin.toJSON as toJSON @desc -

An aggregation that returns interesting or unusual occurrences of terms in - a set.

+

Aggregation that keeps track and returns the minimum value among numeric + values extracted from the aggregated documents.

@param {String} name The name which be used to refer to this aggregation. */ - ejs.SignificantTermsAggregation = function (name) { + ejs.ScriptedMetricAggregation = function (name) { var - _common = ejs.AggregationMixin(name), + _common = ejs.MetricsAggregationMixin(name, 'scripted_metric'), agg = _common.toJSON(); - - agg[name].significant_terms = {}; - + + delete _common.field; + delete _common.script; + delete _common.scriptId; + delete _common.scriptFile; + return extend(_common, { /** -

Sets the field to gather terms from.

+

Sets the initialization script.

- @member ejs.SignificantTermsAggregation - @param {String} field a valid field name.. + @member ejs.ScriptedMetricAggregation + @param {String} initScript The initialization script @returns {Object} returns this so that calls can be chained. */ - field: function (field) { - if (field == null) { - return agg[name].significant_terms.field; + initScript: function (initScript) { + if (initScript == null) { + return agg[name].scripted_metric.init_script; } - agg[name].significant_terms.field = field; + agg[name].scripted_metric.init_script = initScript; return this; }, /** - Sets the format expression for the terms. Use for number or date - formatting. - - @member ejs.SignificantTermsAggregation - @param {String} f the format string +

Sets the map script. This is the only required script.

+ @member ejs.ScriptedMetricAggregation + @param {String} mapScript The map script. @returns {Object} returns this so that calls can be chained. */ - format: function (f) { - if (f == null) { - return agg[name].significant_terms.format; + mapScript: function (mapScript) { + if (mapScript == null) { + return agg[name].scripted_metric.map_script; } - agg[name].significant_terms.format = f; + agg[name].scripted_metric.map_script = mapScript; return this; }, /** -

Allows you to allow only specific entries using a regular - expression. You can also optionally pass in a set of flags to apply - to the regular expression. Valid flags are: CASE_INSENSITIVE, - MULTILINE, DOTALL, UNICODE_CASE, CANON_EQ, UNIX_LINES, LITERAL, - COMMENTS, and UNICODE_CHAR_CLASS. Separate multiple flags with a | - character.

- - @member ejs.SignificantTermsAggregation - @param {String} include A regular expression include string - @param {String} flags Optional regular expression flags.. +

Sets the combine phase script.

+ @member ejs.ScriptedMetricAggregation + @param {String} combineScript The combine script. @returns {Object} returns this so that calls can be chained. */ - include: function (include, flags) { - if (agg[name].significant_terms.include == null) { - agg[name].significant_terms.include = {}; + combineScript: function (combineScript) { + if (combineScript == null) { + return agg[name].scripted_metric.combine_script; } - if (include == null) { - return agg[name].significant_terms.include; - } + agg[name].scripted_metric.combine_script = combineScript; + return this; + }, - agg[name].significant_terms.include.pattern = include; - if (flags != null) { - agg[name].significant_terms.include.flags = flags; + /** +

Sets the combine phase script.

+ @member ejs.ScriptedMetricAggregation + @param {String} reduceScript The reduce script. + @returns {Object} returns this so that calls can be chained. + */ + reduceScript: function (reduceScript) { + if (reduceScript == null) { + return agg[name].scripted_metric.reduce_script; } + agg[name].scripted_metric.reduce_script = reduceScript; return this; }, /** -

Allows you to filter out unwanted facet entries using a regular - expression. You can also optionally pass in a set of flags to apply - to the regular expression. Valid flags are: CASE_INSENSITIVE, - MULTILINE, DOTALL, UNICODE_CASE, CANON_EQ, UNIX_LINES, LITERAL, - COMMENTS, and UNICODE_CHAR_CLASS. Separate multiple flags with a | - character.

+

Sets the init_script_file.

- @member ejs.SignificantTermsAggregation - @param {String} exclude A regular expression exclude string - @param {String} flags Optional regular expression flags.. + @member ejs.ScriptedMetricAggregation + @param {String} init_script_file A valid script file name. @returns {Object} returns this so that calls can be chained. */ - exclude: function (exclude, flags) { - if (agg[name].significant_terms.exclude == null) { - agg[name].significant_terms.exclude = {}; - } - - if (exclude == null) { - return agg[name].significant_terms.exclude; - } - - agg[name].significant_terms.exclude.pattern = exclude; - if (flags != null) { - agg[name].significant_terms.exclude.flags = flags; + initScriptFile: function (init_script_file) { + if (init_script_file == null) { + return agg[name].scripted_metric.init_script_file; } + agg[name].scripted_metric.init_script_file = init_script_file; return this; }, /** - Sets the execution hint determines how the aggregation is computed. - Supported values are: map and ordinals. +

Sets the init_script_id.

- @member ejs.SignificantTermsAggregation - @param {String} h The hint value as a string. + @member ejs.ScriptedMetricAggregation + @param {String} init_script_id A valid id from indexed script. @returns {Object} returns this so that calls can be chained. */ - executionHint: function (h) { - if (h == null) { - return agg[name].significant_terms.execution_hint; + initScriptId: function (init_script_id) { + if (init_script_id == null) { + return agg[name].scripted_metric.init_script_id; } - h = h.toLowerCase(); - if (h === 'map' || h === 'ordinals') { - agg[name].significant_terms.execution_hint = h; + agg[name].scripted_metric.init_script_id = init_script_id; + return this; + }, + + /** +

Sets the map_script_file.

+ + @member ejs.ScriptedMetricAggregation + @param {String} map_script_file A valid script file name. + @returns {Object} returns this so that calls can be chained. + */ + mapScriptFile : function (map_script_file) { + if (map_script_file == null) { + return agg[name].scripted_metric.map_script_file; } + agg[name].scripted_metric.map_script_file = map_script_file; return this; }, /** - Sets the number of aggregation entries that will be returned. +

Sets the map_script_id.

- @member ejs.SignificantTermsAggregation - @param {Integer} size The numer of aggregation entries to be returned. + @member ejs.ScriptedMetricAggregation + @param {String} map_script_id A valid id from indexed script. @returns {Object} returns this so that calls can be chained. */ - size: function (size) { - if (size == null) { - return agg[name].significant_terms.size; + mapScriptId : function (map_script_id) { + if (map_script_id == null) { + return agg[name].scripted_metric.map_script_id; } - agg[name].significant_terms.size = size; + agg[name].scripted_metric.map_script_id = map_script_id; return this; }, - /** - Determines how many terms the coordinating node will request from - each shard. +

Sets the combine_script_file.

- @member ejs.SignificantTermsAggregation - @param {Integer} shardSize The numer of terms to fetch from each shard. + @member ejs.ScriptedMetricAggregation + @param {String} combine_script_file A valid script file name. @returns {Object} returns this so that calls can be chained. */ - shardSize: function (shardSize) { - if (shardSize == null) { - return agg[name].significant_terms.shard_size; + combineScriptFile: function (combine_script_file) { + if (combine_script_file == null) { + return agg[name].scripted_metric.combine_script_file; } - agg[name].significant_terms.shard_size = shardSize; + agg[name].scripted_metric.combine_script_file = combine_script_file; return this; }, - + /** - Only return terms that match more than a configured number of hits. +

Sets the combine_script_id.

- @member ejs.SignificantTermsAggregation - @param {Integer} num The numer of minimum number of hits. + @member ejs.ScriptedMetricAggregation + @param {String} combine_script_id A valid id from indexed script. @returns {Object} returns this so that calls can be chained. */ - minDocCount: function (num) { - if (num == null) { - return agg[name].significant_terms.min_doc_count; + combineScriptId: function (combine_script_id) { + if (combine_script_id == null) { + return agg[name].scripted_metric.combine_script_id; } - agg[name].significant_terms.min_doc_count = num; + agg[name].scripted_metric.combine_script_id = combine_script_id; return this; - } - - }); - }; - - /** - @class -

A multi-value metrics aggregation that computes stats over numeric values - extracted from the aggregated documents. These values can be extracted either - from specific numeric fields in the documents, or be generated by a provided - script.

- -

The stats that are returned consist of: min, max, sum, count and avg.

- - @name ejs.StatsAggregation - @ejs aggregation - @borrows ejs.MetricsAggregationMixin.field as field - @borrows ejs.MetricsAggregationMixin.script as script - @borrows ejs.MetricsAggregationMixin.lang as lang - @borrows ejs.MetricsAggregationMixin.scriptValuesSorted as scriptValuesSorted - @borrows ejs.MetricsAggregationMixin.params as params - @borrows ejs.AggregationMixin._type as _type - @borrows ejs.AggregationMixin.toJSON as toJSON + }, - @desc -

Aggregation that computes stats over numeric values extracted from the - aggregated documents.

+ /** +

Sets the reduce_script_file.

- @param {String} name The name which be used to refer to this aggregation. + @member ejs.ScriptedMetricAggregation + @param {String} reduce_script_file A valid script file name. + @returns {Object} returns this so that calls can be chained. + */ + reduceScriptFile: function (reduce_script_file) { + if (reduce_script_file == null) { + return agg[name].scripted_metric.reduce_script_file; + } - */ - ejs.StatsAggregation = function (name) { + agg[name].scripted_metric.reduce_script_file = reduce_script_file; + return this; + }, - var - _common = ejs.MetricsAggregationMixin(name, 'stats'), - agg = _common.toJSON(); + /** +

Sets the reduce_script_id.

- return _common; - }; + @member ejs.ScriptedMetricAggregation + @param {String} reduce_script_id A valid id from indexed script. + @returns {Object} returns this so that calls can be chained. + */ + reduceScriptId: function (reduce_script_id) { + if (reduce_script_id == null) { + return agg[name].scripted_metric.reduce_script_id; + } - /** - @class -

A single-value metrics aggregation that sums up numeric values that are - extracted from the aggregated documents. These values can be extracted either - from specific numeric fields in the documents, or be generated by a - provided script.

+ agg[name].scripted_metric.reduce_script_id = reduce_script_id; + return this; + }, - @name ejs.SumAggregation - @ejs aggregation - @borrows ejs.MetricsAggregationMixin.field as field - @borrows ejs.MetricsAggregationMixin.script as script - @borrows ejs.MetricsAggregationMixin.lang as lang - @borrows ejs.MetricsAggregationMixin.scriptValuesSorted as scriptValuesSorted - @borrows ejs.MetricsAggregationMixin.params as params - @borrows ejs.AggregationMixin._type as _type - @borrows ejs.AggregationMixin.toJSON as toJSON + /** +

Set parameters which will be passed to the init, map and combine scripts.

+ @member ejs.ScriptedMetricAggregation + @param {String} params Parameters passed to the init, map and combine scripts. + @returns {Object} returns this so that calls can be chained. + */ + params: function (params) { + if (params == null) { + return agg[name].scripted_metric.params; + } - @desc -

Aggregation that sums up numeric values that are extracted from the - aggregated documents.

+ agg[name].scripted_metric.params = params; + return this; + }, - @param {String} name The name which be used to refer to this aggregation. + /** +

Set parameters which will be passed to the reduce script.

+ @member ejs.ScriptedMetricAggregation + @param {String} reduceParams Paramters to pass to the recude script. + @returns {Object} returns this so that calls can be chained. + */ + reduceParams: function (reduceParams) { + if (reduceParams == null) { + return agg[name].scripted_metric.reduce_params; + } - */ - ejs.SumAggregation = function (name) { + agg[name].scripted_metric.reduce_params = reduceParams; + return this; + }, - var - _common = ejs.MetricsAggregationMixin(name, 'sum'), - agg = _common.toJSON(); + /** +

Set the scripting language used for this aggregation.

+ @member ejs.ScriptedMetricAggregation + @param {String} lang The script langauge. + @returns {Object} returns this so that calls can be chained. + */ + lang: function (lang) { + if (lang == null) { + return agg[name].scripted_metric.lang; + } - return _common; + agg[name].scripted_metric.lang = lang; + return this; + } + }); }; /** @class -

A multi-bucket value source based aggregation where buckets are dynamically - built - one per unique value.

+

An aggregation that returns interesting or unusual occurrences of terms in + a set.

- @name ejs.TermsAggregation + @name ejs.SignificantTermsAggregation @ejs aggregation @borrows ejs.AggregationMixin.aggregation as aggregation @borrows ejs.AggregationMixin.agg as agg @@ -5264,105 +5209,52 @@ @borrows ejs.AggregationMixin.toJSON as toJSON @desc -

Defines an aggregation of unique values/terms.

+

An aggregation that returns interesting or unusual occurrences of terms in + a set.

@param {String} name The name which be used to refer to this aggregation. */ - ejs.TermsAggregation = function (name) { + ejs.SignificantTermsAggregation = function (name) { var _common = ejs.AggregationMixin(name), agg = _common.toJSON(); - agg[name].terms = {}; + agg[name].significant_terms = {}; return extend(_common, { /**

Sets the field to gather terms from.

- @member ejs.TermsAggregation + @member ejs.SignificantTermsAggregation @param {String} field a valid field name.. @returns {Object} returns this so that calls can be chained. */ field: function (field) { if (field == null) { - return agg[name].terms.field; - } - - agg[name].terms.field = field; - return this; - }, - - /** - Allows you generate or modify the terms using a script. - - @member ejs.TermsAggregation - @param {String} scriptCode A valid script string to execute. - @returns {Object} returns this so that calls can be chained. - */ - script: function (scriptCode) { - if (scriptCode == null) { - return agg[name].terms.script; - } - - agg[name].terms.script = scriptCode; - return this; - }, - - /** - The script language being used. - - @member ejs.TermsAggregation - @param {String} language The language of the script. - @returns {Object} returns this so that calls can be chained. - */ - lang: function (language) { - if (language == null) { - return agg[name].terms.lang; - } - - agg[name].terms.lang = language; - return this; - }, - - /** - Sets the type of the field value for use in scripts. Current values are: - string, double, float, long, integer, short, and byte. - - @member ejs.TermsAggregation - @param {String} v The value type - @returns {Object} returns this so that calls can be chained. - */ - valueType: function (v) { - if (v == null) { - return agg[name].terms.value_type; - } - - v = v.toLowerCase(); - if (v === 'string' || v === 'double' || v === 'float' || v === 'long' || - v === 'integer' || v === 'short' || v === 'byte') { - agg[name].terms.value_type = v; + return agg[name].significant_terms.field; } + agg[name].significant_terms.field = field; return this; }, /** Sets the format expression for the terms. Use for number or date - formatting + formatting. - @member ejs.TermsAggregation + @member ejs.SignificantTermsAggregation @param {String} f the format string @returns {Object} returns this so that calls can be chained. */ format: function (f) { if (f == null) { - return agg[name].terms.format; + return agg[name].significant_terms.format; } - agg[name].terms.format = f; + agg[name].significant_terms.format = f; return this; }, @@ -5374,23 +5266,23 @@ COMMENTS, and UNICODE_CHAR_CLASS. Separate multiple flags with a | character.

- @member ejs.TermsAggregation + @member ejs.SignificantTermsAggregation @param {String} include A regular expression include string @param {String} flags Optional regular expression flags.. @returns {Object} returns this so that calls can be chained. */ include: function (include, flags) { - if (agg[name].terms.include == null) { - agg[name].terms.include = {}; + if (agg[name].significant_terms.include == null) { + agg[name].significant_terms.include = {}; } if (include == null) { - return agg[name].terms.include; + return agg[name].significant_terms.include; } - agg[name].terms.include.pattern = include; + agg[name].significant_terms.include.pattern = include; if (flags != null) { - agg[name].terms.include.flags = flags; + agg[name].significant_terms.include.flags = flags; } return this; @@ -5404,23 +5296,23 @@ COMMENTS, and UNICODE_CHAR_CLASS. Separate multiple flags with a | character.

- @member ejs.TermsAggregation + @member ejs.SignificantTermsAggregation @param {String} exclude A regular expression exclude string @param {String} flags Optional regular expression flags.. @returns {Object} returns this so that calls can be chained. */ exclude: function (exclude, flags) { - if (agg[name].terms.exclude == null) { - agg[name].terms.exclude = {}; + if (agg[name].significant_terms.exclude == null) { + agg[name].significant_terms.exclude = {}; } if (exclude == null) { - return agg[name].terms.exclude; + return agg[name].significant_terms.exclude; } - agg[name].terms.exclude.pattern = exclude; + agg[name].significant_terms.exclude.pattern = exclude; if (flags != null) { - agg[name].terms.exclude.flags = flags; + agg[name].significant_terms.exclude.flags = flags; } return this; @@ -5430,52 +5322,36 @@ Sets the execution hint determines how the aggregation is computed. Supported values are: map and ordinals. - @member ejs.TermsAggregation + @member ejs.SignificantTermsAggregation @param {String} h The hint value as a string. @returns {Object} returns this so that calls can be chained. */ executionHint: function (h) { if (h == null) { - return agg[name].terms.execution_hint; + return agg[name].significant_terms.execution_hint; } h = h.toLowerCase(); if (h === 'map' || h === 'ordinals') { - agg[name].terms.execution_hint = h; - } - - return this; - }, - - /** - Set to true to assume script values are unique. - - @member ejs.TermsAggregation - @param {Boolean} trueFalse assume unique values or not - @returns {Object} returns this so that calls can be chained. - */ - scriptValuesUnique: function (trueFalse) { - if (trueFalse == null) { - return agg[name].terms.script_values_unique; + agg[name].significant_terms.execution_hint = h; } - agg[name].terms.script_values_unique = trueFalse; return this; }, /** Sets the number of aggregation entries that will be returned. - @member ejs.TermsAggregation + @member ejs.SignificantTermsAggregation @param {Integer} size The numer of aggregation entries to be returned. @returns {Object} returns this so that calls can be chained. */ size: function (size) { if (size == null) { - return agg[name].terms.size; + return agg[name].significant_terms.size; } - agg[name].terms.size = size; + agg[name].significant_terms.size = size; return this; }, @@ -5484,55 +5360,292 @@ Determines how many terms the coordinating node will request from each shard. - @member ejs.TermsAggregation + @member ejs.SignificantTermsAggregation @param {Integer} shardSize The numer of terms to fetch from each shard. @returns {Object} returns this so that calls can be chained. */ shardSize: function (shardSize) { if (shardSize == null) { - return agg[name].terms.shard_size; + return agg[name].significant_terms.shard_size; } - agg[name].terms.shard_size = shardSize; + agg[name].significant_terms.shard_size = shardSize; return this; }, /** Only return terms that match more than a configured number of hits. - @member ejs.TermsAggregation + @member ejs.SignificantTermsAggregation @param {Integer} num The numer of minimum number of hits. @returns {Object} returns this so that calls can be chained. */ minDocCount: function (num) { if (num == null) { - return agg[name].terms.min_doc_count; + return agg[name].significant_terms.min_doc_count; } - agg[name].terms.min_doc_count = num; + agg[name].significant_terms.min_doc_count = num; return this; - }, - - /** - Sets parameters that will be applied to the script. Overwrites - any existing params. + } - @member ejs.TermsAggregation - @param {Object} p An object where the keys are the parameter name and - values are the parameter value. - @returns {Object} returns this so that calls can be chained. - */ - params: function (p) { - if (p == null) { - return agg[name].terms.params; - } + }); + }; - agg[name].terms.params = p; - return this; - }, + /** + @class +

A multi-value metrics aggregation that computes stats over numeric values + extracted from the aggregated documents. These values can be extracted either + from specific numeric fields in the documents, or be generated by a provided + script.

- /** - Sets order for the aggregated values. +

The stats that are returned consist of: min, max, sum, count and avg.

+ + @name ejs.StatsAggregation + @ejs aggregation + @borrows ejs.MetricsAggregationMixin.field as field + @borrows ejs.MetricsAggregationMixin.script as script + @borrows ejs.MetricsAggregationMixin.scriptId as scriptId + @borrows ejs.MetricsAggregationMixin.scriptFile as scriptFile + @borrows ejs.MetricsAggregationMixin.lang as lang + @borrows ejs.MetricsAggregationMixin.params as params + @borrows ejs.AggregationMixin._type as _type + @borrows ejs.AggregationMixin.toJSON as toJSON + + @desc +

Aggregation that computes stats over numeric values extracted from the + aggregated documents.

+ + @param {String} name The name which be used to refer to this aggregation. + + */ + ejs.StatsAggregation = function (name) { + + var + _common = ejs.MetricsAggregationMixin(name, 'stats'), + agg = _common.toJSON(); + + return _common; + }; + + /** + @class +

A single-value metrics aggregation that sums up numeric values that are + extracted from the aggregated documents. These values can be extracted either + from specific numeric fields in the documents, or be generated by a + provided script.

+ + @name ejs.SumAggregation + @ejs aggregation + @borrows ejs.MetricsAggregationMixin.field as field + @borrows ejs.MetricsAggregationMixin.script as script + @borrows ejs.MetricsAggregationMixin.scriptId as scriptId + @borrows ejs.MetricsAggregationMixin.scriptFile as scriptFile + @borrows ejs.MetricsAggregationMixin.lang as lang + @borrows ejs.MetricsAggregationMixin.params as params + @borrows ejs.AggregationMixin._type as _type + @borrows ejs.AggregationMixin.toJSON as toJSON + + @desc +

Aggregation that sums up numeric values that are extracted from the + aggregated documents.

+ + @param {String} name The name which be used to refer to this aggregation. + + */ + ejs.SumAggregation = function (name) { + + var + _common = ejs.MetricsAggregationMixin(name, 'sum'), + agg = _common.toJSON(); + + return _common; + }; + + /** + @class +

A multi-bucket value source based aggregation where buckets are dynamically + built - one per unique value.

+ + @name ejs.TermsAggregation + @ejs aggregation + @borrows ejs.BucketsAggregationMixin.field as field + @borrows ejs.BucketsAggregationMixin.script as script + @borrows ejs.BucketsAggregationMixin.scriptId as scriptId + @borrows ejs.BucketsAggregationMixin.scriptFile as scriptFile + @borrows ejs.BucketsAggregationMixin.lang as lang + @borrows ejs.BucketsAggregationMixin.params as params + @borrows ejs.AggregationMixin.aggregation as aggregation + @borrows ejs.AggregationMixin.agg as agg + @borrows ejs.AggregationMixin._type as _type + @borrows ejs.AggregationMixin.toJSON as toJSON + + @desc +

Defines an aggregation of unique values/terms.

+ + @param {String} name The name which be used to refer to this aggregation. + + */ + ejs.TermsAggregation = function (name) { + + var + _common = ejs.BucketsAggregationMixin(name, 'terms'), + agg = _common.toJSON(); + + agg[name].terms = {}; + + return extend(_common, { + + /** + Sets the format expression for the terms. Use for number or date + formatting + + @member ejs.TermsAggregation + @param {String} f the format string + @returns {Object} returns this so that calls can be chained. + */ + format: function (f) { + if (f == null) { + return agg[name].terms.format; + } + + agg[name].terms.format = f; + return this; + }, + + /** +

Allows you to allow only specific entries using a regular + expression. You can also optionally pass in a set of flags to apply + to the regular expression. Valid flags are: CASE_INSENSITIVE, + MULTILINE, DOTALL, UNICODE_CASE, CANON_EQ, UNIX_LINES, LITERAL, + COMMENTS, and UNICODE_CHAR_CLASS. Separate multiple flags with a | + character.

+ + @member ejs.TermsAggregation + @param {String} include A regular expression include string + @param {String} flags Optional regular expression flags.. + @returns {Object} returns this so that calls can be chained. + */ + include: function (include, flags) { + if (agg[name].terms.include == null) { + agg[name].terms.include = {}; + } + + if (include == null) { + return agg[name].terms.include; + } + + agg[name].terms.include.pattern = include; + if (flags != null) { + agg[name].terms.include.flags = flags; + } + + return this; + }, + + /** +

Allows you to filter out unwanted facet entries using a regular + expression. You can also optionally pass in a set of flags to apply + to the regular expression. Valid flags are: CASE_INSENSITIVE, + MULTILINE, DOTALL, UNICODE_CASE, CANON_EQ, UNIX_LINES, LITERAL, + COMMENTS, and UNICODE_CHAR_CLASS. Separate multiple flags with a | + character.

+ + @member ejs.TermsAggregation + @param {String} exclude A regular expression exclude string + @param {String} flags Optional regular expression flags.. + @returns {Object} returns this so that calls can be chained. + */ + exclude: function (exclude, flags) { + if (agg[name].terms.exclude == null) { + agg[name].terms.exclude = {}; + } + + if (exclude == null) { + return agg[name].terms.exclude; + } + + agg[name].terms.exclude.pattern = exclude; + if (flags != null) { + agg[name].terms.exclude.flags = flags; + } + + return this; + }, + + /** + Sets the execution hint determines how the aggregation is computed. + Supported values are: map and ordinals. + + @member ejs.TermsAggregation + @param {String} h The hint value as a string. + @returns {Object} returns this so that calls can be chained. + */ + executionHint: function (h) { + if (h == null) { + return agg[name].terms.execution_hint; + } + + h = h.toLowerCase(); + if (h === 'map' || h === 'ordinals') { + agg[name].terms.execution_hint = h; + } + + return this; + }, + + /** + Sets the number of aggregation entries that will be returned. + + @member ejs.TermsAggregation + @param {Integer} size The numer of aggregation entries to be returned. + @returns {Object} returns this so that calls can be chained. + */ + size: function (size) { + if (size == null) { + return agg[name].terms.size; + } + + agg[name].terms.size = size; + return this; + }, + + + /** + Determines how many terms the coordinating node will request from + each shard. + + @member ejs.TermsAggregation + @param {Integer} shardSize The numer of terms to fetch from each shard. + @returns {Object} returns this so that calls can be chained. + */ + shardSize: function (shardSize) { + if (shardSize == null) { + return agg[name].terms.shard_size; + } + + agg[name].terms.shard_size = shardSize; + return this; + }, + + /** + Only return terms that match more than a configured number of hits. + + @member ejs.TermsAggregation + @param {Integer} num The numer of minimum number of hits. + @returns {Object} returns this so that calls can be chained. + */ + minDocCount: function (num) { + if (num == null) { + return agg[name].terms.min_doc_count; + } + + agg[name].terms.min_doc_count = num; + return this; + }, + + /** + Sets order for the aggregated values. @member ejs.TermsAggregation @param {String} order The order string. @@ -5540,6 +5653,8 @@ @returns {Object} returns this so that calls can be chained. */ order: function (order, direction) { + var orderAsObj = {}; + if (order == null) { return agg[name].terms.order; } @@ -5553,8 +5668,9 @@ direction = 'desc'; } - agg[name].terms.order = {}; - agg[name].terms.order[order] = direction; + orderAsObj[order] = direction; + agg[name].terms.order = agg[name].terms.order || []; + agg[name].terms.order.push(orderAsObj); return this; } @@ -5584,8 +5700,10 @@ ejs.TopHitsAggregation = function (name) { var - _common = ejs.MetricsAggregationMixin(name, 'top_hits'), - agg = _common.toJSON(); + _common = ejs.AggregationMixin(name), + agg = _common.toJSON(); + + agg[name].top_hits = {}; return extend(_common, { /** @@ -5778,8 +5896,8 @@ includes: includes }; - if (excludes !== undefined) { - agg[name].top_hits._source = excludes; + if (excludes != null) { + agg[name].top_hits._source.excludes = excludes; } } @@ -5800,6 +5918,8 @@ @ejs aggregation @borrows ejs.MetricsAggregationMixin.field as field @borrows ejs.MetricsAggregationMixin.script as script + @borrows ejs.MetricsAggregationMixin.scriptId as scriptId + @borrows ejs.MetricsAggregationMixin.scriptFile as scriptFile @borrows ejs.MetricsAggregationMixin.lang as lang @borrows ejs.MetricsAggregationMixin.params as params @borrows ejs.AggregationMixin._type as _type @@ -5818,28 +5938,7 @@ _common = ejs.MetricsAggregationMixin(name, 'value_count'), agg = _common.toJSON(); - // not supported in value count aggregation - delete _common.scriptValuesSorted; - - return extend(_common, { - - /** - Set to true to assume script values are unique. - - @member ejs.ValueCountAggregation - @param {Boolean} trueFalse assume unique values or not - @returns {Object} returns this so that calls can be chained. - */ - scriptValuesUnique: function (trueFalse) { - if (trueFalse == null) { - return agg[name].value_count.script_values_unique; - } - - agg[name].value_count.script_values_unique = trueFalse; - return this; - } - - }); + return _common; }; @@ -7146,7 +7245,61 @@ */ scope: function (s) { return this; - } + }, + + /** + Sets the inner hits options + + @member ejs.HasChildFilter + @param {InnerHits} i A valid InnerHits object + @returns {Object} returns this so that calls can be chained. + */ + innerHits: function(i) { + if (i == null) { + return filter.has_child.inner_hits; + } + + if (!isInnerHits(i)) { + throw new TypeError('Argument must be a Highlight object'); + } + + filter.has_child.inner_hits = i.toJSON(); + + return this; + }, + + /** + Sets the min_children value. + + @member ejs.HasChildQuery + @param {Integer} min A positive integer value. + @returns {Object} returns this so that calls can be chained. + */ + minChildren: function(min) { + if (min == null) { + return filter.has_child.min_children; + } + + filter.has_child.min_children = min; + return this; + }, + + /** + Sets the max_children value. + + @member ejs.HasChildQuery + @param {Integer} max A positive integer value. + @returns {Object} returns this so that calls can be chained. + */ + maxChildren: function(max) { + if (max == null) { + return filter.has_child.max_children; + } + + filter.has_child.max_children = max; + + return this; + } }); }; @@ -7256,6 +7409,26 @@ */ scope: function (s) { return this; + }, + + /** + Sets the inner hits options + + @member ejs.HasParentFilter + @param {InnerHits} i A valid InnerHits object + @returns {Object} returns this so that calls can be chained. + */ + innerHits: function(i) { + if (i == null) { + return filter.has_parent.inner_hits; + } + + if (!isInnerHits(i)) { + throw new TypeError('Argument must be a Highlight object'); + } + + filter.has_parent.inner_hits = i.toJSON(); + return this; } }); @@ -7759,8 +7932,28 @@ */ scope: function (s) { return this; + }, + + /** + Sets the inner hits options + + @member ejs.NestedFilter + @param {InnerHits} i A valid InnerHits object + @returns {Object} returns this so that calls can be chained. + */ + innerHits: function(i) { + if (i == null) { + return filter.nested.inner_hits; + } + + if (!isInnerHits(i)) { + throw new TypeError('Argument must be a Highlight object'); + } + + filter.nested.inner_hits = i.toJSON(); + return this; } - + }); }; @@ -9459,23 +9652,19 @@ }, /** - Sets the minimum number of low freq matches that need to match in - a document before that document is returned in the results. + Sets a string value controlling how many "should" clauses in the + resulting Query should match. - @member ejs.CommonTermsQuery - @param {Integer} min A positive integer. + @member ejs.MatchQuery + @param {String} minMatch A min should match parameter. @returns {Object} returns this so that calls can be chained. */ - minimumShouldMatch: function (min) { - if (min == null) { - return query.common[field].minimum_should_match.low_freq; - } - - if (query.common[field].minimum_should_match == null) { - query.common[field].minimum_should_match = {}; + minimumShouldMatch: function (minMatch) { + if (minMatch == null) { + return query.common[field].minimum_should_match; } - - query.common[field].minimum_should_match.low_freq = min; + + query.common[field].minimum_should_match = minMatch; return this; }, @@ -9488,7 +9677,16 @@ @returns {Object} returns this so that calls can be chained. */ minimumShouldMatchLowFreq: function (min) { - return this.minimumShouldMatch(min); + if (min == null) { + return query.common[field].minimum_should_match.low_freq; + } + + if (!isObject(query.common[field].minimum_should_match)) { + query.common[field].minimum_should_match = {}; + } + + query.common[field].minimum_should_match.low_freq = min; + return this; }, /** @@ -9503,11 +9701,11 @@ if (min == null) { return query.common[field].minimum_should_match.high_freq; } - - if (query.common[field].minimum_should_match == null) { + + if (!isObject(query.common[field].minimum_should_match)) { query.common[field].minimum_should_match = {}; } - + query.common[field].minimum_should_match.high_freq = min; return this; }, @@ -9959,188 +10157,220 @@ }); }; - /** - @class -

The function_score allows you to modify the score of documents that are - retrieved by a query. This can be useful if, for example, a score function is - computationally expensive and it is sufficient to compute the score on a - filtered set of documents.

- - @name ejs.FunctionScoreQuery - @ejs query - @borrows ejs.QueryMixin.boost as boost - @borrows ejs.QueryMixin._type as _type - @borrows ejs.QueryMixin.toJSON as toJSON - - @desc -

A query that allows you to modify the score of matching documents.

- - */ - ejs.FunctionScoreQuery = function () { - - var - _common = ejs.QueryMixin('function_score'), - query = _common.toJSON(); - - return extend(_common, { - - /** - Set the source query. - - @member ejs.FunctionScoreQuery - @param {Query} oQuery A valid Query object - @returns {Object} returns this so that calls can be chained. - */ - query: function (oQuery) { - if (oQuery == null) { - return query.function_score.query; - } - - if (!isQuery(oQuery)) { - throw new TypeError('Argument must be a Query'); - } - - query.function_score.query = oQuery.toJSON(); - return this; - }, - - /** - Set the source filter. - - @member ejs.FunctionScoreQuery - @param {Filter} oFilter A valid Filter object - @returns {Object} returns this so that calls can be chained. - */ - filter: function (oFilter) { - if (oFilter == null) { - return query.function_score.filter; - } - - if (!isFilter(oFilter)) { - throw new TypeError('Argument must be a Filter'); - } - - query.function_score.filter = oFilter.toJSON(); - return this; - }, - - /** - Set the scoring mode which specifies how the computed scores are combined. - Valid values are: avg, max, min, sum, multiply, and first. - - @member ejs.FunctionScoreQuery - @param {String} mode A scoring mode. - @returns {Object} returns this so that calls can be chained. - */ - scoreMode: function (mode) { - if (mode == null) { - return query.function_score.score_mode; - } - - mode = mode.toLowerCase(); - if (mode === 'avg' || mode === 'max' || mode === 'min' || - mode === 'sum' || mode === 'multiply' || mode === 'first') { - query.function_score.score_mode = mode; - } - - return this; - }, - - /** - Set the setermines how the new calculated score is combined with the - score from the original query. Valid values are: multiply, replace, sum, - avg, max, and min. - - @member ejs.FunctionScoreQuery - @param {String} mode A boosting mode. - @returns {Object} returns this so that calls can be chained. - */ - boostMode: function (mode) { - if (mode == null) { - return query.function_score.boost_mode; - } - - mode = mode.toLowerCase(); - if (mode === 'multiply' || mode === 'replace' || mode === 'sum' || - mode === 'avg' || mode === 'max' || mode === 'min') { - query.function_score.boost_mode = mode; - } - - return this; - }, - - /** - Sets the boost value for all documents matching the query. - - @member ejs.FunctionScoreQuery - @param {Float} boost A positive float value. - @returns {Object} returns this so that calls can be chained. - */ - boost: function (boost) { - if (boost == null) { - return query.function_score.boost; - } - - query.function_score.boost = boost; - return this; - }, - - /** - Add a single score function to the list of existing functions. - - @member ejs.FunctionScoreQuery - @param {ScoreFunction} func A valid ScoreFunction object. - @returns {Object} returns this so that calls can be chained. - */ - function: function (func) { - if (query.function_score.functions == null) { - query.function_score.functions = []; - } - - if (func == null) { - return query.function_score.functions; - } - - if (!isScoreFunction(func)) { - throw new TypeError('Argument must be a ScoreFunction'); - } - - query.function_score.functions.push(func.toJSON()); - return this; - }, - - /** - Sets the score functions. Replaces any existing score functions. - - @member ejs.FunctionScoreQuery - @param {ScoreFunction[]} funcs A array of ScoreFunctions. - @returns {Object} returns this so that calls can be chained. - */ - functions: function (funcs) { - var i, len; - - if (funcs == null) { - return query.function_score.functions; - } - - if (!isArray(funcs)) { - throw new TypeError('Argument must be an array of ScoreFunctions'); - } - - query.function_score.functions = []; - for (i = 0, len = funcs.length; i < len; i++) { - if (!isScoreFunction(funcs[i])) { - throw new TypeError('Argument must be an array of ScoreFunctions'); - } - - query.function_score.functions.push(funcs[i].toJSON()); - } - - return this; - } - - }); - }; + /** + @class +

The function_score allows you to modify the score of documents that are + retrieved by a query. This can be useful if, for example, a score function is + computationally expensive and it is sufficient to compute the score on a + filtered set of documents.

+ + @name ejs.FunctionScoreQuery + @ejs query + @borrows ejs.QueryMixin.boost as boost + @borrows ejs.QueryMixin._type as _type + @borrows ejs.QueryMixin.toJSON as toJSON + + @desc +

A query that allows you to modify the score of matching documents.

+ + */ + ejs.FunctionScoreQuery = function () { + + var + _common = ejs.QueryMixin('function_score'), + query = _common.toJSON(); + + return extend(_common, { + + /** + Set the source query. + + @member ejs.FunctionScoreQuery + @param {Query} oQuery A valid Query object + @returns {Object} returns this so that calls can be chained. + */ + query: function (oQuery) { + if (oQuery == null) { + return query.function_score.query; + } + + if (!isQuery(oQuery)) { + throw new TypeError('Argument must be a Query'); + } + + query.function_score.query = oQuery.toJSON(); + return this; + }, + + /** + Set the source filter. + + @member ejs.FunctionScoreQuery + @param {Filter} oFilter A valid Filter object + @returns {Object} returns this so that calls can be chained. + */ + filter: function (oFilter) { + if (oFilter == null) { + return query.function_score.filter; + } + + if (!isFilter(oFilter)) { + throw new TypeError('Argument must be a Filter'); + } + + query.function_score.filter = oFilter.toJSON(); + return this; + }, + + /** + Set the scoring mode which specifies how the computed scores are combined. + Valid values are: avg, max, min, sum, multiply, and first. + + @member ejs.FunctionScoreQuery + @param {String} mode A scoring mode. + @returns {Object} returns this so that calls can be chained. + */ + scoreMode: function (mode) { + if (mode == null) { + return query.function_score.score_mode; + } + + mode = mode.toLowerCase(); + if (mode === 'avg' || mode === 'max' || mode === 'min' || + mode === 'sum' || mode === 'multiply' || mode === 'first') { + query.function_score.score_mode = mode; + } + + return this; + }, + + /** + Set the setermines how the new calculated score is combined with the + score from the original query. Valid values are: multiply, replace, sum, + avg, max, and min. + + @member ejs.FunctionScoreQuery + @param {String} mode A boosting mode. + @returns {Object} returns this so that calls can be chained. + */ + boostMode: function (mode) { + if (mode == null) { + return query.function_score.boost_mode; + } + + mode = mode.toLowerCase(); + if (mode === 'multiply' || mode === 'replace' || mode === 'sum' || + mode === 'avg' || mode === 'max' || mode === 'min') { + query.function_score.boost_mode = mode; + } + + return this; + }, + + /** + Sets the boost value for all documents matching the query. + + @member ejs.FunctionScoreQuery + @param {Float} boost A positive float value. + @returns {Object} returns this so that calls can be chained. + */ + boost: function (boost) { + if (boost == null) { + return query.function_score.boost; + } + + query.function_score.boost = boost; + return this; + }, + + /** + Sets the maximum boost value. + + @member ejs.FunctionScoreQuery + @param {Float} maxBoost A positive float value. + @returns {Object} returns this so that calls can be chained. + */ + maxBoost: function (maxBoost) { + if (maxBoost == null) { + return query.function_score.max_boost; + } + + query.function_score.max_boost = maxBoost; + return this; + }, + + /** + Sets the minimum score a document should have to be included. + + @member ejs.FunctionScoreQuery + @param {Float} minScore A positive float value. + @returns {Object} returns this so that calls can be chained. + */ + minScore: function (minScore) { + if (minScore == null) { + return query.function_score.min_score; + } + + query.function_score.min_score = minScore; + return this; + }, + + /** + Add a single score function to the list of existing functions. + + @member ejs.FunctionScoreQuery + @param {ScoreFunction} func A valid ScoreFunction object. + @returns {Object} returns this so that calls can be chained. + */ + function: function (func) { + if (query.function_score.functions == null) { + query.function_score.functions = []; + } + + if (func == null) { + return query.function_score.functions; + } + + if (!isScoreFunction(func)) { + throw new TypeError('Argument must be a ScoreFunction'); + } + + query.function_score.functions.push(func.toJSON()); + return this; + }, + + /** + Sets the score functions. Replaces any existing score functions. + + @member ejs.FunctionScoreQuery + @param {ScoreFunction[]} funcs A array of ScoreFunctions. + @returns {Object} returns this so that calls can be chained. + */ + functions: function (funcs) { + var i, len; + + if (funcs == null) { + return query.function_score.functions; + } + + if (!isArray(funcs)) { + throw new TypeError('Argument must be an array of ScoreFunctions'); + } + + query.function_score.functions = []; + for (i = 0, len = funcs.length; i < len; i++) { + if (!isScoreFunction(funcs[i])) { + throw new TypeError('Argument must be an array of ScoreFunctions'); + } + + query.function_score.functions.push(funcs[i].toJSON()); + } + + return this; + } + + }); + }; /** @class @@ -10909,10 +11139,10 @@ /** @class -

The has_child query works the same as the has_child filter, - by automatically wrapping the filter with a constant_score. Results in +

The has_child query works the same as the has_child filter, + by automatically wrapping the filter with a constant_score. Results in parent documents that have child docs matching the query being returned.

- + @name ejs.HasChildQuery @ejs query @borrows ejs.QueryMixin.boost as boost @@ -10930,11 +11160,11 @@ if (!isQuery(qry)) { throw new TypeError('Argument must be a valid Query'); } - - var + + var _common = ejs.QueryMixin('has_child'), query = _common.toJSON(); - + query.has_child.query = qry.toJSON(); query.has_child.type = type; @@ -10951,11 +11181,11 @@ if (q == null) { return query.has_child.query; } - + if (!isQuery(q)) { throw new TypeError('Argument must be a valid Query'); } - + query.has_child.query = q.toJSON(); return this; }, @@ -10971,14 +11201,14 @@ if (t == null) { return query.has_child.type; } - + query.has_child.type = t; return this; }, /** - Sets the scope of the query. A scope allows to run facets on the - same scope name that will work against the child documents. + Sets the scope of the query. A scope allows to run facets on the + same scope name that will work against the child documents. @deprecated since elasticsearch 0.90 @member ejs.HasChildQuery @@ -10991,14 +11221,14 @@ /** Sets the scoring method. Valid values are: - + none - the default, no scoring max - the highest score of all matched child documents is used sum - the sum the all the matched child documents is used avg - the average of all matched child documents is used @deprecated since elasticsearch 0.90.1, use scoreMode - + @member ejs.HasChildQuery @param {String} s The score type as a string. @returns {Object} returns this so that calls can be chained. @@ -11007,18 +11237,18 @@ if (s == null) { return query.has_child.score_type; } - + s = s.toLowerCase(); if (s === 'none' || s === 'max' || s === 'sum' || s === 'avg') { query.has_child.score_type = s; } - + return this; }, - + /** Sets the scoring method. Valid values are: - + none - the default, no scoring max - the highest score of all matched child documents is used sum - the sum the all the matched child documents is used @@ -11032,15 +11262,15 @@ if (s == null) { return query.has_child.score_mode; } - + s = s.toLowerCase(); if (s === 'none' || s === 'max' || s === 'sum' || s === 'avg') { query.has_child.score_mode = s; } - + return this; }, - + /** Sets the cutoff value to short circuit processing. @@ -11055,12 +11285,64 @@ query.has_child.short_circuit_cutoff = cutoff; return this; - } - - }); - }; + }, - /** + /** + Sets the inner hits options + + @member ejs.HasChildQuery + @param {InnerHits} i A valid InnerHits object + @returns {Object} returns this so that calls can be chained. + */ + innerHits: function(i) { + if (i == null) { + return query.has_child.inner_hits; + } + + if (!isInnerHits(i)) { + throw new TypeError('Argument must be a Highlight object'); + } + + query.has_child.inner_hits = i.toJSON(); + return this; + }, + + /** + Sets the min_children value. + + @member ejs.HasChildQuery + @param {Integer} min A positive integer value. + @returns {Object} returns this so that calls can be chained. + */ + minChildren: function(min) { + if (min == null) { + return query.has_child.min_children; + } + + query.has_child.min_children = min; + return this; + }, + + /** + Sets the max_children value. + + @member ejs.HasChildQuery + @param {Integer} max A positive integer value. + @returns {Object} returns this so that calls can be chained. + */ + maxChildren: function(max) { + if (max == null) { + return query.has_child.max_children; + } + + query.has_child.max_children = max; + return this; + } + + }); + }; + + /** @class

The has_parent query works the same as the has_parent filter, by automatically wrapping the filter with a constant_score. Results in @@ -11186,10 +11468,30 @@ if (s === 'none' || s === 'score') { query.has_parent.score_mode = s; } - + + return this; + }, + + /** + Sets the inner hits options + + @member ejs.HasParentQuery + @param {InnerHits} i A valid InnerHits object + @returns {Object} returns this so that calls can be chained. + */ + innerHits: function(i) { + if (i == null) { + return query.has_parent.inner_hits; + } + + if (!isInnerHits(i)) { + throw new TypeError('Argument must be a Highlight object'); + } + + query.has_parent.inner_hits = i.toJSON(); return this; } - + }); }; @@ -11612,7 +11914,7 @@ resulting Query should match. @member ejs.MatchQuery - @param {Integer} minMatch An integer between 0 and 100. + @param {String} minMatch A min should match parameter. @returns {Object} returns this so that calls can be chained. */ minimumShouldMatch: function (minMatch) { @@ -12087,23 +12389,14 @@ @param {String} likeText The text to find documents like it. */ - ejs.MoreLikeThisQuery = function (fields, likeText) { + ejs.MoreLikeThisQuery = function (likeText) { var _common = ejs.QueryMixin('mlt'), query = _common.toJSON(); query.mlt.like_text = likeText; - query.mlt.fields = []; - if (isString(fields)) { - query.mlt.fields.push(fields); - } else if (isArray(fields)) { - query.mlt.fields = fields; - } else { - throw new TypeError('Argument must be string or array'); - } - return extend(_common, { /** @@ -12117,20 +12410,29 @@ */ fields: function (f) { if (f == null) { - return query.mlt.fields; + return this; } if (isString(f)) { - query.mlt.fields.push(f); + query.mlt.fields = [f]; } else if (isArray(f)) { query.mlt.fields = f; } else { - throw new TypeError('Argument must be a string or array'); + throw new TypeError('Must pass a field or an array of fields'); } return this; }, - + + docs: function(doc) { + if (isArray(doc)) { + query.mlt.docs = doc; + } else { + throw new TypeError('Must pass an array of docs as argument'); + } + return this; + }, + /** The text to find documents like @@ -12469,7 +12771,7 @@ resulting Query should match. @member ejs.MultiMatchQuery - @param {Integer} minMatch An integer between 0 and 100. + @param {String} minMatch A min should match parameter. @returns {Object} returns this so that calls can be chained. */ minimumShouldMatch: function (minMatch) { @@ -12623,7 +12925,7 @@ } type = type.toLowerCase(); - if (type === 'boolean' || type === 'phrase' || type === 'phrase_prefix') { + if (type === 'best_fields' || type === 'most_fields' || type === 'cross_fields' || type === 'phrase' || type === 'phrase_prefix') { query.multi_match.type = type; } @@ -12879,8 +13181,28 @@ */ scope: function (s) { return this; + }, + + /** + Sets the inner hits options + + @member ejs.NestedFilter + @param {InnerHits} i A valid InnerHits object + @returns {Object} returns this so that calls can be chained. + */ + innerHits: function(i) { + if (i == null) { + return query.nested.inner_hits; + } + + if (!isInnerHits(i)) { + throw new TypeError('Argument must be a Highlight object'); + } + + query.nested.inner_hits = i.toJSON(); + return this; } - + }); }; @@ -13325,7 +13647,7 @@ resulting Query should match. @member ejs.QueryStringQuery - @param {Integer} minMatch An integer between 0 and 100. + @param {String} minMatch A min should match parameter. @returns {Object} returns this so that calls can be chained. */ minimumShouldMatch: function (minMatch) { @@ -14575,15 +14897,15 @@ before that document is returned in the results. @member ejs.TermsQuery - @param {Integer} min A positive integer. + @param {String} minMatch A min should match parameter. @returns {Object} returns this so that calls can be chained. */ - minimumShouldMatch: function (min) { - if (min == null) { + minimumShouldMatch: function (minMatch) { + if (minMatch == null) { return query.terms.minimum_should_match; } - query.terms.minimum_should_match = min; + query.terms.minimum_should_match = minMatch; return this; }, @@ -15131,6 +15453,70 @@ }); }; + /** + @class +

The field_value_factor function allows you to use a field from a document to + influence the score. It’s similar to using the script_score function, however, + it avoids the overhead of scripting. If used on a multi-valued field, only the + first value of the field is used in calculations.

+ + @name ejs.FieldValueFactorFunction + @ejs scorefunction + @borrows ejs.ScoreFunctionMixin.filter as filter + @borrows ejs.ScoreFunctionMixin._type as _type + @borrows ejs.ScoreFunctionMixin.toJSON as toJSON + + @param {String} field the field to apply the function to. + + @desc +

Multiply the score by the value of the field, multiplied by the factor.

+ + */ + ejs.FieldValueFactorFunction = function (field) { + + var + _common = ejs.ScoreFunctionMixin('field_value_factor'), + func = _common.toJSON(); + + func.field_value_factor.field = field; + + return extend(_common, { + + /** + Sets the factor. + + @member ejs.FieldValueFactorFunction + @param {Float} factor the factor. + @returns {Object} returns this so that calls can be chained. + */ + factor: function (factor) { + if (factor == null) { + return func.field_value_factor.factor; + } + + func.field_value_factor.factor = factor; + return this; + }, + + /** + Sets the modifier. + + @member ejs.FieldValueFactorFunction + @param {Float} modifier the modifier, one of none, log, log1p, log2p, ln, ln1p, ln2p, square, sqrt or reciprocal + @returns {Object} returns this so that calls can be chained. + */ + modifier: function (modifier) { + if (modifier == null) { + return func.field_value_factor.modifier; + } + + func.field_value_factor.modifier = modifier; + return this; + } + + }); + }; + /** @class

The random_score generates scores via a pseudo random number algorithm @@ -15173,6 +15559,30 @@ }); }; + /** + @class +

A basic filter score function, which mathces a filter and applies a + weight.

+ + @name ejs.ScoreFunction + @ejs scorefunction + @borrows ejs.ScoreFunctionMixin.filter as filter + @borrows ejs.ScoreFunctionMixin.weight as weight + @borrows ejs.ScoreFunctionMixin._type as _type + @borrows ejs.ScoreFunctionMixin.toJSON as toJSON + + @desc +

Randomly score documents.

+ + */ + ejs.ScoreFunction = function () { + + var + _common = ejs.ScoreFunctionMixin(); + + return _common; + }; + /** @class

The script_score function allows you to wrap another query and customize @@ -15210,6 +15620,32 @@ } func.script_score.script = scriptCode; + + if (func.script_score.script_id) { + delete func.script_score.script_id; + } + + return this; + }, + + /** + Set the script id that will modify the score. + + @member ejs.ScriptScoreFunction + @param {String} scriptId Id of an indexed script. + @returns {Object} returns this so that calls can be chained. + */ + scriptId: function (scriptId) { + if (scriptId == null) { + return func.script_score.scriptId; + } + + func.script_score.script_id = scriptId; + + if (func.script_score.script) { + delete func.script_score.script; + } + return this; }, @@ -15716,255 +16152,599 @@ return highlight.boundary_max_scan; } - addOption(oField, 'boundary_max_scan', cnt); + addOption(oField, 'boundary_max_scan', cnt); + return this; + }, + + /** + Set's the boundary characters. When highlighting a field that is + mapped with term vectors, boundary_chars can be configured to + define what constitutes a boundary for highlighting. It’s a single + string with each boundary character defined in it. You can apply + the option to a specific field by passing the field name in to + the oField parameter. It defaults to ".,!? \t\n". + + @member ejs.Highlight + @param {String} charStr The boundary chars in a string. + @param {String} oField An optional field name + @returns {Object} returns this so that calls can be chained. + */ + boundaryChars: function (charStr, oField) { + if (charStr === null && oField != null) { + return highlight.fields[oField].boundary_chars; + } else if (charStr == null) { + return highlight.boundary_chars; + } + + addOption(oField, 'boundary_chars', charStr); + return this; + }, + + /** + Sets the highligher type. You can apply the option + to a specific field by passing the field name in to the + oField parameter. Valid values for order are: + + plain - the slower Lucene standard highligher + postings - the postings highligher + fvh - the fast vector based highligher + + @member ejs.Highlight + @param {String} t The highligher. + @param {String} oField An optional field name + @returns {Object} returns this so that calls can be chained. + */ + type: function (t, oField) { + if (t === null && oField != null) { + return highlight.fields[oField].type; + } else if (t == null) { + return highlight.type; + } + + t = t.toLowerCase(); + if (t === 'fvh' || t === 'plain' || + t === 'postings') { + addOption(oField, 'type', t); + } + + return this; + }, + + /** + Sets the fragmenter type. You can apply the option + to a specific field by passing the field name in to the + oField parameter. Valid values for order are: + + simple - breaks text up into same-size fragments with no concerns + over spotting sentence boundaries. + span - breaks text up into same-size fragments but does not split + up Spans. + + @member ejs.Highlight + @param {String} f The fragmenter. + @param {String} oField An optional field name + @returns {Object} returns this so that calls can be chained. + */ + fragmenter: function (f, oField) { + if (f === null && oField != null) { + return highlight.fields[oField].fragmenter; + } else if (f == null) { + return highlight.fragmenter; + } + + f = f.toLowerCase(); + if (f === 'simple' || f === 'span') { + addOption(oField, 'fragmenter', f); + } + + return this; + }, + + /** + Sets arbitrary options that can be passed to the highlighter + implementation in use. + + @since elasticsearch 0.90.1 + + @member ejs.Highlight + @param {String} opts A map/object of option name and values. + @param {Object} oField An optional field name + @returns {Object} returns this so that calls can be chained. + */ + options: function (opts, oField) { + if (opts === null && oField != null) { + return highlight.fields[oField].options; + } else if (opts == null) { + return highlight.options; + } + + if (!isObject(opts) || isArray(opts) || isEJSObject(opts)) { + throw new TypeError('Parameter must be an object'); + } + + addOption(oField, 'options', opts); + return this; + }, + + /** + The type of ejs object. For internal use only. + + @member ejs.Highlight + @returns {String} the type of object + */ + _type: function () { + return 'highlight'; + }, + + /** + Retrieves the internal script object. This is typically used by + internal API functions so use with caution. + + @member ejs.Highlight + @returns {String} returns this object's internal object representation. + */ + toJSON: function () { + return highlight; + } + }; + }; + + /** + @class +

A shape which has already been indexed in another index and/or index + type. This is particularly useful for when you have a pre-defined list of + shapes which are useful to your application and you want to reference this + using a logical name (for example ‘New Zealand’) rather than having to + provide their coordinates each time.

+ + @name ejs.IndexedShape + @ejs geo + + @desc +

Defines a shape that already exists in an index/type.

+ + @param {String} type The name of the type where the shape is indexed. + @param {String} id The document id of the shape. + + */ + ejs.IndexedShape = function (type, id) { + + var indexedShape = { + type: type, + id: id + }; + + return { + + /** + Sets the type which the shape is indexed under. + + @member ejs.IndexedShape + @param {String} t a valid shape type. + @returns {Object} returns this so that calls can be chained. + */ + type: function (t) { + if (t == null) { + return indexedShape.type; + } + + indexedShape.type = t; + return this; + }, + + /** + Sets the document id of the indexed shape. + + @member ejs.IndexedShape + @param {String} id a valid document id. + @returns {Object} returns this so that calls can be chained. + */ + id: function (id) { + if (id == null) { + return indexedShape.id; + } + + indexedShape.id = id; + return this; + }, + + /** + Sets the index which the shape is indexed under. + Defaults to "shapes". + + @member ejs.IndexedShape + @param {String} idx a valid index name. + @returns {Object} returns this so that calls can be chained. + */ + index: function (idx) { + if (idx == null) { + return indexedShape.index; + } + + indexedShape.index = idx; + return this; + }, + + /** + Sets the field name containing the indexed shape. + Defaults to "shape". + + @member ejs.IndexedShape + @param {String} field a valid field name. + @returns {Object} returns this so that calls can be chained. + */ + shapeFieldName: function (field) { + if (field == null) { + return indexedShape.shape_field_name; + } + + indexedShape.shape_field_name = field; + return this; + }, + + /** + The type of ejs object. For internal use only. + + @member ejs.IndexedShape + @returns {String} the type of object + */ + _type: function () { + return 'indexed shape'; + }, + + /** + Retrieves the internal script object. This is typically used by + internal API functions so use with caution. + + @member ejs.IndexedShape + @returns {String} returns this object's internal object representation. + */ + toJSON: function () { + return indexedShape; + } + }; + }; + + /** + @class +

Inner hits can be used by defining a inner_hits definition on a nested, + has_child or has_parent query and filter. This feature returns per search hit + in the search response additional nested hits that caused a search hit to + match in a different scope.

+ +

See https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-inner-hits.html

+ + @name ejs.InnerHits + @ejs request + + @desc +

Include additional nested hits in the response.

+ + */ + ejs.InnerHits = function () { + + var innerHits = {}; + + return { + + /** +

The name to be used for the particular inner hit definition in the response. + Useful when multiple inner hits have been defined in a single search request. + The default depends in which query the inner hit is defined. For has_child query + and filter this is the child type, has_parent query and filter this is the parent + type and the nested query and filter this is the nested path..

+ + @member ejs.InnerHits + @param {String} name The name to be used for the inner hit definition. + @returns {Object} returns this so that calls can be chained. + */ + name: function (name) { + if (name === null) { + return innerHits.name; + } + + innerHits.name = name; + return this; + }, + + + /** +

The offset from where the first hit to fetch in the returned regular search hits.

+ + @member ejs.InnerHits + @param {Integer} from The offset from the first result you want to fetch. + @returns {Object} returns this so that calls can be chained. + */ + from: function (from) { + if (from === null) { + return innerHits.from; + } + + innerHits.from = from; + return this; + }, + + /** +

The maximum number of hits to return. By default the top three matching hits are returned.

+ + @member ejs.InnerHits + @param {Integer} size The numer of hits to be returned. + @returns {Object} returns this so that calls can be chained. + */ + size: function (size) { + if (size === null) { + return innerHits.size; + } + + innerHits.size = size; + return this; + }, + + /** +

How the inner hits should be sorted. By default the hits are sorted by the score.

+ + @member ejs.InnerHits + @param {String} sort The field to be sorted on. + @returns {Object} returns this so that calls can be chained. + */ + sort: function (sort) { + if (sort === null) { + return innerHits.sort; + } + + innerHits.sort = sort; + return this; + }, + + + /** +

Enable/Disable returning version number for each hit.

+ + @member ejs.InnerHits + @param {Boolean} trueFalse true to enable, false to disable + @returns {Object} returns this so that calls can be chained. + */ + version: function (trueFalse) { + if (trueFalse === null) { + return innerHits.version; + } + + innerHits.version = trueFalse; + return this; + }, + + /** +

Enable/Disable explanation of score for each hit.

+ + @member ejs.InnerHits + @param {Boolean} trueFalse true to enable, false to disable + @returns {Object} returns this so that calls can be chained. + */ + explain: function (trueFalse) { + if (trueFalse === null) { + return innerHits.explain; + } + + innerHits.explain = trueFalse; return this; }, /** - Set's the boundary characters. When highlighting a field that is - mapped with term vectors, boundary_chars can be configured to - define what constitutes a boundary for highlighting. It’s a single - string with each boundary character defined in it. You can apply - the option to a specific field by passing the field name in to - the oField parameter. It defaults to ".,!? \t\n". +

Performs highlighting based on the Highlight settings.

- @member ejs.Highlight - @param {String} charStr The boundary chars in a string. - @param {String} oField An optional field name - @returns {Object} returns this so that calls can be chained. - */ - boundaryChars: function (charStr, oField) { - if (charStr === null && oField != null) { - return highlight.fields[oField].boundary_chars; - } else if (charStr == null) { - return highlight.boundary_chars; + @member ejs.InnerHits + @param {Highlight} h A valid Highlight object + @returns {Object} returns this so that calls can be chained. + */ + highlight: function (h) { + if (h === null) { + return innerHits.highlight; } - addOption(oField, 'boundary_chars', charStr); + if (!isHighlight(h)) { + throw new TypeError('Argument must be a Highlight object'); + } + + innerHits.highlight = h.toJSON(); return this; }, /** - Sets the highligher type. You can apply the option - to a specific field by passing the field name in to the - oField parameter. Valid values for order are: +

Computes a document property dynamically based on the supplied ScriptField.

- plain - the slower Lucene standard highligher - postings - the postings highligher - fvh - the fast vector based highligher + @member ejs.InnerHits + @param {ScriptField} oScriptField A valid ScriptField. + @returns {Object} returns this so that calls can be chained. + */ + scriptField: function (oScriptField) { + if (oScriptField === null) { + return innerHits.script_fields; + } - @member ejs.Highlight - @param {String} t The highligher. - @param {String} oField An optional field name - @returns {Object} returns this so that calls can be chained. - */ - type: function (t, oField) { - if (t === null && oField != null) { - return highlight.fields[oField].type; - } else if (t == null) { - return highlight.type; + if (innerHits.script_fields === undefined) { + innerHits.script_fields = {}; } - t = t.toLowerCase(); - if (t === 'fvh' || t === 'plain' || - t === 'postings') { - addOption(oField, 'type', t); + if (!isScriptField(oScriptField)) { + throw new TypeError('Argument must be a ScriptField'); } + extend(innerHits.script_fields, oScriptField.toJSON()); return this; }, - /** - Sets the fragmenter type. You can apply the option - to a specific field by passing the field name in to the - oField parameter. Valid values for order are: - - simple - breaks text up into same-size fragments with no concerns - over spotting sentence boundaries. - span - breaks text up into same-size fragments but does not split - up Spans. - - @member ejs.Highlight - @param {String} f The fragmenter. - @param {String} oField An optional field name - @returns {Object} returns this so that calls can be chained. - */ - fragmenter: function (f, oField) { - if (f === null && oField != null) { - return highlight.fields[oField].fragmenter; - } else if (f == null) { - return highlight.fragmenter; - } + /** +

Allows to return the field data representation of a field for each hit.

- f = f.toLowerCase(); - if (f === 'simple' || f === 'span') { - addOption(oField, 'fragmenter', f); + @member ejs.InnerHits + @param {Array} Fields to return field data representation for. + @returns {Object} returns this so that calls can be chained. + */ + fieldDataFields: function (fielddata_fields) { + if (fielddata_fields === null) { + return innerHits.fielddata_fields; } + innerHits.fielddata_fields = fielddata_fields; return this; }, /** - Sets arbitrary options that can be passed to the highlighter - implementation in use. +

Allows to control how the _source field is returned with every hit. + By default operations return the contents of the _source field + unless you have used the fields parameter or if the _source field + is disabled. Set the includes parameter to false to completely + disable returning the source field.

- @since elasticsearch 0.90.1 + @member ejs.InnerHits + @param {(String|Boolean|String[])} includes The field or list of fields to include as array. + Set to a boolean false to disable the source completely. + @param {(String|String[])} excludes The optional field or list of fields to exclude. + @returns {Object} returns this so that calls can be chained. + */ + source: function (includes, excludes) { + if (includes === undefined && excludes === undefined) { + return innerHits._source; + } - @member ejs.Highlight - @param {String} opts A map/object of option name and values. - @param {Object} oField An optional field name - @returns {Object} returns this so that calls can be chained. - */ - options: function (opts, oField) { - if (opts === null && oField != null) { - return highlight.fields[oField].options; - } else if (opts == null) { - return highlight.options; + if (!isArray(includes) && !isString(includes) && !isBoolean(includes)) { + throw new TypeError('Argument includes must be a string, an array, or a boolean'); } - if (!isObject(opts) || isArray(opts) || isEJSObject(opts)) { - throw new TypeError('Parameter must be an object'); + if (excludes !== undefined && !isArray(excludes) && !isString(excludes)) { + throw new TypeError('Argument excludes must be a string or an array'); + } + + if (isBoolean(includes)) { + innerHits._source = includes; + } else { + innerHits._source = { + includes: includes + }; + + if (excludes != null) { + innerHits._source.excludes = excludes; + } } - addOption(oField, 'options', opts); return this; }, + /** The type of ejs object. For internal use only. - @member ejs.Highlight + @member ejs.InnerHits @returns {String} the type of object */ _type: function () { - return 'highlight'; + return 'inner hits'; }, /** Retrieves the internal script object. This is typically used by internal API functions so use with caution. - @member ejs.Highlight + @member ejs.InnerHits @returns {String} returns this object's internal object representation. */ toJSON: function () { - return highlight; + return innerHits; } }; }; /** @class -

A shape which has already been indexed in another index and/or index - type. This is particularly useful for when you have a pre-defined list of - shapes which are useful to your application and you want to reference this - using a logical name (for example ‘New Zealand’) rather than having to - provide their coordinates each time.

+

When loading data from _source, partial fields can be used + to use wildcards to control what part of the _source will be loaded + based on include and exclude patterns.

- @name ejs.IndexedShape - @ejs geo + @name ejs.PartialField + @ejs request @desc -

Defines a shape that already exists in an index/type.

+

Control what part of the _source will be loaded.

- @param {String} type The name of the type where the shape is indexed. - @param {String} id The document id of the shape. + @param {String} fieldName A name of the partial field to create. */ - ejs.IndexedShape = function (type, id) { + ejs.PartialField = function (fieldName) { + var partial = {}; - var indexedShape = { - type: type, - id: id - }; + partial[fieldName] = {}; return { /** - Sets the type which the shape is indexed under. + Allows to control how the _source field is returned with every hit. + By default operations return the contents of the _source field + unless you have used the fields parameter or if the _source field + is disabled. Set the includes parameter to false to completely + disable returning the source field. - @member ejs.IndexedShape - @param {String} t a valid shape type. + @member ejs.PartialField + @param {(String|String[])} include The field or list of fields to include as array. @returns {Object} returns this so that calls can be chained. */ - type: function (t) { - if (t == null) { - return indexedShape.type; + include: function (include) { + if (include == null) { + return partial[fieldName].include; } - - indexedShape.type = t; - return this; - }, - - /** - Sets the document id of the indexed shape. - @member ejs.IndexedShape - @param {String} id a valid document id. - @returns {Object} returns this so that calls can be chained. - */ - id: function (id) { - if (id == null) { - return indexedShape.id; + if (!isArray(include) && !isString(include)) { + throw new TypeError('Argument include must be a string or an array'); } - - indexedShape.id = id; - return this; - }, - /** - Sets the index which the shape is indexed under. - Defaults to "shapes". + partial[fieldName].include = include; - @member ejs.IndexedShape - @param {String} idx a valid index name. - @returns {Object} returns this so that calls can be chained. - */ - index: function (idx) { - if (idx == null) { - return indexedShape.index; - } - - indexedShape.index = idx; return this; }, /** - Sets the field name containing the indexed shape. - Defaults to "shape". + Allows to control how the _source field is returned with every hit. + By default operations return the contents of the _source field + unless you have used the fields parameter or if the _source field + is disabled. Set the includes parameter to false to completely + disable returning the source field. - @member ejs.IndexedShape - @param {String} field a valid field name. + @member ejs.PartialField + @param {(String|String[])} exclude The optional field or list of fields to exclude. @returns {Object} returns this so that calls can be chained. */ - shapeFieldName: function (field) { - if (field == null) { - return indexedShape.shape_field_name; + exclude: function (exclude) { + if (exclude == null) { + return partial[fieldName].exclude; } - - indexedShape.shape_field_name = field; + + if (!isArray(exclude) && !isString(exclude)) { + throw new TypeError('Argument exclude must be a string or an array'); + } + + partial[fieldName].exclude = exclude; + return this; }, - + /** The type of ejs object. For internal use only. - @member ejs.IndexedShape + @member ejs.PartialField @returns {String} the type of object */ _type: function () { - return 'indexed shape'; + return 'partial field'; }, /** Retrieves the internal script object. This is typically used by internal API functions so use with caution. - @member ejs.IndexedShape - @returns {String} returns this object's internal object representation. + @member ejs.PartialField + @returns {String} returns this object's internal facet property. */ toJSON: function () { - return indexedShape; + return partial; } }; }; @@ -16221,6 +17001,30 @@ return this; }, + /** + Control what part of the _source will be loaded based on PartialField. + + @member ejs.Request + @param {PartialField} oPartialField A valid PartialField. + @returns {Object} returns this so that calls can be chained. + */ + partialField: function (oPartialField) { + if (oPartialField == null) { + return query.partial_fields; + } + + if (query.partial_fields == null) { + query.partial_fields = {}; + } + + if (!isPartialField(oPartialField)) { + throw new TypeError('Argument must be a PartialField'); + } + + extend(query.partial_fields, oPartialField.toJSON()); + return this; + }, + /** Once a query executes, you can use rescore to run a secondary, more expensive query to re-order the results. @@ -16350,6 +17154,26 @@ return this; }, + /** + Allows you to set a specified post_filter on this request object. + + @member ejs.Request + @param {Object} filter Any valid Filter object. + @returns {Object} returns this so that calls can be chained. + */ + post_filter: function (filter) { + if (filter == null) { + return query.filter; + } + + if (!isFilter(filter)) { + throw new TypeError('Argument must be a Filter'); + } + + query.post_filter = filter.toJSON(); + return this; + }, + /** Performs highlighting based on the Highlight settings. diff --git a/dist/elastic.min.js b/dist/elastic.min.js index e12d3d5..a1322c6 100644 --- a/dist/elastic.min.js +++ b/dist/elastic.min.js @@ -1,8 +1,8 @@ -/*! elastic.js - v1.2.0 - 2014-10-13 +/*! elastic.js - v1.3.9 - 2016-04-13 * https://github.com/fullscale/elastic.js - * Copyright (c) 2014 FullScale Labs, LLC; Licensed MIT */ + * Copyright (c) 2016 FullScale Labs, LLC; Licensed MIT */ -(function(){"use strict";var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A=this,B=A&&A.ejs,C=Array.prototype,D=Object.prototype,E=C.slice,F=D.toString,G=D.hasOwnProperty,H=C.forEach,I=Array.isArray,J=C.indexOf,K={};z="undefined"!=typeof exports?exports:A.ejs={},a=function(a,b){return G.call(a,b)},b=function(b,c,d){if(null!=b)if(H&&b.forEach===H)b.forEach(c,d);else if(b.length===+b.length){for(var e=0,f=b.length;f>e;e++)if(c.call(d,b[e],e,b)===K)return}else for(var g in b)if(a(b,g)&&c.call(d,b[g],g,b)===K)return},c=function(a){return b(E.call(arguments,1),function(b){for(var c in b)a[c]=b[c]}),a},d=function(a,b){if(null==a)return-1;var c=0,d=a.length;if(J&&a.indexOf===J)return a.indexOf(b);for(;d>c;c++)if(a[c]===b)return c;return-1},e=I||function(a){return"[object Array]"===F.call(a)},f=function(a){return a===Object(a)},g=function(a){return"[object String]"===F.call(a)},h=function(a){return"[object Number]"===F.call(a)},i=function(a){return a===!0||a===!1||"[object Boolean]"===F.call(a)},j="function"!=typeof/./?function(a){return"function"==typeof a}:function(a){return"[object Function]"===F.call(a)},k=function(b){return f(b)&&a(b,"_type")&&a(b,"toJSON")},l=function(a){return k(a)&&"query"===a._type()},m=function(a){return k(a)&&"rescore"===a._type()},n=function(a){return k(a)&&"filter"===a._type()},o=function(a){return k(a)&&"facet"===a._type()},p=function(a){return k(a)&&"aggregation"===a._type()},q=function(a){return k(a)&&"script field"===a._type()},r=function(a){return k(a)&&"geo point"===a._type()},s=function(a){return k(a)&&"indexed shape"===a._type()},t=function(a){return k(a)&&"shape"===a._type()},u=function(a){return k(a)&&"sort"===a._type()},v=function(a){return k(a)&&"highlight"===a._type()},w=function(a){return k(a)&&"suggest"===a._type()},x=function(a){return k(a)&&"generator"===a._type()},y=function(a){return k(a)&&"score function"===a._type()},z.AggregationMixin=function(a){var b={};return b[a]={},{aggregation:function(d){if(null==d)return b[a].aggs;if(null==b[a].aggs&&(b[a].aggs={}),!p(d))throw new TypeError("Argument must be an Aggregation");return c(b[a].aggs,d.toJSON()),this},agg:function(a){return this.aggregation(a)},_type:function(){return"aggregation"},toJSON:function(){return b}}},z.DirectSettingsMixin=function(a){return{accuracy:function(b){return null==b?a.accuracy:(a.accuracy=b,this)},suggestMode:function(b){return null==b?a.suggest_mode:(b=b.toLowerCase(),("missing"===b||"popular"===b||"always"===b)&&(a.suggest_mode=b),this)},sort:function(b){return null==b?a.sort:(b=b.toLowerCase(),("score"===b||"frequency"===b)&&(a.sort=b),this)},stringDistance:function(b){return null==b?a.string_distance:(b=b.toLowerCase(),("internal"===b||"damerau_levenshtein"===b||"levenstein"===b||"jarowinkler"===b||"ngram"===b)&&(a.string_distance=b),this)},maxEdits:function(b){return null==b?a.max_edits:(a.max_edits=b,this)},maxInspections:function(b){return null==b?a.max_inspections:(a.max_inspections=b,this)},maxTermFreq:function(b){return null==b?a.max_term_freq:(a.max_term_freq=b,this)},prefixLen:function(b){return null==b?a.prefix_len:(a.prefix_len=b,this)},minWordLen:function(b){return null==b?a.min_word_len:(a.min_word_len=b,this)},minDocFreq:function(b){return null==b?a.min_doc_freq:(a.min_doc_freq=b,this)}}},z.FacetMixin=function(a){var b={};return b[a]={},{facetFilter:function(c){if(null==c)return b[a].facet_filter;if(!n(c))throw new TypeError("Argument must be a Filter");return b[a].facet_filter=c.toJSON(),this},global:function(c){return null==c?b[a].global:(b[a].global=c,this)},mode:function(c){return null==c?b[a].mode:(c=c.toLowerCase(),("collector"===c||"post"===c)&&(b[a].mode=c),this)},cacheFilter:function(c){return null==c?b[a].cache_filter:(b[a].cache_filter=c,this)},scope:function(){return this},nested:function(c){return null==c?b[a].nested:(b[a].nested=c,this)},_type:function(){return"facet"},toJSON:function(){return b}}},z.FilterMixin=function(a){var b={};return b[a]={},{name:function(c){return null==c?b[a]._name:(b[a]._name=c,this)},cache:function(c){return null==c?b[a]._cache:(b[a]._cache=c,this)},cacheKey:function(c){return null==c?b[a]._cache_key:(b[a]._cache_key=c,this)},_type:function(){return"filter"},toJSON:function(){return b}}},z.MetricsAggregationMixin=function(a,b){var d=z.AggregationMixin(a),e=d.toJSON();return delete d.aggregation,delete d.agg,e[a][b]={},c(d,{field:function(c){return null==c?e[a][b].field:(e[a][b].field=c,this)},script:function(c){return null==c?e[a][b].script:(e[a][b].script=c,this)},lang:function(c){return null==c?e[a][b].lang:(e[a][b].lang=c,this)},scriptValuesSorted:function(c){return null==c?e[a][b].script_values_sorted:(e[a][b].script_values_sorted=c,this)},params:function(c){return null==c?e[a][b].params:(e[a][b].params=c,this)}})},z.QueryMixin=function(a){var b={};return b[a]={},{boost:function(c){return null==c?b[a].boost:(b[a].boost=c,this)},_type:function(){return"query"},toJSON:function(){return b}}},z.ScoreFunctionMixin=function(a){var b={};return b[a]={},{filter:function(a){if(null==a)return b.filter;if(!n(a))throw new TypeError("Argument must be a Filter");return b.filter=a.toJSON(),this},_type:function(){return"score function"},toJSON:function(){return b}}},z.SuggestContextMixin=function(a){return{analyzer:function(b){return null==b?a.analyzer:(a.analyzer=b,this)},field:function(b){return null==b?a.field:(a.field=b,this)},size:function(b){return null==b?a.size:(a.size=b,this)},shardSize:function(b){return null==b?a.shard_size:(a.shard_size=b,this)}}},z.SuggesterMixin=function(a){var b={};return b[a]={},{text:function(c){return null==c?b[a].text:(b[a].text=c,this)},_type:function(){return"suggest"},toJSON:function(){return b}}},z.DateHistogramFacet=function(a){var b=z.FacetMixin(a),d=b.toJSON();return d[a].date_histogram={},c(b,{field:function(b){return null==b?d[a].date_histogram.field:(d[a].date_histogram.field=b,this)},keyField:function(b){return null==b?d[a].date_histogram.key_field:(d[a].date_histogram.key_field=b,this)},valueField:function(b){return null==b?d[a].date_histogram.value_field:(d[a].date_histogram.value_field=b,this)},interval:function(b){return null==b?d[a].date_histogram.interval:(d[a].date_histogram.interval=b,this)},timeZone:function(b){return null==b?d[a].date_histogram.time_zone:(d[a].date_histogram.time_zone=b,this)},preZone:function(b){return null==b?d[a].date_histogram.pre_zone:(d[a].date_histogram.pre_zone=b,this)},preZoneAdjustLargeInterval:function(b){return null==b?d[a].date_histogram.pre_zone_adjust_large_interval:(d[a].date_histogram.pre_zone_adjust_large_interval=b,this)},postZone:function(b){return null==b?d[a].date_histogram.post_zone:(d[a].date_histogram.post_zone=b,this)},preOffset:function(b){return null==b?d[a].date_histogram.pre_offset:(d[a].date_histogram.pre_offset=b,this)},postOffset:function(b){return null==b?d[a].date_histogram.post_offset:(d[a].date_histogram.post_offset=b,this)},factor:function(b){return null==b?d[a].date_histogram.factor:(d[a].date_histogram.factor=b,this)},valueScript:function(b){return null==b?d[a].date_histogram.value_script:(d[a].date_histogram.value_script=b,this)},order:function(b){return null==b?d[a].date_histogram.order:(b=b.toLowerCase(),("time"===b||"count"===b||"total"===b)&&(d[a].date_histogram.order=b),this)},lang:function(b){return null==b?d[a].date_histogram.lang:(d[a].date_histogram.lang=b,this)},params:function(b){return null==b?d[a].date_histogram.params:(d[a].date_histogram.params=b,this)}})},z.FilterFacet=function(a){var b=z.FacetMixin(a),d=b.toJSON();return c(b,{filter:function(b){if(null==b)return d[a].filter;if(!n(b))throw new TypeError("Argument must be a Filter");return d[a].filter=b.toJSON(),this}})},z.GeoDistanceFacet=function(a){var b=z.FacetMixin(a),d=b.toJSON(),e=z.GeoPoint([0,0]),f="location";return d[a].geo_distance={location:e.toJSON(),ranges:[]},c(b,{field:function(b){var c=d[a].geo_distance[f];return null==b?f:(delete d[a].geo_distance[f],f=b,d[a].geo_distance[b]=c,this)},point:function(b){if(null==b)return e;if(!r(b))throw new TypeError("Argument must be a GeoPoint");return e=b,d[a].geo_distance[f]=b.toJSON(),this},addRange:function(b,c){return 0===arguments.length?d[a].geo_distance.ranges:(d[a].geo_distance.ranges.push({from:b,to:c}),this)},addUnboundedFrom:function(b){return null==b?d[a].geo_distance.ranges:(d[a].geo_distance.ranges.push({from:b}),this)},addUnboundedTo:function(b){return null==b?d[a].geo_distance.ranges:(d[a].geo_distance.ranges.push({to:b}),this)},unit:function(b){return null==b?d[a].geo_distance.unit:(b=b.toLowerCase(),("mi"===b||"km"===b)&&(d[a].geo_distance.unit=b),this)},distanceType:function(b){return null==b?d[a].geo_distance.distance_type:(b=b.toLowerCase(),("arc"===b||"plane"===b)&&(d[a].geo_distance.distance_type=b),this)},normalize:function(b){return null==b?d[a].geo_distance.normalize:(d[a].geo_distance.normalize=b,this)},valueField:function(b){return null==b?d[a].geo_distance.value_field:(d[a].geo_distance.value_field=b,this)},valueScript:function(b){return null==b?d[a].geo_distance.value_script:(d[a].geo_distance.value_script=b,this)},lang:function(b){return null==b?d[a].geo_distance.lang:(d[a].geo_distance.lang=b,this)},params:function(b){return null==b?d[a].geo_distance.params:(d[a].geo_distance.params=b,this)}})},z.HistogramFacet=function(a){var b=z.FacetMixin(a),d=b.toJSON();return d[a].histogram={},c(b,{field:function(b){return null==b?d[a].histogram.field:(d[a].histogram.field=b,this)},interval:function(b){return null==b?d[a].histogram.interval:(d[a].histogram.interval=b,this)},timeInterval:function(b){return null==b?d[a].histogram.time_interval:(d[a].histogram.time_interval=b,this)},from:function(b){return null==b?d[a].histogram.from:(d[a].histogram.from=b,this)},to:function(b){return null==b?d[a].histogram.to:(d[a].histogram.to=b,this)},valueField:function(b){return null==b?d[a].histogram.value_field:(d[a].histogram.value_field=b,this)},keyField:function(b){return null==b?d[a].histogram.key_field:(d[a].histogram.key_field=b,this)},valueScript:function(b){return null==b?d[a].histogram.value_script:(d[a].histogram.value_script=b,this)},keyScript:function(b){return null==b?d[a].histogram.key_script:(d[a].histogram.key_script=b,this)},lang:function(b){return null==b?d[a].histogram.lang:(d[a].histogram.lang=b,this)},params:function(b){return null==b?d[a].histogram.params:(d[a].histogram.params=b,this)},order:function(b){return null==b?d[a].histogram.order:(b=b.toLowerCase(),("key"===b||"count"===b||"total"===b)&&(d[a].histogram.order=b),this)}})},z.QueryFacet=function(a){var b=z.FacetMixin(a),d=b.toJSON();return c(b,{query:function(b){if(null==b)return d[a].query;if(!l(b))throw new TypeError("Argument must be a Query");return d[a].query=b.toJSON(),this}})},z.RangeFacet=function(a){var b=z.FacetMixin(a),d=b.toJSON();return d[a].range={ranges:[]},c(b,{field:function(b){return null==b?d[a].range.field:(d[a].range.field=b,this)},keyField:function(b){return null==b?d[a].range.key_field:(d[a].range.key_field=b,this)},valueField:function(b){return null==b?d[a].range.value_field:(d[a].range.value_field=b,this)},valueScript:function(b){return null==b?d[a].range.value_script:(d[a].range.value_script=b,this)},keyScript:function(b){return null==b?d[a].range.key_script:(d[a].range.key_script=b,this)},lang:function(b){return null==b?d[a].range.lang:(d[a].range.lang=b,this)},params:function(b){return null==b?d[a].range.params:(d[a].range.params=b,this)},addRange:function(b,c){return 0===arguments.length?d[a].range.ranges:(d[a].range.ranges.push({from:b,to:c}),this)},addUnboundedFrom:function(b){return null==b?d[a].range.ranges:(d[a].range.ranges.push({from:b}),this)},addUnboundedTo:function(b){return null==b?d[a].range.ranges:(d[a].range.ranges.push({to:b}),this)}})},z.StatisticalFacet=function(a){var b=z.FacetMixin(a),d=b.toJSON();return d[a].statistical={},c(b,{field:function(b){return null==b?d[a].statistical.field:(d[a].statistical.field=b,this)},fields:function(b){if(null==b)return d[a].statistical.fields;if(!e(b))throw new TypeError("Argument must be an array");return d[a].statistical.fields=b,this},script:function(b){return null==b?d[a].statistical.script:(d[a].statistical.script=b,this)},lang:function(b){return null==b?d[a].statistical.lang:(d[a].statistical.lang=b,this)},params:function(b){return null==b?d[a].statistical.params:(d[a].statistical.params=b,this)}})},z.TermStatsFacet=function(a){var b=z.FacetMixin(a),d=b.toJSON();return d[a].terms_stats={},c(b,{valueField:function(b){return null==b?d[a].terms_stats.value_field:(d[a].terms_stats.value_field=b,this)},keyField:function(b){return null==b?d[a].terms_stats.key_field:(d[a].terms_stats.key_field=b,this)},scriptField:function(b){return null==b?d[a].terms_stats.script_field:(d[a].terms_stats.script_field=b,this)},valueScript:function(b){return null==b?d[a].terms_stats.value_script:(d[a].terms_stats.value_script=b,this)},allTerms:function(b){return null==b?d[a].terms_stats.all_terms:(d[a].terms_stats.all_terms=b,this)},lang:function(b){return null==b?d[a].terms_stats.lang:(d[a].terms_stats.lang=b,this)},params:function(b){return null==b?d[a].terms_stats.params:(d[a].terms_stats.params=b,this)},size:function(b){return null==b?d[a].terms_stats.size:(d[a].terms_stats.size=b,this)},order:function(b){return null==b?d[a].terms_stats.order:(b=b.toLowerCase(),("count"===b||"term"===b||"reverse_count"===b||"reverse_term"===b||"total"===b||"reverse_total"===b||"min"===b||"reverse_min"===b||"max"===b||"reverse_max"===b||"mean"===b||"reverse_mean"===b)&&(d[a].terms_stats.order=b),this)}})},z.TermsFacet=function(a){var b=z.FacetMixin(a),d=b.toJSON();return d[a].terms={},c(b,{field:function(b){return null==b?d[a].terms.field:(d[a].terms.field=b,this)},fields:function(b){if(null==b)return d[a].terms.fields;if(!e(b))throw new TypeError("Argument must be an array");return d[a].terms.fields=b,this},scriptField:function(b){return null==b?d[a].terms.script_field:(d[a].terms.script_field=b,this)},size:function(b){return null==b?d[a].terms.size:(d[a].terms.size=b,this)},shardSize:function(b){return null==b?d[a].terms.shard_size:(d[a].terms.shard_size=b,this)},order:function(b){return null==b?d[a].terms.order:(b=b.toLowerCase(),("count"===b||"term"===b||"reverse_count"===b||"reverse_term"===b)&&(d[a].terms.order=b),this)},allTerms:function(b){return null==b?d[a].terms.all_terms:(d[a].terms.all_terms=b,this)},exclude:function(b){if(null==d[a].terms.exclude&&(d[a].terms.exclude=[]),null==b)return d[a].terms.exclude;if(g(b))d[a].terms.exclude.push(b);else{if(!e(b))throw new TypeError("Argument must be string or array");d[a].terms.exclude=b}return this},regex:function(b){return null==b?d[a].terms.regex:(d[a].terms.regex=b,this)},regexFlags:function(b){return null==b?d[a].terms.regex_flags:(d[a].terms.regex_flags=b,this)},script:function(b){return null==b?d[a].terms.script:(d[a].terms.script=b,this)},lang:function(b){return null==b?d[a].terms.lang:(d[a].terms.lang=b,this)},params:function(b){return null==b?d[a].terms.params:(d[a].terms.params=b,this)},executionHint:function(b){return null==b?d[a].terms.execution_hint:(d[a].terms.execution_hint=b,this)}})},z.AvgAggregation=function(a){{var b=z.MetricsAggregationMixin(a,"avg");b.toJSON()}return b},z.CardinalityAggregation=function(a){var b=z.MetricsAggregationMixin(a,"cardinality"),d=b.toJSON();return delete b.scriptValuesSorted,c(b,{rehash:function(b){return null==b?d[a].cardinality.rehash:(d[a].cardinality.rehash=b,this)},precisionThreshold:function(b){return null==b?d[a].cardinality.precision_threshold:(d[a].cardinality.precision_threshold=b,this)}})},z.DateHistogramAggregation=function(a){var b=z.AggregationMixin(a),d=b.toJSON();return d[a].date_histogram={},c(b,{field:function(b){return null==b?d[a].date_histogram.field:(d[a].date_histogram.field=b,this)},script:function(b){return null==b?d[a].date_histogram.script:(d[a].date_histogram.script=b,this)},lang:function(b){return null==b?d[a].date_histogram.lang:(d[a].date_histogram.lang=b,this)},timeZone:function(b){return null==b?d[a].date_histogram.time_zone:(d[a].date_histogram.time_zone=b,this)},preZone:function(b){return null==b?d[a].date_histogram.pre_zone:(d[a].date_histogram.pre_zone=b,this)},postZone:function(b){return null==b?d[a].date_histogram.post_zone:(d[a].date_histogram.post_zone=b,this)},preOffset:function(b){return null==b?d[a].date_histogram.pre_offset:(d[a].date_histogram.pre_offset=b,this)},postOffset:function(b){return null==b?d[a].date_histogram.post_offset:(d[a].date_histogram.post_offset=b,this)},extendedBounds:function(b,c){var e;return null==b&&null==c?d[a].date_histogram.extended_bounds:(e={},null!=b&&(e.min=b),null!=c&&(e.max=c),d[a].date_histogram.extended_bounds=e,this)},interval:function(b){return null==b?d[a].date_histogram.interval:(d[a].date_histogram.interval=b,this)},format:function(b){return null==b?d[a].date_histogram.format:(d[a].date_histogram.format=b,this)},keyed:function(b){return null==b?d[a].date_histogram.keyed:(d[a].date_histogram.keyed=b,this)},scriptValuesSorted:function(b){return null==b?d[a].date_histogram.script_values_sorted:(d[a].date_histogram.script_values_sorted=b,this)},preZoneAdjustLargeInterval:function(b){return null==b?d[a].date_histogram.pre_zone_adjust_large_interval:(d[a].date_histogram.pre_zone_adjust_large_interval=b,this)},minDocCount:function(b){return null==b?d[a].date_histogram.min_doc_count:(d[a].date_histogram.min_doc_count=b,this)},params:function(b){return null==b?d[a].date_histogram.params:(d[a].date_histogram.params=b,this)},order:function(b,c){return null==b?d[a].date_histogram.order:(null==c&&(c="desc"),c=c.toLowerCase(),"asc"!==c&&"desc"!==c&&(c="desc"),d[a].date_histogram.order={},d[a].date_histogram.order[b]=c,this)}})},z.DateRangeAggregation=function(a){var b=z.AggregationMixin(a),d=b.toJSON();return d[a].date_range={},c(b,{field:function(b){return null==b?d[a].date_range.field:(d[a].date_range.field=b,this)},script:function(b){return null==b?d[a].date_range.script:(d[a].date_range.script=b,this)},lang:function(b){return null==b?d[a].date_range.lang:(d[a].date_range.lang=b,this)},format:function(b){return null==b?d[a].date_range.format:(d[a].date_range.format=b,this)},range:function(b,c,e){var f={};return null==d[a].date_range.ranges&&(d[a].date_range.ranges=[]),null==b&&null==c?d[a].date_range.ranges:(null!=b&&(f.from=b),null!=c&&(f.to=c),null!=e&&(f.key=e),d[a].date_range.ranges.push(f),this)},keyed:function(b){return null==b?d[a].date_range.keyed:(d[a].date_range.keyed=b,this)},scriptValuesSorted:function(b){return null==b?d[a].date_range.script_values_sorted:(d[a].date_range.script_values_sorted=b,this)},params:function(b){return null==b?d[a].date_range.params:(d[a].date_range.params=b,this)}})},z.ExtendedStatsAggregation=function(a){{var b=z.MetricsAggregationMixin(a,"extended_stats");b.toJSON()}return b},z.FilterAggregation=function(a){var b=z.AggregationMixin(a),d=b.toJSON();return c(b,{filter:function(b){if(null==b)return d[a].filter;if(!n(b))throw new TypeError("Argument must be a Filter");return d[a].filter=b.toJSON(),this}})},z.GeoDistanceAggregation=function(a){var b=z.AggregationMixin(a),d=z.GeoPoint([0,0]),e=b.toJSON();return e[a].geo_distance={},c(b,{field:function(b){return null==b?e[a].geo_distance.field:(e[a].geo_distance.field=b,this)},unit:function(b){return null==b?e[a].geo_distance.unit:(("in"===b||"yd"===b||"ft"===b||"km"===b||"NM"===b||"mm"===b||"cm"===b||"mi"===b||"m"===b)&&(e[a].geo_distance.unit=b),this)},distanceType:function(b){return null==b?e[a].geo_distance.distance_type:(b=b.toLowerCase(),("plane"===b||"arc"===b||"sloppy_arc"===b||"factor"===b)&&(e[a].geo_distance.distance_type=b),this)},origin:function(b){if(null==b)return d;if(!r(b))throw new TypeError("Argument must be a GeoPoint");return d=b,e[a].geo_distance.origin=b.toJSON(),this},point:function(b){if(null==b)return d;if(!r(b))throw new TypeError("Argument must be a GeoPoint");return d=b,e[a].geo_distance.point=b.toJSON(),this},center:function(b){if(null==b)return d;if(!r(b))throw new TypeError("Argument must be a GeoPoint");return d=b,e[a].geo_distance.center=b.toJSON(),this},range:function(b,c,d){var f={};return null==e[a].geo_distance.ranges&&(e[a].geo_distance.ranges=[]),null==b&&null==c?e[a].geo_distance.ranges:(null!=b&&(f.from=b),null!=c&&(f.to=c),null!=d&&(f.key=d),e[a].geo_distance.ranges.push(f),this)},keyed:function(b){return null==b?e[a].geo_distance.keyed:(e[a].geo_distance.keyed=b,this)}})},z.GeoHashGridAggregation=function(a){var b=z.AggregationMixin(a),d=b.toJSON();return d[a].geohash_grid={},c(b,{field:function(b){return null==b?d[a].geohash_grid.field:(d[a].geohash_grid.field=b,this)},precision:function(b){return null==b?d[a].geohash_grid.precision:(d[a].geohash_grid.precision=b,this)},size:function(b){return null==b?d[a].geohash_grid.size:(d[a].geohash_grid.size=b,this)},shardSize:function(b){return null==b?d[a].geohash_grid.shard_size:(d[a].geohash_grid.shard_size=b,this)}})},z.GlobalAggregation=function(a){var b=z.AggregationMixin(a),c=b.toJSON();return c[a].global={},b},z.HistogramAggregation=function(a){var b=z.AggregationMixin(a),d=b.toJSON();return d[a].histogram={},c(b,{field:function(b){return null==b?d[a].histogram.field:(d[a].histogram.field=b,this)},script:function(b){return null==b?d[a].histogram.script:(d[a].histogram.script=b,this)},lang:function(b){return null==b?d[a].histogram.lang:(d[a].histogram.lang=b,this)},format:function(b){return null==b?d[a].histogram.format:(d[a].histogram.format=b,this)},extendedBounds:function(b,c){var e;return null==b&&null==c?d[a].histogram.extended_bounds:(e={},null!=b&&(e.min=b),null!=c&&(e.max=c),d[a].histogram.extended_bounds=e,this)},interval:function(b){return null==b?d[a].histogram.interval:(d[a].histogram.interval=b,this)},minDocCount:function(b){return null==b?d[a].histogram.min_doc_count:(d[a].histogram.min_doc_count=b,this)},keyed:function(b){return null==b?d[a].histogram.keyed:(d[a].histogram.keyed=b,this)},scriptValuesSorted:function(b){return null==b?d[a].histogram.script_values_sorted:(d[a].histogram.script_values_sorted=b,this)},params:function(b){return null==b?d[a].histogram.params:(d[a].histogram.params=b,this)},order:function(b,c){return null==b?d[a].histogram.order:(null==c&&(c="desc"),c=c.toLowerCase(),"asc"!==c&&"desc"!==c&&(c="desc"),d[a].histogram.order={},d[a].histogram.order[b]=c,this)}})},z.IPv4RangeAggregation=function(a){var b=z.AggregationMixin(a),d=b.toJSON();return d[a].ip_range={},c(b,{field:function(b){return null==b?d[a].ip_range.field:(d[a].ip_range.field=b,this)},script:function(b){return null==b?d[a].ip_range.script:(d[a].ip_range.script=b,this)},lang:function(b){return null==b?d[a].ip_range.lang:(d[a].ip_range.lang=b,this)},range:function(b,c,e,f){var g={};return null==d[a].ip_range.ranges&&(d[a].ip_range.ranges=[]),null==b&&null==c&&null==e?d[a].ip_range.ranges:(null!=b&&(g.from=b),null!=c&&(g.to=c),null!=e&&(g.mask=e),null!=f&&(g.key=f),d[a].ip_range.ranges.push(g),this)},keyed:function(b){return null==b?d[a].ip_range.keyed:(d[a].ip_range.keyed=b,this)},scriptValuesSorted:function(b){return null==b?d[a].ip_range.script_values_sorted:(d[a].ip_range.script_values_sorted=b,this)},params:function(b){return null==b?d[a].ip_range.params:(d[a].ip_range.params=b,this)}})},z.MaxAggregation=function(a){{var b=z.MetricsAggregationMixin(a,"max");b.toJSON()}return b},z.MinAggregation=function(a){{var b=z.MetricsAggregationMixin(a,"min");b.toJSON()}return b},z.MissingAggregation=function(a){var b=z.AggregationMixin(a),d=b.toJSON();return d[a].missing={},c(b,{field:function(b){return null==b?d[a].missing.field:(d[a].missing.field=b,this)}})},z.NestedAggregation=function(a){var b=z.AggregationMixin(a),d=b.toJSON();return d[a].nested={},c(b,{path:function(b){return null==b?d[a].nested.path:(d[a].nested.path=b,this)}})},z.PercentilesAggregation=function(a){var b=z.MetricsAggregationMixin(a,"percentiles"),d=b.toJSON();return c(b,{keyed:function(b){return null==b?d[a].percentiles.keyed:(d[a].percentiles.keyed=b,this)},percents:function(b){if(null==b)return d[a].percentiles.percents;if(!e(b))throw new TypeError("Percents must be an array of doubles");return d[a].percentiles.percents=b,this},percent:function(b){return null==d[a].percentiles.percents&&(d[a].percentiles.percents=[]),null==b?d[a].percentiles.percents:(d[a].percentiles.percents.push(b),this)},compression:function(b){return null==b?d[a].percentiles.compression:(d[a].percentiles.compression=b,this)}})},z.RangeAggregation=function(a){var b=z.AggregationMixin(a),d=b.toJSON();return d[a].range={},c(b,{field:function(b){return null==b?d[a].range.field:(d[a].range.field=b,this)},script:function(b){return null==b?d[a].range.script:(d[a].range.script=b,this)},lang:function(b){return null==b?d[a].range.lang:(d[a].range.lang=b,this)},range:function(b,c,e){var f={};return null==d[a].range.ranges&&(d[a].range.ranges=[]),null==b&&null==c?d[a].range.ranges:(null!=b&&(f.from=b),null!=c&&(f.to=c),null!=e&&(f.key=e),d[a].range.ranges.push(f),this)},keyed:function(b){return null==b?d[a].range.keyed:(d[a].range.keyed=b,this)},scriptValuesSorted:function(b){return null==b?d[a].range.script_values_sorted:(d[a].range.script_values_sorted=b,this)},params:function(b){return null==b?d[a].range.params:(d[a].range.params=b,this)}})},z.SignificantTermsAggregation=function(a){var b=z.AggregationMixin(a),d=b.toJSON();return d[a].significant_terms={},c(b,{field:function(b){return null==b?d[a].significant_terms.field:(d[a].significant_terms.field=b,this)},format:function(b){return null==b?d[a].significant_terms.format:(d[a].significant_terms.format=b,this)},include:function(b,c){return null==d[a].significant_terms.include&&(d[a].significant_terms.include={}),null==b?d[a].significant_terms.include:(d[a].significant_terms.include.pattern=b,null!=c&&(d[a].significant_terms.include.flags=c),this)},exclude:function(b,c){return null==d[a].significant_terms.exclude&&(d[a].significant_terms.exclude={}),null==b?d[a].significant_terms.exclude:(d[a].significant_terms.exclude.pattern=b,null!=c&&(d[a].significant_terms.exclude.flags=c),this)},executionHint:function(b){return null==b?d[a].significant_terms.execution_hint:(b=b.toLowerCase(),("map"===b||"ordinals"===b)&&(d[a].significant_terms.execution_hint=b),this)},size:function(b){return null==b?d[a].significant_terms.size:(d[a].significant_terms.size=b,this)},shardSize:function(b){return null==b?d[a].significant_terms.shard_size:(d[a].significant_terms.shard_size=b,this)},minDocCount:function(b){return null==b?d[a].significant_terms.min_doc_count:(d[a].significant_terms.min_doc_count=b,this)}})},z.StatsAggregation=function(a){{var b=z.MetricsAggregationMixin(a,"stats");b.toJSON()}return b},z.SumAggregation=function(a){{var b=z.MetricsAggregationMixin(a,"sum");b.toJSON()}return b},z.TermsAggregation=function(a){var b=z.AggregationMixin(a),d=b.toJSON();return d[a].terms={},c(b,{field:function(b){return null==b?d[a].terms.field:(d[a].terms.field=b,this)},script:function(b){return null==b?d[a].terms.script:(d[a].terms.script=b,this)},lang:function(b){return null==b?d[a].terms.lang:(d[a].terms.lang=b,this)},valueType:function(b){return null==b?d[a].terms.value_type:(b=b.toLowerCase(),("string"===b||"double"===b||"float"===b||"long"===b||"integer"===b||"short"===b||"byte"===b)&&(d[a].terms.value_type=b),this)},format:function(b){return null==b?d[a].terms.format:(d[a].terms.format=b,this)},include:function(b,c){return null==d[a].terms.include&&(d[a].terms.include={}),null==b?d[a].terms.include:(d[a].terms.include.pattern=b,null!=c&&(d[a].terms.include.flags=c),this)},exclude:function(b,c){return null==d[a].terms.exclude&&(d[a].terms.exclude={}),null==b?d[a].terms.exclude:(d[a].terms.exclude.pattern=b,null!=c&&(d[a].terms.exclude.flags=c),this)},executionHint:function(b){return null==b?d[a].terms.execution_hint:(b=b.toLowerCase(),("map"===b||"ordinals"===b)&&(d[a].terms.execution_hint=b),this)},scriptValuesUnique:function(b){return null==b?d[a].terms.script_values_unique:(d[a].terms.script_values_unique=b,this)},size:function(b){return null==b?d[a].terms.size:(d[a].terms.size=b,this)},shardSize:function(b){return null==b?d[a].terms.shard_size:(d[a].terms.shard_size=b,this)},minDocCount:function(b){return null==b?d[a].terms.min_doc_count:(d[a].terms.min_doc_count=b,this)},params:function(b){return null==b?d[a].terms.params:(d[a].terms.params=b,this)},order:function(b,c){return null==b?d[a].terms.order:(null==c&&(c="desc"),c=c.toLowerCase(),"asc"!==c&&"desc"!==c&&(c="desc"),d[a].terms.order={},d[a].terms.order[b]=c,this)}})},z.TopHitsAggregation=function(a){var b=z.MetricsAggregationMixin(a,"top_hits"),d=b.toJSON();return c(b,{from:function(b){return null===b?d[a].top_hits.from:(d[a].top_hits.from=b,this)},size:function(b){return null===b?d[a].top_hits.size:(d[a].top_hits.size=b,this)},sort:function(b){return null===b?d[a].top_hits.sort:(d[a].top_hits.sort=b,this)},trackScores:function(b){return null===b?d[a].top_hits.track_scores:(d[a].top_hits.track_scores=b,this)},version:function(b){return null===b?d[a].top_hits.version:(d[a].top_hits.version=b,this)},explain:function(b){return null===b?d[a].top_hits.explain:(d[a].top_hits.explain=b,this)},highlight:function(b){if(null===b)return d[a].top_hits.highlight;if(!v(b))throw new TypeError("Argument must be a Highlight object");return d[a].top_hits.highlight=b.toJSON(),this},scriptField:function(b){if(null===b)return d[a].top_hits.script_fields;if(void 0===d[a].top_hits.script_fields&&(d[a].top_hits.script_fields={}),!q(b))throw new TypeError("Argument must be a ScriptField");return c(d[a].top_hits.script_fields,b.toJSON()),this},fieldDataFields:function(b){return null===b?d[a].top_hits.fielddata_fields:(d[a].top_hits.fielddata_fields=b,this)},source:function(b,c){if(void 0===b&&void 0===c)return d[a].top_hits._source;if(!e(b)&&!g(b)&&!i(b))throw new TypeError("Argument includes must be a string, an array, or a boolean");if(void 0!==c&&!e(c)&&!g(c))throw new TypeError("Argument excludes must be a string or an array");return i(b)?d[a].top_hits._source=b:(d[a].top_hits._source={includes:b},void 0!==c&&(d[a].top_hits._source=c)),this}})},z.ValueCountAggregation=function(a){var b=z.MetricsAggregationMixin(a,"value_count"),d=b.toJSON();return delete b.scriptValuesSorted,c(b,{scriptValuesUnique:function(b){return null==b?d[a].value_count.script_values_unique:(d[a].value_count.script_values_unique=b,this)}})},z.AndFilter=function(a){var b,d,f=z.FilterMixin("and"),g=f.toJSON();if(g.and.filters=[],n(a))g.and.filters.push(a.toJSON());else{if(!e(a))throw new TypeError("Argument must be a Filter or Array of Filters");for(b=0,d=a.length;d>b;b++){if(!n(a[b]))throw new TypeError("Array must contain only Filter objects");g.and.filters.push(a[b].toJSON())}}return c(f,{filters:function(a){var b,c;if(null==a)return g.and.filters;if(n(a))g.and.filters.push(a.toJSON());else{if(!e(a))throw new TypeError("Argument must be a Filter or an Array of Filters");for(g.and.filters=[],b=0,c=a.length;c>b;b++){if(!n(a[b]))throw new TypeError("Array must contain only Filter objects");g.and.filters.push(a[b].toJSON())}}return this}})},z.BoolFilter=function(){var a=z.FilterMixin("bool"),b=a.toJSON();return c(a,{must:function(a){var c,d;if(null==b.bool.must&&(b.bool.must=[]),null==a)return b.bool.must;if(n(a))b.bool.must.push(a.toJSON());else{if(!e(a))throw new TypeError("Argument must be a Filter or array of Filters");for(b.bool.must=[],c=0,d=a.length;d>c;c++){if(!n(a[c]))throw new TypeError("Argument must be an array of Filters");b.bool.must.push(a[c].toJSON())}}return this},mustNot:function(a){var c,d;if(null==b.bool.must_not&&(b.bool.must_not=[]),null==a)return b.bool.must_not;if(n(a))b.bool.must_not.push(a.toJSON());else{if(!e(a))throw new TypeError("Argument must be a Filter or array of Filters");for(b.bool.must_not=[],c=0,d=a.length;d>c;c++){if(!n(a[c]))throw new TypeError("Argument must be an array of Filters");b.bool.must_not.push(a[c].toJSON()) -}}return this},should:function(a){var c,d;if(null==b.bool.should&&(b.bool.should=[]),null==a)return b.bool.should;if(n(a))b.bool.should.push(a.toJSON());else{if(!e(a))throw new TypeError("Argument must be a Filter or array of Filters");for(b.bool.should=[],c=0,d=a.length;d>c;c++){if(!n(a[c]))throw new TypeError("Argument must be an array of Filters");b.bool.should.push(a[c].toJSON())}}return this}})},z.ExistsFilter=function(a){var b=z.FilterMixin("exists"),d=b.toJSON();return d.exists.field=a,c(b,{field:function(a){return null==a?d.exists.field:(d.exists.field=a,this)}})},z.GeoBboxFilter=function(a){var b=z.FilterMixin("geo_bounding_box"),d=b.toJSON();return d.geo_bounding_box[a]={},c(b,{field:function(b){var c=d.geo_bounding_box[a];return null==b?a:(delete d.geo_bounding_box[a],a=b,d.geo_bounding_box[b]=c,this)},topLeft:function(b){if(null==b)return d.geo_bounding_box[a].top_left;if(!r(b))throw new TypeError("Argument must be a GeoPoint");return d.geo_bounding_box[a].top_left=b.toJSON(),this},bottomRight:function(b){if(null==b)return d.geo_bounding_box[a].bottom_right;if(!r(b))throw new TypeError("Argument must be a GeoPoint");return d.geo_bounding_box[a].bottom_right=b.toJSON(),this},type:function(a){return null==a?d.geo_bounding_box.type:(a=a.toLowerCase(),("memory"===a||"indexed"===a)&&(d.geo_bounding_box.type=a),this)},normalize:function(a){return null==a?d.geo_bounding_box.normalize:(d.geo_bounding_box.normalize=a,this)}})},z.GeoDistanceFilter=function(a){var b=z.FilterMixin("geo_distance"),d=b.toJSON();return d.geo_distance[a]=[0,0],c(b,{field:function(b){var c=d.geo_distance[a];return null==b?a:(delete d.geo_distance[a],a=b,d.geo_distance[b]=c,this)},distance:function(a){if(null==a)return d.geo_distance.distance;if(!h(a))throw new TypeError("Argument must be a numeric value");return d.geo_distance.distance=a,this},unit:function(a){return null==a?d.geo_distance.unit:(a=a.toLowerCase(),("mi"===a||"km"===a)&&(d.geo_distance.unit=a),this)},point:function(b){if(null==b)return d.geo_distance[a];if(!r(b))throw new TypeError("Argument must be a GeoPoint");return d.geo_distance[a]=b.toJSON(),this},distanceType:function(a){return null==a?d.geo_distance.distance_type:(a=a.toLowerCase(),("arc"===a||"plane"===a)&&(d.geo_distance.distance_type=a),this)},normalize:function(a){return null==a?d.geo_distance.normalize:(d.geo_distance.normalize=a,this)},optimizeBbox:function(a){return null==a?d.geo_distance.optimize_bbox:(a=a.toLowerCase(),("memory"===a||"indexed"===a||"none"===a)&&(d.geo_distance.optimize_bbox=a),this)}})},z.GeoDistanceRangeFilter=function(a){var b=z.FilterMixin("geo_distance_range"),d=b.toJSON();return d.geo_distance_range[a]=[0,0],c(b,{field:function(b){var c=d.geo_distance_range[a];return null==b?a:(delete d.geo_distance_range[a],a=b,d.geo_distance_range[b]=c,this)},from:function(a){if(null==a)return d.geo_distance_range.from;if(!h(a))throw new TypeError("Argument must be a numeric value");return d.geo_distance_range.from=a,this},to:function(a){if(null==a)return d.geo_distance_range.to;if(!h(a))throw new TypeError("Argument must be a numeric value");return d.geo_distance_range.to=a,this},includeLower:function(a){return null==a?d.geo_distance_range.include_lower:(d.geo_distance_range.include_lower=a,this)},includeUpper:function(a){return null==a?d.geo_distance_range.include_upper:(d.geo_distance_range.include_upper=a,this)},gt:function(a){if(null==a)return d.geo_distance_range.gt;if(!h(a))throw new TypeError("Argument must be a numeric value");return d.geo_distance_range.gt=a,this},gte:function(a){if(null==a)return d.geo_distance_range.gte;if(!h(a))throw new TypeError("Argument must be a numeric value");return d.geo_distance_range.gte=a,this},lt:function(a){if(null==a)return d.geo_distance_range.lt;if(!h(a))throw new TypeError("Argument must be a numeric value");return d.geo_distance_range.lt=a,this},lte:function(a){if(null==a)return d.geo_distance_range.lte;if(!h(a))throw new TypeError("Argument must be a numeric value");return d.geo_distance_range.lte=a,this},unit:function(a){return null==a?d.geo_distance_range.unit:(a=a.toLowerCase(),("mi"===a||"km"===a)&&(d.geo_distance_range.unit=a),this)},point:function(b){if(null==b)return d.geo_distance_range[a];if(!r(b))throw new TypeError("Argument must be a GeoPoint");return d.geo_distance_range[a]=b.toJSON(),this},distanceType:function(a){return null==a?d.geo_distance_range.distance_type:(a=a.toLowerCase(),("arc"===a||"plane"===a)&&(d.geo_distance_range.distance_type=a),this)},normalize:function(a){return null==a?d.geo_distance_range.normalize:(d.geo_distance_range.normalize=a,this)},optimizeBbox:function(a){return null==a?d.geo_distance_range.optimize_bbox:(a=a.toLowerCase(),("memory"===a||"indexed"===a||"none"===a)&&(d.geo_distance_range.optimize_bbox=a),this)}})},z.GeoPolygonFilter=function(a){var b=z.FilterMixin("geo_polygon"),d=b.toJSON();return d.geo_polygon[a]={points:[]},c(b,{field:function(b){var c=d.geo_polygon[a];return null==b?a:(delete d.geo_polygon[a],a=b,d.geo_polygon[b]=c,this)},points:function(b){var c,f;if(null==b)return d.geo_polygon[a].points;if(r(b))d.geo_polygon[a].points.push(b.toJSON());else{if(!e(b))throw new TypeError("Argument must be a GeoPoint or Array of GeoPoints");for(d.geo_polygon[a].points=[],c=0,f=b.length;f>c;c++){if(!r(b[c]))throw new TypeError("Argument must be Array of GeoPoints");d.geo_polygon[a].points.push(b[c].toJSON())}}return this},normalize:function(a){return null==a?d.geo_polygon.normalize:(d.geo_polygon.normalize=a,this)}})},z.GeoShapeFilter=function(a){var b=z.FilterMixin("geo_shape"),d=b.toJSON();return d.geo_shape[a]={},c(b,{field:function(b){var c=d.geo_shape[a];return null==b?a:(delete d.geo_shape[a],a=b,d.geo_shape[b]=c,this)},shape:function(b){return null==b?d.geo_shape[a].shape:(null!=d.geo_shape[a].indexed_shape&&delete d.geo_shape[a].indexed_shape,d.geo_shape[a].shape=b.toJSON(),this)},indexedShape:function(b){return null==b?d.geo_shape[a].indexed_shape:(null!=d.geo_shape[a].shape&&delete d.geo_shape[a].shape,d.geo_shape[a].indexed_shape=b.toJSON(),this)},relation:function(b){return null==b?d.geo_shape[a].relation:(b=b.toLowerCase(),("intersects"===b||"disjoint"===b||"within"===b)&&(d.geo_shape[a].relation=b),this)},strategy:function(b){return null==b?d.geo_shape[a].strategy:(b=b.toLowerCase(),("recursive"===b||"term"===b)&&(d.geo_shape[a].strategy=b),this)}})},z.HasChildFilter=function(a,b){var d=z.FilterMixin("has_child"),e=d.toJSON();if(l(a))e.has_child.query=a.toJSON();else if(n(a))e.has_child.filter=a.toJSON();else if(null!=a)throw new TypeError("Argument must be query or filter");return e.has_child.type=b,c(d,{query:function(a){if(null==a)return e.has_child.query;if(!l(a))throw new TypeError("Argument must be a Query object");return e.has_child.query=a.toJSON(),this},filter:function(a){if(null==a)return e.has_child.filter;if(!n(a))throw new TypeError("Argument must be a Filter object");return e.has_child.filter=a.toJSON(),this},type:function(a){return null==a?e.has_child.type:(e.has_child.type=a,this)},shortCircuitCutoff:function(a){return null==a?e.has_child.short_circuit_cutoff:(e.has_child.short_circuit_cutoff=a,this)},scope:function(){return this}})},z.HasParentFilter=function(a,b){var d=z.FilterMixin("has_parent"),e=d.toJSON();if(l(a))e.has_parent.query=a.toJSON();else if(n(a))e.has_parent.filter=a.toJSON();else if(null!=a)throw new TypeError("Argument must be query or filter");return e.has_parent.parent_type=b,c(d,{query:function(a){if(null==a)return e.has_parent.query;if(!l(a))throw new TypeError("Argument must be a Query object");return e.has_parent.query=a.toJSON(),this},filter:function(a){if(null==a)return e.has_parent.filter;if(!n(a))throw new TypeError("Argument must be a Filter object");return e.has_parent.filter=a.toJSON(),this},parentType:function(a){return null==a?e.has_parent.parent_type:(e.has_parent.parent_type=a,this)},scope:function(){return this}})},z.IdsFilter=function(a){var b=z.FilterMixin("ids"),d=b.toJSON();if(g(a))d.ids.values=[a];else{if(!e(a))throw new TypeError("Argument must be a string or an array");d.ids.values=a}return c(b,{values:function(a){if(null==a)return d.ids.values;if(g(a))d.ids.values.push(a);else{if(!e(a))throw new TypeError("Argument must be a string or an array");d.ids.values=a}return this},type:function(a){if(null==d.ids.type&&(d.ids.type=[]),null==a)return d.ids.type;if(g(a))d.ids.type.push(a);else{if(!e(a))throw new TypeError("Argument must be a string or an array");d.ids.type=a}return this}})},z.IndicesFilter=function(a,b){if(!n(a))throw new TypeError("Argument must be a Filter");var d=z.FilterMixin("indices"),f=d.toJSON();if(f.indices.filter=a.toJSON(),g(b))f.indices.indices=[b];else{if(!e(b))throw new TypeError("Argument must be a string or array");f.indices.indices=b}return c(d,{indices:function(a){if(null==a)return f.indices.indices;if(g(a))f.indices.indices.push(a);else{if(!e(a))throw new TypeError("Argument must be a string or array");f.indices.indices=a}return this},filter:function(a){if(null==a)return f.indices.filter;if(!n(a))throw new TypeError("Argument must be a Filter");return f.indices.filter=a.toJSON(),this},noMatchFilter:function(a){if(null==a)return f.indices.no_match_filter;if(g(a))a=a.toLowerCase(),("none"===a||"all"===a)&&(f.indices.no_match_filter=a);else{if(!n(a))throw new TypeError("Argument must be string or Filter");f.indices.no_match_filter=a.toJSON()}return this}})},z.LimitFilter=function(a){var b=z.FilterMixin("limit"),d=b.toJSON();return d.limit.value=a,c(b,{value:function(a){if(null==a)return d.limit.value;if(!h(a))throw new TypeError("Argument must be a numeric value");return d.limit.value=a,this}})},z.MatchAllFilter=function(){return z.FilterMixin("match_all")},z.MissingFilter=function(a){var b=z.FilterMixin("missing"),d=b.toJSON();return d.missing.field=a,c(b,{field:function(a){return null==a?d.missing.field:(d.missing.field=a,this)},existence:function(a){return null==a?d.missing.existence:(d.missing.existence=a,this)},nullValue:function(a){return null==a?d.missing.null_value:(d.missing.null_value=a,this)}})},z.NestedFilter=function(a){var b=z.FilterMixin("nested"),d=b.toJSON();return d.nested.path=a,c(b,{path:function(a){return null==a?d.nested.path:(d.nested.path=a,this)},query:function(a){if(null==a)return d.nested.query;if(!l(a))throw new TypeError("Argument must be a Query object");return d.nested.query=a.toJSON(),this},filter:function(a){if(null==a)return d.nested.filter;if(!n(a))throw new TypeError("Argument must be a Filter object");return d.nested.filter=a.toJSON(),this},boost:function(a){return null==a?d.nested.boost:(d.nested.boost=a,this)},join:function(a){return null==a?d.nested.join:(d.nested.join=a,this)},scope:function(){return this}})},z.NotFilter=function(a){if(!n(a))throw new TypeError("Argument must be a Filter");var b=z.FilterMixin("not"),d=b.toJSON();return d.not=a.toJSON(),c(b,{filter:function(a){if(null==a)return d.not;if(!n(a))throw new TypeError("Argument must be a Filter");return d.not=a.toJSON(),this}})},z.NumericRangeFilter=function(a){var b=z.FilterMixin("numeric_range"),d=b.toJSON();return d.numeric_range[a]={},c(b,{field:function(b){var c=d.numeric_range[a];return null==b?a:(delete d.numeric_range[a],a=b,d.numeric_range[a]=c,this)},from:function(b){if(null==b)return d.numeric_range[a].from;if(!h(b))throw new TypeError("Argument must be a numeric value");return d.numeric_range[a].from=b,this},to:function(b){if(null==b)return d.numeric_range[a].to;if(!h(b))throw new TypeError("Argument must be a numeric value");return d.numeric_range[a].to=b,this},includeLower:function(b){return null==b?d.numeric_range[a].include_lower:(d.numeric_range[a].include_lower=b,this)},includeUpper:function(b){return null==b?d.numeric_range[a].include_upper:(d.numeric_range[a].include_upper=b,this)},gt:function(b){if(null==b)return d.numeric_range[a].gt;if(!h(b))throw new TypeError("Argument must be a numeric value");return d.numeric_range[a].gt=b,this},gte:function(b){if(null==b)return d.numeric_range[a].gte;if(!h(b))throw new TypeError("Argument must be a numeric value");return d.numeric_range[a].gte=b,this},lt:function(b){if(null==b)return d.numeric_range[a].lt;if(!h(b))throw new TypeError("Argument must be a numeric value");return d.numeric_range[a].lt=b,this},lte:function(b){if(null==b)return d.numeric_range[a].lte;if(!h(b))throw new TypeError("Argument must be a numeric value");return d.numeric_range[a].lte=b,this}})},z.OrFilter=function(a){var b,d,f=z.FilterMixin("or"),g=f.toJSON();if(g.or.filters=[],n(a))g.or.filters.push(a.toJSON());else{if(!e(a))throw new TypeError("Argument must be a Filter or array of Filters");for(b=0,d=a.length;d>b;b++){if(!n(a[b]))throw new TypeError("Argument must be array of Filters");g.or.filters.push(a[b].toJSON())}}return c(f,{filters:function(a){var b,c;if(null==a)return g.or.filters;if(n(a))g.or.filters.push(a.toJSON());else{if(!e(a))throw new TypeError("Argument must be a Filter or array of Filters");for(g.or.filters=[],b=0,c=a.length;c>b;b++){if(!n(a[b]))throw new TypeError("Argument must be an array of Filters");g.or.filters.push(a[b].toJSON())}}return this}})},z.PrefixFilter=function(a,b){var d=z.FilterMixin("prefix"),e=d.toJSON();return e.prefix[a]=b,c(d,{field:function(b){var c=e.prefix[a];return null==b?a:(delete e.prefix[a],a=b,e.prefix[a]=c,this)},prefix:function(b){return null==b?e.prefix[a]:(e.prefix[a]=b,this)}})},z.QueryFilter=function(a){if(!l(a))throw new TypeError("Argument must be a Query");var b=z.FilterMixin("fquery"),d=b.toJSON();return d.fquery.query=a.toJSON(),c(b,{query:function(a){if(null==a)return d.fquery.query;if(!l(a))throw new TypeError("Argument must be a Query");return d.fquery.query=a.toJSON(),this}})},z.RangeFilter=function(a){var b=z.FilterMixin("range"),d=b.toJSON();return d.range[a]={},c(b,{field:function(b){var c=d.range[a];return null==b?a:(delete d.range[a],a=b,d.range[b]=c,this)},from:function(b){return null==b?d.range[a].from:(d.range[a].from=b,this)},to:function(b){return null==b?d.range[a].to:(d.range[a].to=b,this)},includeLower:function(b){return null==b?d.range[a].include_lower:(d.range[a].include_lower=b,this)},includeUpper:function(b){return null==b?d.range[a].include_upper:(d.range[a].include_upper=b,this)},gt:function(b){return null==b?d.range[a].gt:(d.range[a].gt=b,this)},gte:function(b){return null==b?d.range[a].gte:(d.range[a].gte=b,this)},lt:function(b){return null==b?d.range[a].lt:(d.range[a].lt=b,this)},lte:function(b){return null==b?d.range[a].lte:(d.range[a].lte=b,this)}})},z.RegexpFilter=function(a,b){var d=z.FilterMixin("regexp"),e=d.toJSON();return e.regexp[a]={value:b},c(d,{field:function(b){var c=e.regexp[a];return null==b?a:(delete e.regexp[a],a=b,e.regexp[b]=c,this)},value:function(b){return null==b?e.regexp[a].value:(e.regexp[a].value=b,this)},flags:function(b){return null==b?e.regexp[a].flags:(e.regexp[a].flags=b,this)},flagsValue:function(b){return null==b?e.regexp[a].flags_value:(e.regexp[a].flags_value=b,this)}})},z.ScriptFilter=function(a){var b=z.FilterMixin("script"),d=b.toJSON();return d.script.script=a,c(b,{script:function(a){return null==a?d.script.script:(d.script.script=a,this)},params:function(a){return null==a?d.script.params:(d.script.params=a,this)},lang:function(a){return null==a?d.script.lang:(d.script.lang=a,this)}})},z.TermFilter=function(a,b){var d=z.FilterMixin("term"),e=d.toJSON();return e.term[a]=b,c(d,{field:function(b){var c=e.term[a];return null==b?a:(delete e.term[a],a=b,e.term[a]=c,this)},term:function(b){return null==b?e.term[a]:(e.term[a]=b,this)}})},z.TermsFilter=function(a,b){var d=z.FilterMixin("terms"),f=d.toJSON(),g=function(){e(f.terms[a])||(f.terms[a]=[])},h=function(){e(f.terms[a])&&(f.terms[a]={})};return f.terms[a]=e(b)?b:[b],c(d,{field:function(b){var c=f.terms[a];return null==b?a:(delete f.terms[a],a=b,f.terms[b]=c,this)},terms:function(b){return g(),null==b?f.terms[a]:(e(b)?f.terms[a]=b:f.terms[a].push(b),this)},index:function(b){return h(),null==b?f.terms[a].index:(f.terms[a].index=b,this)},type:function(b){return h(),null==b?f.terms[a].type:(f.terms[a].type=b,this)},id:function(b){return h(),null==b?f.terms[a].id:(f.terms[a].id=b,this)},path:function(b){return h(),null==b?f.terms[a].path:(f.terms[a].path=b,this)},routing:function(b){return h(),null==b?f.terms[a].routing:(f.terms[a].routing=b,this)},cacheLookup:function(b){return h(),null==b?f.terms[a].cache:(f.terms[a].cache=b,this)},execution:function(a){return null==a?f.terms.execution:(a=a.toLowerCase(),("plain"===a||"bool"===a||"bool_nocache"===a||"and"===a||"and_nocache"===a||"or"===a||"or_nocache"===a)&&(f.terms.execution=a),this)}})},z.TypeFilter=function(a){var b=z.FilterMixin("type"),d=b.toJSON();return d.type.value=a,c(b,{type:function(a){return null==a?d.type.value:(d.type.value=a,this)}})},z.BoolQuery=function(){var a=z.QueryMixin("bool"),b=a.toJSON();return c(a,{must:function(a){var c,d;if(null==b.bool.must&&(b.bool.must=[]),null==a)return b.bool.must;if(l(a))b.bool.must.push(a.toJSON());else{if(!e(a))throw new TypeError("Argument must be a Query or array of Queries");for(b.bool.must=[],c=0,d=a.length;d>c;c++){if(!l(a[c]))throw new TypeError("Argument must be an array of Queries");b.bool.must.push(a[c].toJSON())}}return this},mustNot:function(a){var c,d;if(null==b.bool.must_not&&(b.bool.must_not=[]),null==a)return b.bool.must_not;if(l(a))b.bool.must_not.push(a.toJSON());else{if(!e(a))throw new TypeError("Argument must be a Query or array of Queries");for(b.bool.must_not=[],c=0,d=a.length;d>c;c++){if(!l(a[c]))throw new TypeError("Argument must be an array of Queries");b.bool.must_not.push(a[c].toJSON())}}return this},should:function(a){var c,d;if(null==b.bool.should&&(b.bool.should=[]),null==a)return b.bool.should;if(l(a))b.bool.should.push(a.toJSON());else{if(!e(a))throw new TypeError("Argument must be a Query or array of Queries");for(b.bool.should=[],c=0,d=a.length;d>c;c++){if(!l(a[c]))throw new TypeError("Argument must be an array of Queries");b.bool.should.push(a[c].toJSON())}}return this},adjustPureNegative:function(a){return null==a?b.bool.adjust_pure_negative:(b.bool.adjust_pure_negative=a,this)},disableCoord:function(a){return null==a?b.bool.disable_coord:(b.bool.disable_coord=a,this)},minimumNumberShouldMatch:function(a){return null==a?b.bool.minimum_number_should_match:(b.bool.minimum_number_should_match=a,this)}})},z.BoostingQuery=function(a,b,d){if(!l(a)||!l(b))throw new TypeError("Arguments must be Queries");var e=z.QueryMixin("boosting"),f=e.toJSON();return f.boosting.positive=a.toJSON(),f.boosting.negative=b.toJSON(),f.boosting.negative_boost=d,c(e,{positive:function(a){if(null==a)return f.boosting.positive;if(!l(a))throw new TypeError("Argument must be a Query");return f.boosting.positive=a.toJSON(),this},negative:function(a){if(null==a)return f.boosting.negative;if(!l(a))throw new TypeError("Argument must be a Query");return f.boosting.negative=a.toJSON(),this},negativeBoost:function(a){return null==a?f.boosting.negative_boost:(f.boosting.negative_boost=a,this)}})},z.CommonTermsQuery=function(a,b){var d=z.QueryMixin("common"),e=d.toJSON();return null==a&&(a="no_field_set"),e.common[a]={},null!=b&&(e.common[a].query=b),c(d,{field:function(b){var c=e.common[a];return null==b?a:(delete e.common[a],a=b,e.common[b]=c,this)},query:function(b){return null==b?e.common[a].query:(e.common[a].query=b,this)},analyzer:function(b){return null==b?e.common[a].analyzer:(e.common[a].analyzer=b,this)},disableCoord:function(b){return null==b?e.common[a].disable_coord:(e.common[a].disable_coord=b,this)},cutoffFrequency:function(b){return null==b?e.common[a].cutoff_frequency:(e.common[a].cutoff_frequency=b,this)},highFreqOperator:function(b){return null==b?e.common[a].high_freq_operator:(b=b.toLowerCase(),("and"===b||"or"===b)&&(e.common[a].high_freq_operator=b),this)},lowFreqOperator:function(b){return null==b?e.common[a].low_freq_operator:(b=b.toLowerCase(),("and"===b||"or"===b)&&(e.common[a].low_freq_operator=b),this)},minimumShouldMatch:function(b){return null==b?e.common[a].minimum_should_match.low_freq:(null==e.common[a].minimum_should_match&&(e.common[a].minimum_should_match={}),e.common[a].minimum_should_match.low_freq=b,this)},minimumShouldMatchLowFreq:function(a){return this.minimumShouldMatch(a)},minimumShouldMatchHighFreq:function(b){return null==b?e.common[a].minimum_should_match.high_freq:(null==e.common[a].minimum_should_match&&(e.common[a].minimum_should_match={}),e.common[a].minimum_should_match.high_freq=b,this)},boost:function(b){return null==b?e.common[a].boost:(e.common[a].boost=b,this)}})},z.ConstantScoreQuery=function(){var a=z.QueryMixin("constant_score"),b=a.toJSON();return c(a,{query:function(a){if(null==a)return b.constant_score.query;if(!l(a))throw new TypeError("Argument must be a Query");return b.constant_score.query=a.toJSON(),this},filter:function(a){if(null==a)return b.constant_score.filter;if(!n(a))throw new TypeError("Argument must be a Filter");return b.constant_score.filter=a.toJSON(),this},cache:function(a){return null==a?b.constant_score._cache:(b.constant_score._cache=a,this)},cacheKey:function(a){return null==a?b.constant_score._cache_key:(b.constant_score._cache_key=a,this)}})},z.DisMaxQuery=function(){var a=z.QueryMixin("dis_max"),b=a.toJSON();return c(a,{queries:function(a){var c,d;if(null==a)return b.dis_max.queries;if(null==b.dis_max.queries&&(b.dis_max.queries=[]),l(a))b.dis_max.queries.push(a.toJSON());else{if(!e(a))throw new TypeError("Argument must be a Query or array of Queries");for(b.dis_max.queries=[],c=0,d=a.length;d>c;c++){if(!l(a[c]))throw new TypeError("Argument must be array of Queries");b.dis_max.queries.push(a[c].toJSON())}}return this},tieBreaker:function(a){return null==a?b.dis_max.tie_breaker:(b.dis_max.tie_breaker=a,this)}})},z.FieldMaskingSpanQuery=function(a,b){if(!l(a))throw new TypeError("Argument must be a SpanQuery");var d=z.QueryMixin("field_masking_span"),e=d.toJSON();return e.field_masking_span.query=a.toJSON(),e.field_masking_span.field=b,c(d,{query:function(a){if(null==a)return e.field_masking_span.query;if(!l(a))throw new TypeError("Argument must be a SpanQuery");return e.field_masking_span.query=a.toJSON(),this},field:function(a){return null==a?e.field_masking_span.field:(e.field_masking_span.field=a,this)}})},z.FilteredQuery=function(a,b){if(!l(a))throw new TypeError("Argument must be a Query");if(null!=b&&!n(b))throw new TypeError("Argument must be a Filter");var d=z.QueryMixin("filtered"),e=d.toJSON();return e.filtered.query=a.toJSON(),null!=b&&(e.filtered.filter=b.toJSON()),c(d,{query:function(a){if(null==a)return e.filtered.query;if(!l(a))throw new TypeError("Argument must be a Query");return e.filtered.query=a.toJSON(),this},filter:function(a){if(null==a)return e.filtered.filter;if(!n(a))throw new TypeError("Argument must be a Filter");return e.filtered.filter=a.toJSON(),this},strategy:function(a){return null==a?e.filtered.strategy:(a=a.toLowerCase(),("query_first"===a||"random_access_always"===a||"leap_frog"===a||"leap_frog_filter_first"===a||0===a.indexOf("random_access_"))&&(e.filtered.strategy=a),this)},cache:function(a){return null==a?e.filtered._cache:(e.filtered._cache=a,this)},cacheKey:function(a){return null==a?e.filtered._cache_key:(e.filtered._cache_key=a,this)}})},z.FunctionScoreQuery=function(){var a=z.QueryMixin("function_score"),b=a.toJSON();return c(a,{query:function(a){if(null==a)return b.function_score.query;if(!l(a))throw new TypeError("Argument must be a Query");return b.function_score.query=a.toJSON(),this},filter:function(a){if(null==a)return b.function_score.filter;if(!n(a))throw new TypeError("Argument must be a Filter");return b.function_score.filter=a.toJSON(),this},scoreMode:function(a){return null==a?b.function_score.score_mode:(a=a.toLowerCase(),("avg"===a||"max"===a||"min"===a||"sum"===a||"multiply"===a||"first"===a)&&(b.function_score.score_mode=a),this)},boostMode:function(a){return null==a?b.function_score.boost_mode:(a=a.toLowerCase(),("multiply"===a||"replace"===a||"sum"===a||"avg"===a||"max"===a||"min"===a)&&(b.function_score.boost_mode=a),this)},boost:function(a){return null==a?b.function_score.boost:(b.function_score.boost=a,this)},"function":function(a){if(null==b.function_score.functions&&(b.function_score.functions=[]),null==a)return b.function_score.functions;if(!y(a))throw new TypeError("Argument must be a ScoreFunction");return b.function_score.functions.push(a.toJSON()),this},functions:function(a){var c,d;if(null==a)return b.function_score.functions;if(!e(a))throw new TypeError("Argument must be an array of ScoreFunctions");for(b.function_score.functions=[],c=0,d=a.length;d>c;c++){if(!y(a[c]))throw new TypeError("Argument must be an array of ScoreFunctions");b.function_score.functions.push(a[c].toJSON())}return this}})},z.FuzzyLikeThisFieldQuery=function(a,b){var d=z.QueryMixin("flt_field"),e=d.toJSON();return e.flt_field[a]={like_text:b},c(d,{field:function(b){var c=e.flt_field[a];return null==b?a:(delete e.flt_field[a],a=b,e.flt_field[b]=c,this)},likeText:function(b){return null==b?e.flt_field[a].like_text:(e.flt_field[a].like_text=b,this)},ignoreTf:function(b){return null==b?e.flt_field[a].ignore_tf:(e.flt_field[a].ignore_tf=b,this)},maxQueryTerms:function(b){return null==b?e.flt_field[a].max_query_terms:(e.flt_field[a].max_query_terms=b,this)},minSimilarity:function(b){return null==b?e.flt_field[a].min_similarity:(e.flt_field[a].min_similarity=b,this)},prefixLength:function(b){return null==b?e.flt_field[a].prefix_length:(e.flt_field[a].prefix_length=b,this)},analyzer:function(b){return null==b?e.flt_field[a].analyzer:(e.flt_field[a].analyzer=b,this)},failOnUnsupportedField:function(b){return null==b?e.flt_field[a].fail_on_unsupported_field:(e.flt_field[a].fail_on_unsupported_field=b,this)},boost:function(b){return null==b?e.flt_field[a].boost:(e.flt_field[a].boost=b,this)}})},z.FuzzyLikeThisQuery=function(a){var b=z.QueryMixin("flt"),d=b.toJSON();return d.flt.like_text=a,c(b,{fields:function(a){if(null==d.flt.fields&&(d.flt.fields=[]),null==a)return d.flt.fields;if(g(a))d.flt.fields.push(a);else{if(!e(a))throw new TypeError("Argument must be a string or array");d.flt.fields=a}return this},likeText:function(a){return null==a?d.flt.like_text:(d.flt.like_text=a,this)},ignoreTf:function(a){return null==a?d.flt.ignore_tf:(d.flt.ignore_tf=a,this)},maxQueryTerms:function(a){return null==a?d.flt.max_query_terms:(d.flt.max_query_terms=a,this)},minSimilarity:function(a){return null==a?d.flt.min_similarity:(d.flt.min_similarity=a,this)},prefixLength:function(a){return null==a?d.flt.prefix_length:(d.flt.prefix_length=a,this)},analyzer:function(a){return null==a?d.flt.analyzer:(d.flt.analyzer=a,this)},failOnUnsupportedField:function(a){return null==a?d.flt.fail_on_unsupported_field:(d.flt.fail_on_unsupported_field=a,this)}})},z.FuzzyQuery=function(a,b){var d=z.QueryMixin("fuzzy"),e=d.toJSON();return e.fuzzy[a]={value:b},c(d,{field:function(b){var c=e.fuzzy[a];return null==b?a:(delete e.fuzzy[a],a=b,e.fuzzy[b]=c,this)},value:function(b){return null==b?e.fuzzy[a].value:(e.fuzzy[a].value=b,this)},transpositions:function(b){return null==b?e.fuzzy[a].transpositions:(e.fuzzy[a].transpositions=b,this)},maxExpansions:function(b){return null==b?e.fuzzy[a].max_expansions:(e.fuzzy[a].max_expansions=b,this)},minSimilarity:function(b){return null==b?e.fuzzy[a].min_similarity:(e.fuzzy[a].min_similarity=b,this)},prefixLength:function(b){return null==b?e.fuzzy[a].prefix_length:(e.fuzzy[a].prefix_length=b,this)},rewrite:function(b){return null==b?e.fuzzy[a].rewrite:(b=b.toLowerCase(),("constant_score_auto"===b||"scoring_boolean"===b||"constant_score_boolean"===b||"constant_score_filter"===b||0===b.indexOf("top_terms_boost_")||0===b.indexOf("top_terms_"))&&(e.fuzzy[a].rewrite=b),this)},boost:function(b){return null==b?e.fuzzy[a].boost:(e.fuzzy[a].boost=b,this)}})},z.GeoShapeQuery=function(a){var b=z.QueryMixin("geo_shape"),d=b.toJSON();return d.geo_shape[a]={},c(b,{field:function(b){var c=d.geo_shape[a];return null==b?a:(delete d.geo_shape[a],a=b,d.geo_shape[b]=c,this)},shape:function(b){return null==b?d.geo_shape[a].shape:(null!=d.geo_shape[a].indexed_shape&&delete d.geo_shape[a].indexed_shape,d.geo_shape[a].shape=b.toJSON(),this)},indexedShape:function(b){return null==b?d.geo_shape[a].indexed_shape:(null!=d.geo_shape[a].shape&&delete d.geo_shape[a].shape,d.geo_shape[a].indexed_shape=b.toJSON(),this)},relation:function(b){return null==b?d.geo_shape[a].relation:(b=b.toLowerCase(),("intersects"===b||"disjoint"===b||"within"===b)&&(d.geo_shape[a].relation=b),this)},strategy:function(b){return null==b?d.geo_shape[a].strategy:(b=b.toLowerCase(),("recursive"===b||"term"===b)&&(d.geo_shape[a].strategy=b),this)},boost:function(b){return null==b?d.geo_shape[a].boost:(d.geo_shape[a].boost=b,this)}})},z.HasChildQuery=function(a,b){if(!l(a))throw new TypeError("Argument must be a valid Query");var d=z.QueryMixin("has_child"),e=d.toJSON();return e.has_child.query=a.toJSON(),e.has_child.type=b,c(d,{query:function(a){if(null==a)return e.has_child.query;if(!l(a))throw new TypeError("Argument must be a valid Query");return e.has_child.query=a.toJSON(),this},type:function(a){return null==a?e.has_child.type:(e.has_child.type=a,this)},scope:function(){return this},scoreType:function(a){return null==a?e.has_child.score_type:(a=a.toLowerCase(),("none"===a||"max"===a||"sum"===a||"avg"===a)&&(e.has_child.score_type=a),this)},scoreMode:function(a){return null==a?e.has_child.score_mode:(a=a.toLowerCase(),("none"===a||"max"===a||"sum"===a||"avg"===a)&&(e.has_child.score_mode=a),this)},shortCircuitCutoff:function(a){return null==a?e.has_child.short_circuit_cutoff:(e.has_child.short_circuit_cutoff=a,this)}})},z.HasParentQuery=function(a,b){if(!l(a))throw new TypeError("Argument must be a Query");var d=z.QueryMixin("has_parent"),e=d.toJSON();return e.has_parent.query=a.toJSON(),e.has_parent.parent_type=b,c(d,{query:function(a){if(null==a)return e.has_parent.query;if(!l(a))throw new TypeError("Argument must be a Query");return e.has_parent.query=a.toJSON(),this},parentType:function(a){return null==a?e.has_parent.parent_type:(e.has_parent.parent_type=a,this)},scope:function(){return this},scoreType:function(a){return null==a?e.has_parent.score_type:(a=a.toLowerCase(),("none"===a||"score"===a)&&(e.has_parent.score_type=a),this)},scoreMode:function(a){return null==a?e.has_parent.score_mode:(a=a.toLowerCase(),("none"===a||"score"===a)&&(e.has_parent.score_mode=a),this)}})},z.IdsQuery=function(a){var b=z.QueryMixin("ids"),d=b.toJSON();if(g(a))d.ids.values=[a];else{if(!e(a))throw new TypeError("Argument must be string or array");d.ids.values=a}return c(b,{values:function(a){if(null==a)return d.ids.values;if(g(a))d.ids.values.push(a);else{if(!e(a))throw new TypeError("Argument must be string or array");d.ids.values=a}return this},type:function(a){if(null==d.ids.type&&(d.ids.type=[]),null==a)return d.ids.type;if(g(a))d.ids.type.push(a);else{if(!e(a))throw new TypeError("Argument must be string or array");d.ids.type=a}return this}})},z.IndicesQuery=function(a,b){if(!l(a))throw new TypeError("Argument must be a Query");var d=z.QueryMixin("indices"),f=d.toJSON();if(f.indices.query=a.toJSON(),g(b))f.indices.indices=[b];else{if(!e(b))throw new TypeError("Argument must be a string or array");f.indices.indices=b}return c(d,{indices:function(a){if(null==a)return f.indices.indices;if(g(a))f.indices.indices.push(a);else{if(!e(a))throw new TypeError("Argument must be a string or array");f.indices.indices=a}return this},query:function(a){if(null==a)return f.indices.query;if(!l(a))throw new TypeError("Argument must be a Query");return f.indices.query=a.toJSON(),this},noMatchQuery:function(a){if(null==a)return f.indices.no_match_query;if(g(a))a=a.toLowerCase(),("none"===a||"all"===a)&&(f.indices.no_match_query=a);else{if(!l(a))throw new TypeError("Argument must be string or Query");f.indices.no_match_query=a.toJSON()}return this -}})},z.MatchAllQuery=function(){return z.QueryMixin("match_all")},z.MatchQuery=function(a,b){var d=z.QueryMixin("match"),e=d.toJSON();return e.match[a]={query:b},c(d,{query:function(b){return null==b?e.match[a].query:(e.match[a].query=b,this)},type:function(b){return null==b?e.match[a].type:(b=b.toLowerCase(),("boolean"===b||"phrase"===b||"phrase_prefix"===b)&&(e.match[a].type=b),this)},fuzziness:function(b){return null==b?e.match[a].fuzziness:(e.match[a].fuzziness=b,this)},cutoffFrequency:function(b){return null==b?e.match[a].cutoff_frequency:(e.match[a].cutoff_frequency=b,this)},prefixLength:function(b){return null==b?e.match[a].prefix_length:(e.match[a].prefix_length=b,this)},maxExpansions:function(b){return null==b?e.match[a].max_expansions:(e.match[a].max_expansions=b,this)},operator:function(b){return null==b?e.match[a].operator:(b=b.toLowerCase(),("and"===b||"or"===b)&&(e.match[a].operator=b),this)},slop:function(b){return null==b?e.match[a].slop:(e.match[a].slop=b,this)},analyzer:function(b){return null==b?e.match[a].analyzer:(e.match[a].analyzer=b,this)},minimumShouldMatch:function(b){return null==b?e.match[a].minimum_should_match:(e.match[a].minimum_should_match=b,this)},rewrite:function(b){return null==b?e.match[a].rewrite:(b=b.toLowerCase(),("constant_score_auto"===b||"scoring_boolean"===b||"constant_score_boolean"===b||"constant_score_filter"===b||0===b.indexOf("top_terms_boost_")||0===b.indexOf("top_terms_"))&&(e.match[a].rewrite=b),this)},fuzzyRewrite:function(b){return null==b?e.match[a].fuzzy_rewrite:(b=b.toLowerCase(),("constant_score_auto"===b||"scoring_boolean"===b||"constant_score_boolean"===b||"constant_score_filter"===b||0===b.indexOf("top_terms_boost_")||0===b.indexOf("top_terms_"))&&(e.match[a].fuzzy_rewrite=b),this)},fuzzyTranspositions:function(b){return null==b?e.match[a].fuzzy_transpositions:(e.match[a].fuzzy_transpositions=b,this)},lenient:function(b){return null==b?e.match[a].lenient:(e.match[a].lenient=b,this)},zeroTermsQuery:function(b){return null==b?e.match[a].zero_terms_query:(b=b.toLowerCase(),("all"===b||"none"===b)&&(e.match[a].zero_terms_query=b),this)},boost:function(b){return null==b?e.match[a].boost:(e.match[a].boost=b,this)}})},z.MoreLikeThisFieldQuery=function(a,b){var d=z.QueryMixin("mlt_field"),e=d.toJSON();return e.mlt_field[a]={like_text:b},c(d,{field:function(b){var c=e.mlt_field[a];return null==b?a:(delete e.mlt_field[a],a=b,e.mlt_field[b]=c,this)},likeText:function(b){return null==b?e.mlt_field[a].like_text:(e.mlt_field[a].like_text=b,this)},percentTermsToMatch:function(b){return null==b?e.mlt_field[a].percent_terms_to_match:(e.mlt_field[a].percent_terms_to_match=b,this)},minTermFreq:function(b){return null==b?e.mlt_field[a].min_term_freq:(e.mlt_field[a].min_term_freq=b,this)},maxQueryTerms:function(b){return null==b?e.mlt_field[a].max_query_terms:(e.mlt_field[a].max_query_terms=b,this)},stopWords:function(b){return null==b?e.mlt_field[a].stop_words:(e.mlt_field[a].stop_words=b,this)},minDocFreq:function(b){return null==b?e.mlt_field[a].min_doc_freq:(e.mlt_field[a].min_doc_freq=b,this)},maxDocFreq:function(b){return null==b?e.mlt_field[a].max_doc_freq:(e.mlt_field[a].max_doc_freq=b,this)},minWordLen:function(b){return null==b?e.mlt_field[a].min_word_len:(e.mlt_field[a].min_word_len=b,this)},maxWordLen:function(b){return null==b?e.mlt_field[a].max_word_len:(e.mlt_field[a].max_word_len=b,this)},analyzer:function(b){return null==b?e.mlt_field[a].analyzer:(e.mlt_field[a].analyzer=b,this)},boostTerms:function(b){return null==b?e.mlt_field[a].boost_terms:(e.mlt_field[a].boost_terms=b,this)},failOnUnsupportedField:function(b){return null==b?e.mlt_field[a].fail_on_unsupported_field:(e.mlt_field[a].fail_on_unsupported_field=b,this)},boost:function(b){return null==b?e.mlt_field[a].boost:(e.mlt_field[a].boost=b,this)}})},z.MoreLikeThisQuery=function(a,b){var d=z.QueryMixin("mlt"),f=d.toJSON();if(f.mlt.like_text=b,f.mlt.fields=[],g(a))f.mlt.fields.push(a);else{if(!e(a))throw new TypeError("Argument must be string or array");f.mlt.fields=a}return c(d,{fields:function(a){if(null==a)return f.mlt.fields;if(g(a))f.mlt.fields.push(a);else{if(!e(a))throw new TypeError("Argument must be a string or array");f.mlt.fields=a}return this},likeText:function(a){return null==a?f.mlt.like_text:(f.mlt.like_text=a,this)},percentTermsToMatch:function(a){return null==a?f.mlt.percent_terms_to_match:(f.mlt.percent_terms_to_match=a,this)},minTermFreq:function(a){return null==a?f.mlt.min_term_freq:(f.mlt.min_term_freq=a,this)},maxQueryTerms:function(a){return null==a?f.mlt.max_query_terms:(f.mlt.max_query_terms=a,this)},stopWords:function(a){return null==a?f.mlt.stop_words:(f.mlt.stop_words=a,this)},minDocFreq:function(a){return null==a?f.mlt.min_doc_freq:(f.mlt.min_doc_freq=a,this)},maxDocFreq:function(a){return null==a?f.mlt.max_doc_freq:(f.mlt.max_doc_freq=a,this)},minWordLen:function(a){return null==a?f.mlt.min_word_len:(f.mlt.min_word_len=a,this)},maxWordLen:function(a){return null==a?f.mlt.max_word_len:(f.mlt.max_word_len=a,this)},analyzer:function(a){return null==a?f.mlt.analyzer:(f.mlt.analyzer=a,this)},boostTerms:function(a){return null==a?f.mlt.boost_terms:(f.mlt.boost_terms=a,this)},failOnUnsupportedField:function(a){return null==a?f.mlt.fail_on_unsupported_field:(f.mlt.fail_on_unsupported_field=a,this)}})},z.MultiMatchQuery=function(a,b){var d=z.QueryMixin("multi_match"),f=d.toJSON();if(f.multi_match.query=b,f.multi_match.fields=[],g(a))f.multi_match.fields.push(a);else{if(!e(a))throw new TypeError("Argument must be string or array");f.multi_match.fields=a}return c(d,{fields:function(a){if(null==a)return f.multi_match.fields;if(g(a))f.multi_match.fields.push(a);else{if(!e(a))throw new TypeError("Argument must be string or array");f.multi_match.fields=a}return this},useDisMax:function(a){return null==a?f.multi_match.use_dis_max:(f.multi_match.use_dis_max=a,this)},tieBreaker:function(a){return null==a?f.multi_match.tie_breaker:(f.multi_match.tie_breaker=a,this)},cutoffFrequency:function(a){return null==a?f.multi_match.cutoff_frequency:(f.multi_match.cutoff_frequency=a,this)},minimumShouldMatch:function(a){return null==a?f.multi_match.minimum_should_match:(f.multi_match.minimum_should_match=a,this)},rewrite:function(a){return null==a?f.multi_match.rewrite:(a=a.toLowerCase(),("constant_score_auto"===a||"scoring_boolean"===a||"constant_score_boolean"===a||"constant_score_filter"===a||0===a.indexOf("top_terms_boost_")||0===a.indexOf("top_terms_"))&&(f.multi_match.rewrite=a),this)},fuzzyRewrite:function(a){return null==a?f.multi_match.fuzzy_rewrite:(a=a.toLowerCase(),("constant_score_auto"===a||"scoring_boolean"===a||"constant_score_boolean"===a||"constant_score_filter"===a||0===a.indexOf("top_terms_boost_")||0===a.indexOf("top_terms_"))&&(f.multi_match.fuzzy_rewrite=a),this)},lenient:function(a){return null==a?f.multi_match.lenient:(f.multi_match.lenient=a,this)},query:function(a){return null==a?f.multi_match.query:(f.multi_match.query=a,this)},type:function(a){return null==a?f.multi_match.type:(a=a.toLowerCase(),("boolean"===a||"phrase"===a||"phrase_prefix"===a)&&(f.multi_match.type=a),this)},fuzziness:function(a){return null==a?f.multi_match.fuzziness:(f.multi_match.fuzziness=a,this)},prefixLength:function(a){return null==a?f.multi_match.prefix_length:(f.multi_match.prefix_length=a,this)},maxExpansions:function(a){return null==a?f.multi_match.max_expansions:(f.multi_match.max_expansions=a,this)},operator:function(a){return null==a?f.multi_match.operator:(a=a.toLowerCase(),("and"===a||"or"===a)&&(f.multi_match.operator=a),this)},slop:function(a){return null==a?f.multi_match.slop:(f.multi_match.slop=a,this)},analyzer:function(a){return null==a?f.multi_match.analyzer:(f.multi_match.analyzer=a,this)},zeroTermsQuery:function(a){return null==a?f.multi_match.zero_terms_query:(a=a.toLowerCase(),("all"===a||"none"===a)&&(f.multi_match.zero_terms_query=a),this)}})},z.NestedQuery=function(a){var b=z.QueryMixin("nested"),d=b.toJSON();return d.nested.path=a,c(b,{path:function(a){return null==a?d.nested.path:(d.nested.path=a,this)},query:function(a){if(null==a)return d.nested.query;if(!l(a))throw new TypeError("Argument must be a Query");return d.nested.query=a.toJSON(),this},filter:function(a){if(null==a)return d.nested.filter;if(!n(a))throw new TypeError("Argument must be a Filter");return d.nested.filter=a.toJSON(),this},scoreMode:function(a){return null==a?d.nested.score_mode:(a=a.toLowerCase(),("avg"===a||"total"===a||"max"===a||"none"===a||"sum"===a)&&(d.nested.score_mode=a),this)},scope:function(){return this}})},z.PrefixQuery=function(a,b){var d=z.QueryMixin("prefix"),e=d.toJSON();return e.prefix[a]={value:b},c(d,{field:function(b){var c=e.prefix[a];return null==b?a:(delete e.prefix[a],a=b,e.prefix[b]=c,this)},value:function(b){return null==b?e.prefix[a].value:(e.prefix[a].value=b,this)},rewrite:function(b){return null==b?e.prefix[a].rewrite:(b=b.toLowerCase(),("constant_score_auto"===b||"scoring_boolean"===b||"constant_score_boolean"===b||"constant_score_filter"===b||0===b.indexOf("top_terms_boost_")||0===b.indexOf("top_terms_"))&&(e.prefix[a].rewrite=b),this)},boost:function(b){return null==b?e.prefix[a].boost:(e.prefix[a].boost=b,this)}})},z.QueryStringQuery=function(a){var b=z.QueryMixin("query_string"),d=b.toJSON();return d.query_string.query=a,c(b,{query:function(a){return null==a?d.query_string.query:(d.query_string.query=a,this)},defaultField:function(a){return null==a?d.query_string.default_field:(d.query_string.default_field=a,this)},fields:function(a){if(null==d.query_string.fields&&(d.query_string.fields=[]),null==a)return d.query_string.fields;if(g(a))d.query_string.fields.push(a);else{if(!e(a))throw new TypeError("Argument must be a string or array");d.query_string.fields=a}return this},useDisMax:function(a){return null==a?d.query_string.use_dis_max:(d.query_string.use_dis_max=a,this)},defaultOperator:function(a){return null==a?d.query_string.default_operator:(a=a.toUpperCase(),("AND"===a||"OR"===a)&&(d.query_string.default_operator=a),this)},analyzer:function(a){return null==a?d.query_string.analyzer:(d.query_string.analyzer=a,this)},quoteAnalyzer:function(a){return null==a?d.query_string.quote_analyzer:(d.query_string.quote_analyzer=a,this)},allowLeadingWildcard:function(a){return null==a?d.query_string.allow_leading_wildcard:(d.query_string.allow_leading_wildcard=a,this)},lowercaseExpandedTerms:function(a){return null==a?d.query_string.lowercase_expanded_terms:(d.query_string.lowercase_expanded_terms=a,this)},enablePositionIncrements:function(a){return null==a?d.query_string.enable_position_increments:(d.query_string.enable_position_increments=a,this)},fuzzyPrefixLength:function(a){return null==a?d.query_string.fuzzy_prefix_length:(d.query_string.fuzzy_prefix_length=a,this)},fuzzyMinSim:function(a){return null==a?d.query_string.fuzzy_min_sim:(d.query_string.fuzzy_min_sim=a,this)},phraseSlop:function(a){return null==a?d.query_string.phrase_slop:(d.query_string.phrase_slop=a,this)},analyzeWildcard:function(a){return null==a?d.query_string.analyze_wildcard:(d.query_string.analyze_wildcard=a,this)},autoGeneratePhraseQueries:function(a){return null==a?d.query_string.auto_generate_phrase_queries:(d.query_string.auto_generate_phrase_queries=a,this)},minimumShouldMatch:function(a){return null==a?d.query_string.minimum_should_match:(d.query_string.minimum_should_match=a,this)},tieBreaker:function(a){return null==a?d.query_string.tie_breaker:(d.query_string.tie_breaker=a,this)},escape:function(a){return null==a?d.query_string.escape:(d.query_string.escape=a,this)},fuzzyMaxExpansions:function(a){return null==a?d.query_string.fuzzy_max_expansions:(d.query_string.fuzzy_max_expansions=a,this)},fuzzyRewrite:function(a){return null==a?d.query_string.fuzzy_rewrite:(a=a.toLowerCase(),("constant_score_auto"===a||"scoring_boolean"===a||"constant_score_boolean"===a||"constant_score_filter"===a||0===a.indexOf("top_terms_boost_")||0===a.indexOf("top_terms_"))&&(d.query_string.fuzzy_rewrite=a),this)},rewrite:function(a){return null==a?d.query_string.rewrite:(a=a.toLowerCase(),("constant_score_auto"===a||"scoring_boolean"===a||"constant_score_boolean"===a||"constant_score_filter"===a||0===a.indexOf("top_terms_boost_")||0===a.indexOf("top_terms_"))&&(d.query_string.rewrite=a),this)},quoteFieldSuffix:function(a){return null==a?d.query_string.quote_field_suffix:(d.query_string.quote_field_suffix=a,this)},lenient:function(a){return null==a?d.query_string.lenient:(d.query_string.lenient=a,this)}})},z.RangeQuery=function(a){var b=z.QueryMixin("range"),d=b.toJSON();return d.range[a]={},c(b,{field:function(b){var c=d.range[a];return null==b?a:(delete d.range[a],a=b,d.range[b]=c,this)},from:function(b){return null==b?d.range[a].from:(d.range[a].from=b,this)},to:function(b){return null==b?d.range[a].to:(d.range[a].to=b,this)},includeLower:function(b){return null==b?d.range[a].include_lower:(d.range[a].include_lower=b,this)},includeUpper:function(b){return null==b?d.range[a].include_upper:(d.range[a].include_upper=b,this)},gt:function(b){return null==b?d.range[a].gt:(d.range[a].gt=b,this)},gte:function(b){return null==b?d.range[a].gte:(d.range[a].gte=b,this)},lt:function(b){return null==b?d.range[a].lt:(d.range[a].lt=b,this)},lte:function(b){return null==b?d.range[a].lte:(d.range[a].lte=b,this)},boost:function(b){return null==b?d.range[a].boost:(d.range[a].boost=b,this)}})},z.RegexpQuery=function(a,b){var d=z.QueryMixin("regexp"),e=d.toJSON();return e.regexp[a]={value:b},c(d,{field:function(b){var c=e.regexp[a];return null==b?a:(delete e.regexp[a],a=b,e.regexp[b]=c,this)},value:function(b){return null==b?e.regexp[a].value:(e.regexp[a].value=b,this)},flags:function(b){return null==b?e.regexp[a].flags:(e.regexp[a].flags=b,this)},flagsValue:function(b){return null==b?e.regexp[a].flags_value:(e.regexp[a].flags_value=b,this)},rewrite:function(b){return null==b?e.regexp[a].rewrite:(b=b.toLowerCase(),("constant_score_auto"===b||"scoring_boolean"===b||"constant_score_boolean"===b||"constant_score_filter"===b||0===b.indexOf("top_terms_boost_")||0===b.indexOf("top_terms_"))&&(e.regexp[a].rewrite=b),this)},boost:function(b){return null==b?e.regexp[a].boost:(e.regexp[a].boost=b,this)}})},z.SpanFirstQuery=function(a,b){if(!l(a))throw new TypeError("Argument must be a SpanQuery");var d=z.QueryMixin("span_first"),e=d.toJSON();return e.span_first.match=a.toJSON(),e.span_first.end=b,c(d,{match:function(a){if(null==a)return e.span_first.match;if(!l(a))throw new TypeError("Argument must be a SpanQuery");return e.span_first.match=a.toJSON(),this},end:function(a){return null==a?e.span_first.end:(e.span_first.end=a,this)}})},z.SpanMultiTermQuery=function(a){if(null!=a&&!l(a))throw new TypeError("Argument must be a MultiTermQuery");var b=z.QueryMixin("span_multi"),d=b.toJSON();return d.span_multi.match={},null!=a&&(d.span_multi.match=a.toJSON()),c(b,{match:function(a){if(null==a)return d.span_multi.match;if(!l(a))throw new TypeError("Argument must be a MultiTermQuery");return d.span_multi.match=a.toJSON(),this}})},z.SpanNearQuery=function(a,b){var d,f,g=z.QueryMixin("span_near"),h=g.toJSON();if(h.span_near.clauses=[],h.span_near.slop=b,l(a))h.span_near.clauses.push(a.toJSON());else{if(!e(a))throw new TypeError("Argument must be SpanQuery or array of SpanQueries");for(d=0,f=a.length;f>d;d++){if(!l(a[d]))throw new TypeError("Argument must be array of SpanQueries");h.span_near.clauses.push(a[d].toJSON())}}return c(g,{clauses:function(a){var b,c;if(null==a)return h.span_near.clauses;if(l(a))h.span_near.clauses.push(a.toJSON());else{if(!e(a))throw new TypeError("Argument must be SpanQuery or array of SpanQueries");for(h.span_near.clauses=[],b=0,c=a.length;c>b;b++){if(!l(a[b]))throw new TypeError("Argument must be array of SpanQueries");h.span_near.clauses.push(a[b].toJSON())}}return this},slop:function(a){return null==a?h.span_near.slop:(h.span_near.slop=a,this)},inOrder:function(a){return null==a?h.span_near.in_order:(h.span_near.in_order=a,this)},collectPayloads:function(a){return null==a?h.span_near.collect_payloads:(h.span_near.collect_payloads=a,this)}})},z.SpanNotQuery=function(a,b){if(!l(a)||!l(b))throw new TypeError("Argument must be a SpanQuery");var d=z.QueryMixin("span_not"),e=d.toJSON();return e.span_not.include=a.toJSON(),e.span_not.exclude=b.toJSON(),c(d,{include:function(a){if(null==a)return e.span_not.include;if(!l(a))throw new TypeError("Argument must be a SpanQuery");return e.span_not.include=a.toJSON(),this},exclude:function(a){if(null==a)return e.span_not.exclude;if(!l(a))throw new TypeError("Argument must be a SpanQuery");return e.span_not.exclude=a.toJSON(),this}})},z.SpanOrQuery=function(a){var b,d,f=z.QueryMixin("span_or"),g=f.toJSON();if(g.span_or.clauses=[],l(a))g.span_or.clauses.push(a.toJSON());else{if(!e(a))throw new TypeError("Argument must be SpanQuery or array of SpanQueries");for(b=0,d=a.length;d>b;b++){if(!l(a[b]))throw new TypeError("Argument must be array of SpanQueries");g.span_or.clauses.push(a[b].toJSON())}}return c(f,{clauses:function(a){var b,c;if(null==a)return g.span_or.clauses;if(l(a))g.span_or.clauses.push(a.toJSON());else{if(!e(a))throw new TypeError("Argument must be SpanQuery or array of SpanQueries");for(g.span_or.clauses=[],b=0,c=a.length;c>b;b++){if(!l(a[b]))throw new TypeError("Argument must be array of SpanQueries");g.span_or.clauses.push(a[b].toJSON())}}return this}})},z.SpanTermQuery=function(a,b){var d=z.QueryMixin("span_term"),e=d.toJSON();return e.span_term[a]={term:b},c(d,{field:function(b){var c=e.span_term[a];return null==b?a:(delete e.span_term[a],a=b,e.span_term[b]=c,this)},term:function(b){return null==b?e.span_term[a].term:(e.span_term[a].term=b,this)},boost:function(b){return null==b?e.span_term[a].boost:(e.span_term[a].boost=b,this)}})},z.TermQuery=function(a,b){var d=z.QueryMixin("term"),e=d.toJSON();return e.term[a]={term:b},c(d,{field:function(b){var c=e.term[a];return null==b?a:(delete e.term[a],a=b,e.term[b]=c,this)},term:function(b){return null==b?e.term[a].term:(e.term[a].term=b,this)},boost:function(b){return null==b?e.term[a].boost:(e.term[a].boost=b,this)}})},z.TermsQuery=function(a,b){var d=z.QueryMixin("terms"),f=d.toJSON();if(g(b))f.terms[a]=[b];else{if(!e(b))throw new TypeError("Argument must be string or array");f.terms[a]=b}return c(d,{field:function(b){var c=f.terms[a];return null==b?a:(delete f.terms[a],a=b,f.terms[b]=c,this)},terms:function(b){if(null==b)return f.terms[a];if(g(b))f.terms[a].push(b);else{if(!e(b))throw new TypeError("Argument must be string or array");f.terms[a]=b}return this},minimumShouldMatch:function(a){return null==a?f.terms.minimum_should_match:(f.terms.minimum_should_match=a,this)},disableCoord:function(a){return null==a?f.terms.disable_coord:(f.terms.disable_coord=a,this)}})},z.TopChildrenQuery=function(a,b){if(!l(a))throw new TypeError("Argument must be a Query");var d=z.QueryMixin("top_children"),e=d.toJSON();return e.top_children.query=a.toJSON(),e.top_children.type=b,c(d,{query:function(a){if(null==a)return e.top_children.query;if(!l(a))throw new TypeError("Argument must be a Query");return e.top_children.query=a.toJSON(),this},type:function(a){return null==a?e.top_children.type:(e.top_children.type=a,this)},scope:function(){return this},score:function(a){return null==a?e.top_children.score:(a=a.toLowerCase(),("max"===a||"sum"===a||"avg"===a||"total"===a)&&(e.top_children.score=a),this)},scoreMode:function(a){return null==a?e.top_children.score_mode:(a=a.toLowerCase(),("max"===a||"sum"===a||"avg"===a||"total"===a)&&(e.top_children.score_mode=a),this)},factor:function(a){return null==a?e.top_children.factor:(e.top_children.factor=a,this)},incrementalFactor:function(a){return null==a?e.top_children.incremental_factor:(e.top_children.incremental_factor=a,this)}})},z.WildcardQuery=function(a,b){var d=z.QueryMixin("wildcard"),e=d.toJSON();return e.wildcard[a]={value:b},c(d,{field:function(b){var c=e.wildcard[a];return null==b?a:(delete e.wildcard[a],a=b,e.wildcard[b]=c,this)},value:function(b){return null==b?e.wildcard[a].value:(e.wildcard[a].value=b,this)},rewrite:function(b){return null==b?e.wildcard[a].rewrite:(b=b.toLowerCase(),("constant_score_auto"===b||"scoring_boolean"===b||"constant_score_boolean"===b||"constant_score_filter"===b||0===b.indexOf("top_terms_boost_")||0===b.indexOf("top_terms_"))&&(e.wildcard[a].rewrite=b),this)},boost:function(b){return null==b?e.wildcard[a].boost:(e.wildcard[a].boost=b,this)}})},z.BoostFactorScoreFunction=function(a){var b=z.ScoreFunctionMixin("boost_factor"),d=b.toJSON();return d.boost_factor=a,c(b,{boost:function(a){return null==a?d.boost_factor:(d.boost_factor=a,this)}})},z.DecayScoreFunction=function(a){var b="gauss",d=z.ScoreFunctionMixin(b),e=d.toJSON(),f=function(a){var c;b!==a&&(c=e[b],delete e[b],b=a,e[b]=c)};return e[b][a]={},c(d,{linear:function(){f("linear")},exp:function(){f("exp")},gauss:function(){f("gauss")},field:function(c){var d=e[b][a];return null==c?a:(delete e[b][a],a=c,e[b][a]=d,this)},scale:function(c){return null==c?e[b][a].scale:(e[b][a].scale=c,this)},origin:function(c){if(null==c)return e[b][a].origin;if(r(c))e[b][a].origin=c.toJSON();else{if(k(c))throw new TypeError("origin must be a GeoPoint or native type");e[b][a].origin=c}return this},decay:function(c){return null==c?e[b][a].decay:(e[b][a].decay=c,this)},offset:function(c){return null==c?e[b][a].offset:(e[b][a].offset=c,this)}})},z.RandomScoreFunction=function(){var a=z.ScoreFunctionMixin("random_score"),b=a.toJSON();return c(a,{seed:function(a){return null==a?b.random_score.seed:(b.random_score.seed=a,this)}})},z.ScriptScoreFunction=function(){var a=z.ScoreFunctionMixin("script_score"),b=a.toJSON();return c(a,{script:function(a){return null==a?b.script_score.script:(b.script_score.script=a,this)},lang:function(a){return null==a?b.script_score.lang:(b.script_score.lang=a,this)},params:function(a){return null==a?b.script_score.params:(b.script_score.params=a,this)}})},z.GeoPoint=function(b){var c=[0,0];return null!=b&&e(b)&&2===b.length&&(c=[b[1],b[0]]),{properties:function(b){return null==b?c:(f(b)&&a(b,"lat")&&a(b,"lon")?c={lat:b.lat,lon:b.lon}:f(b)&&a(b,"geohash")&&(c={geohash:b.geohash}),this)},string:function(a){return null==a?c:(g(a)&&-1!==a.indexOf(",")&&(c=a),this)},geohash:function(a,b){return b=null!=b&&h(b)?b:12,null==a?c:(g(a)&&a.length===b&&(c=a),this)},array:function(a){return null==a?c:(e(a)&&2===a.length&&(c=[a[1],a[0]]),this)},_type:function(){return"geo point"},toJSON:function(){return c}}},z.Highlight=function(c){var d={fields:{}},h=function(b,c,e){null==b?d[c]=e:(a(d.fields,b)||(d.fields[b]={}),d.fields[b][c]=e)};return null!=c&&(g(c)?d.fields[c]={}:e(c)&&b(c,function(a){d.fields[a]={}})),{fields:function(c){return null==c?d.fields:void(g(c)?a(d.fields,c)||(d.fields[c]={}):e(c)&&b(c,function(b){a(d.fields,b)||(d.fields[b]={})}))},preTags:function(a,b){return null===a&&null!=b?d.fields[b].pre_tags:null==a?d.pre_tags:(g(a)?h(b,"pre_tags",[a]):e(a)&&h(b,"pre_tags",a),this)},postTags:function(a,b){return null===a&&null!=b?d.fields[b].post_tags:null==a?d.post_tags:(g(a)?h(b,"post_tags",[a]):e(a)&&h(b,"post_tags",a),this)},order:function(a,b){return null===a&&null!=b?d.fields[b].order:null==a?d.order:(a=a.toLowerCase(),"score"===a&&h(b,"order",a),this)},tagsSchema:function(a){return null==a?d.tags_schema:(a=a.toLowerCase(),"styled"===a&&(d.tags_schema=a),this)},highlightFilter:function(a,b){return null===a&&null!=b?d.fields[b].highlight_filter:null==a?d.highlight_filter:(h(b,"highlight_filter",a),this)},fragmentSize:function(a,b){return null===a&&null!=b?d.fields[b].fragment_size:null==a?d.fragment_size:(h(b,"fragment_size",a),this)},numberOfFragments:function(a,b){return null===a&&null!=b?d.fields[b].number_of_fragments:null==a?d.number_of_fragments:(h(b,"number_of_fragments",a),this)},encoder:function(a){return null==a?d.encoder:(a=a.toLowerCase(),("default"===a||"html"===a)&&(d.encoder=a),this)},requireFieldMatch:function(a,b){return null===a&&null!=b?d.fields[b].require_field_match:null==a?d.require_field_match:(h(b,"require_field_match",a),this)},boundaryMaxScan:function(a,b){return null===a&&null!=b?d.fields[b].boundary_max_scan:null==a?d.boundary_max_scan:(h(b,"boundary_max_scan",a),this)},boundaryChars:function(a,b){return null===a&&null!=b?d.fields[b].boundary_chars:null==a?d.boundary_chars:(h(b,"boundary_chars",a),this)},type:function(a,b){return null===a&&null!=b?d.fields[b].type:null==a?d.type:(a=a.toLowerCase(),("fvh"===a||"plain"===a||"postings"===a)&&h(b,"type",a),this)},fragmenter:function(a,b){return null===a&&null!=b?d.fields[b].fragmenter:null==a?d.fragmenter:(a=a.toLowerCase(),("simple"===a||"span"===a)&&h(b,"fragmenter",a),this)},options:function(a,b){if(null===a&&null!=b)return d.fields[b].options;if(null==a)return d.options;if(!f(a)||e(a)||k(a))throw new TypeError("Parameter must be an object");return h(b,"options",a),this},_type:function(){return"highlight"},toJSON:function(){return d}}},z.IndexedShape=function(a,b){var c={type:a,id:b};return{type:function(a){return null==a?c.type:(c.type=a,this)},id:function(a){return null==a?c.id:(c.id=a,this)},index:function(a){return null==a?c.index:(c.index=a,this)},shapeFieldName:function(a){return null==a?c.shape_field_name:(c.shape_field_name=a,this)},_type:function(){return"indexed shape"},toJSON:function(){return c}}},z.Request=function(){var b={};return{sort:function(){var c,d;if(a(b,"sort")||(b.sort=[]),0===arguments.length)return b.sort;if(1===arguments.length){var f=arguments[0];if(g(f))b.sort.push(f);else if(u(f))b.sort.push(f.toJSON());else{if(!e(f))throw new TypeError("Argument must be string, Sort, or array");for(b.sort=[],c=0,d=f.length;d>c;c++)if(g(f[c]))b.sort.push(f[c]);else{if(!u(f[c]))throw new TypeError("Invalid object in array");b.sort.push(f[c].toJSON())}}}else if(2===arguments.length){var h=arguments[0],i=arguments[1];if(g(h)&&g(i)&&(i=i.toLowerCase(),"asc"===i||"desc"===i)){var j={};j[h]={order:i},b.sort.push(j)}}return this},trackScores:function(a){return null==a?b.track_scores:(b.track_scores=a,this)},from:function(a){return null==a?b.from:(b.from=a,this)},size:function(a){return null==a?b.size:(b.size=a,this)},timeout:function(a){return null==a?b.timeout:(b.timeout=a,this)},fields:function(a){if(null==a)return b.fields;if(null==b.fields&&(b.fields=[]),g(a))b.fields.push(a);else{if(!e(a))throw new TypeError("Argument must be a string or an array");b.fields=a}return this},source:function(a,c){if(null==a&&null==c)return b._source;if(!e(a)&&!g(a)&&!i(a))throw new TypeError("Argument includes must be a string, an array, or a boolean");if(null!=c&&!e(c)&&!g(c))throw new TypeError("Argument excludes must be a string or an array");return i(a)?b._source=a:(b._source={includes:a},null!=c&&(b._source.excludes=c)),this},rescore:function(a){if(null==a)return b.rescore;if(!m(a))throw new TypeError("Argument must be a Rescore");return b.rescore=a.toJSON(),this},query:function(a){if(null==a)return b.query;if(!l(a))throw new TypeError("Argument must be a Query");return b.query=a.toJSON(),this},facet:function(a){if(null==a)return b.facets;if(null==b.facets&&(b.facets={}),!o(a))throw new TypeError("Argument must be a Facet");return c(b.facets,a.toJSON()),this},aggregation:function(a){if(null==a)return b.aggs;if(null==b.aggs&&(b.aggs={}),!p(a))throw new TypeError("Argument must be an Aggregation");return c(b.aggs,a.toJSON()),this},agg:function(a){return this.aggregation(a)},filter:function(a){if(null==a)return b.filter;if(!n(a))throw new TypeError("Argument must be a Filter");return b.filter=a.toJSON(),this},highlight:function(a){if(null==a)return b.highlight;if(!v(a))throw new TypeError("Argument must be a Highlight object");return b.highlight=a.toJSON(),this},suggest:function(a){if(null==a)return b.suggest;if(null==b.suggest&&(b.suggest={}),g(a))b.suggest.text=a;else{if(!w(a))throw new TypeError("Argument must be a string or Suggest object");c(b.suggest,a.toJSON())}return this},scriptField:function(a){if(null==a)return b.script_fields;if(null==b.script_fields&&(b.script_fields={}),!q(a))throw new TypeError("Argument must be a ScriptField");return c(b.script_fields,a.toJSON()),this},indexBoost:function(a,c){return null==b.indices_boost&&(b.indices_boost={}),0===arguments.length?b.indices_boost:(b.indices_boost[a]=c,this)},explain:function(a){return null==a?b.explain:(b.explain=a,this)},version:function(a){return null==a?b.version:(b.version=a,this)},minScore:function(a){return null==a?b.min_score:(b.min_score=a,this)},_type:function(){return"request"},toJSON:function(){return b}}},z.Rescore=function(a,b){if(null!=a&&!h(a))throw new TypeError("Argument must be a Number");if(null!=b&&!l(b))throw new TypeError("Argument must be a Query");var c={query:{}};return null!=a&&(c.window_size=a),null!=b&&(c.query.rescore_query=b.toJSON()),{rescoreQuery:function(a){if(null==a)return c.query.rescore_query;if(!l(a))throw new TypeError("Argument must be a Query");return c.query.rescore_query=a.toJSON(),this},queryWeight:function(a){if(null==a)return c.query.query_weight;if(!h(a))throw new TypeError("Argument must be a Number");return c.query.query_weight=a,this},rescoreQueryWeight:function(a){if(null==a)return c.query.rescore_query_weight;if(!h(a))throw new TypeError("Argument must be a Number");return c.query.rescore_query_weight=a,this},windowSize:function(a){if(null==a)return c.window_size;if(!h(a))throw new TypeError("Argument must be a Number");return c.window_size=a,this},scoreMode:function(a){return null==a?c.query.score_mode:(a=a.toLowerCase(),("total"===a||"min"===a||"max"===a||"multiply"===a||"avg"===a)&&(c.query.score_mode=a),this)},_type:function(){return"rescore"},toJSON:function(){return c}}},z.ScriptField=function(a){var b={};return b[a]={},{lang:function(c){return null==c?b[a].lang:(b[a].lang=c,this)},script:function(c){return null==c?b[a].script:(b[a].script=c,this)},params:function(c){return null==c?b[a].params:(b[a].params=c,this)},ignoreFailure:function(c){return null==c?b[a].ignore_failure:(b[a].ignore_failure=c,this)},_type:function(){return"script field"},toJSON:function(){return b}}},z.Shape=function(a,b){var c={},d=function(a){var b=!1;return("point"===a||"linestring"===a||"polygon"===a||"multipoint"===a||"envelope"===a||"multipolygon"===a||"circle"===a||"multilinestring"===a)&&(b=!0),b};return a=a.toLowerCase(),d(a)&&(c.type=a,c.coordinates=b),{type:function(a){return null==a?c.type:(a=a.toLowerCase(),d(a)&&(c.type=a),this)},coordinates:function(a){return null==a?c.coordinates:(c.coordinates=a,this)},radius:function(a){return null==a?c.radius:(c.radius=a,this)},_type:function(){return"shape"},toJSON:function(){return c}}},z.Sort=function(a){null==a&&(a="_score");var b={},c=a,d="_geo_distance",e="_script";return b[c]={},{field:function(d){var e=b[c];return null==d?a:(delete b[c],a=d,c=d,b[c]=e,this)},geoDistance:function(e){var f=b[c];if(null==e)return b[c][a];if(!r(e))throw new TypeError("Argument must be a GeoPoint");return delete b[c],c=d,b[c]=f,b[c][a]=e.toJSON(),this},script:function(a){var d=b[c];return null==a?b[c].script:(delete b[c],c=e,b[c]=d,b[c].script=a,this)},order:function(a){return null==a?b[c].order:(a=a.toLowerCase(),("asc"===a||"desc"===a)&&(b[c].order=a),this)},asc:function(){return b[c].order="asc",this},desc:function(){return b[c].order="desc",this},reverse:function(a){return null==a?b[c].reverse:(b[c].reverse=a,this)},missing:function(a){return null==a?b[c].missing:(b[c].missing=a,this)},ignoreUnmapped:function(a){return null==a?b[c].ignore_unmapped:(b[c].ignore_unmapped=a,this)},unit:function(a){return null==a?b[c].unit:(a=a.toLowerCase(),("mi"===a||"km"===a)&&(b[c].unit=a),this)},normalize:function(a){return null==a?b[c].normalize:(b[c].normalize=a,this)},distanceType:function(a){return null==a?b[c].distance_type:(a=a.toLowerCase(),("arc"===a||"plane"===a)&&(b[c].distance_type=a),this)},params:function(a){return null==a?b[c].params:(b[c].params=a,this)},lang:function(a){return null==a?b[c].lang:(b[c].lang=a,this) -},type:function(a){return null==a?b[c].type:(a=a.toLowerCase(),("string"===a||"number"===a)&&(b[c].type=a),this)},mode:function(a){return null==a?b[c].mode:(a=a.toLowerCase(),("min"===a||"max"===a||"sum"===a||"avg"===a)&&(b[c].mode=a),this)},nestedPath:function(a){return null==a?b[c].nested_path:(b[c].nested_path=a,this)},nestedFilter:function(a){if(null==a)return b[c].nested_filter;if(!n(a))throw new TypeError("Argument must be a Filter");return b[c].nested_filter=a.toJSON(),this},_type:function(){return"sort"},toJSON:function(){return b}}},z.CompletionSuggester=function(a){var b,d=z.SuggesterMixin(a),e=d.toJSON();return e[a].completion={},b=z.SuggestContextMixin(e[a].completion),c(d,b,{fuzzy:function(b){return null==b?e[a].completion.fuzzy:(b&&null==e[a].completion.fuzzy?e[a].completion.fuzzy={}:b||null==e[a].completion.fuzzy||delete e[a].completion.fuzzy,this)},transpositions:function(b){return null==e[a].completion.fuzzy&&(e[a].completion.fuzzy={}),null==b?e[a].completion.fuzzy.transpositions:(e[a].completion.fuzzy.transpositions=b,this)},unicodeAware:function(b){return null==e[a].completion.fuzzy&&(e[a].completion.fuzzy={}),null==b?e[a].completion.fuzzy.unicode_aware:(e[a].completion.fuzzy.unicode_aware=b,this)},editDistance:function(b){return null==e[a].completion.fuzzy&&(e[a].completion.fuzzy={}),null==b?e[a].completion.fuzzy.edit_distance:(e[a].completion.fuzzy.edit_distance=b,this)},minLength:function(b){return null==e[a].completion.fuzzy&&(e[a].completion.fuzzy={}),null==b?e[a].completion.fuzzy.min_length:(e[a].completion.fuzzy.min_length=b,this)},prefixLength:function(b){return null==e[a].completion.fuzzy&&(e[a].completion.fuzzy={}),null==b?e[a].completion.fuzzy.prefix_length:(e[a].completion.fuzzy.prefix_length=b,this)}})},z.DirectGenerator=function(){var a={},b=z.DirectSettingsMixin(a);return c(b,{preFilter:function(b){return null==b?a.pre_filter:(a.pre_filter=b,this)},postFilter:function(b){return null==b?a.post_filter:(a.post_filter=b,this)},field:function(b){return null==b?a.field:(a.field=b,this)},size:function(b){return null==b?a.size:(a.size=b,this)},_type:function(){return"generator"},toJSON:function(){return a}})},z.PhraseSuggester=function(a){var b,d=z.SuggesterMixin(a),f=d.toJSON();return f[a].phrase={},b=z.SuggestContextMixin(f[a].phrase),c(d,b,{realWordErrorLikelihood:function(b){return null==b?f[a].phrase.real_word_error_likelihood:(f[a].phrase.real_word_error_likelihood=b,this)},confidence:function(b){return null==b?f[a].phrase.confidence:(f[a].phrase.confidence=b,this)},separator:function(b){return null==b?f[a].phrase.separator:(f[a].phrase.separator=b,this)},maxErrors:function(b){return null==b?f[a].phrase.max_errors:(f[a].phrase.max_errors=b,this)},gramSize:function(b){return null==b?f[a].phrase.gram_size:(f[a].phrase.gram_size=b,this)},forceUnigrams:function(b){return null==b?f[a].phrase.force_unigrams:(f[a].phrase.force_unigrams=b,this)},tokenLimit:function(b){return null==b?f[a].phrase.token_limit:(f[a].phrase.token_limit=b,this)},linearSmoothing:function(b,c,d){return 0===arguments.length?f[a].phrase.smoothing:(f[a].phrase.smoothing={linear:{trigram_lambda:b,bigram_lambda:c,unigram_lambda:d}},this)},laplaceSmoothing:function(b){return null==b?f[a].phrase.smoothing:(f[a].phrase.smoothing={laplace:{alpha:b}},this)},stupidBackoffSmoothing:function(b){return null==b?f[a].phrase.smoothing:(f[a].phrase.smoothing={stupid_backoff:{discount:b}},this)},highlight:function(b,c){return 0===arguments.length?f[a].phrase.highlight:(f[a].phrase.highlight={pre_tag:b,post_tag:c},this)},directGenerator:function(b){var c,d;if(null==f[a].phrase.direct_generator&&(f[a].phrase.direct_generator=[]),null==b)return f[a].phrase.direct_generator;if(x(b))f[a].phrase.direct_generator.push(b.toJSON());else{if(!e(b))throw new TypeError("Argument must be a Generator or array of Generators");for(f[a].phrase.direct_generator=[],c=0,d=b.length;d>c;c++){if(!x(b[c]))throw new TypeError("Argument must be an array of Generators");f[a].phrase.direct_generator.push(b[c].toJSON())}}return this}})},z.TermSuggester=function(a){var b,d,e=z.SuggesterMixin(a),f=e.toJSON();return f[a].term={},b=z.DirectSettingsMixin(f[a].term),d=z.SuggestContextMixin(f[a].term),c(e,b,d)},z.noConflict=function(){return A.ejs=B,this}}).call(this); \ No newline at end of file +(function(){"use strict";var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C=this,D=C&&C.ejs,E=Array.prototype,F=Object.prototype,G=E.slice,H=F.toString,I=F.hasOwnProperty,J=E.forEach,K=Array.isArray,L=E.indexOf,M={};B="undefined"!=typeof exports?exports:C.ejs={},a=function(a,b){return I.call(a,b)},b=function(b,c,d){if(null!=b)if(J&&b.forEach===J)b.forEach(c,d);else if(b.length===+b.length){for(var e=0,f=b.length;f>e;e++)if(c.call(d,b[e],e,b)===M)return}else for(var g in b)if(a(b,g)&&c.call(d,b[g],g,b)===M)return},c=function(a){return b(G.call(arguments,1),function(b){for(var c in b)a[c]=b[c]}),a},d=function(a,b){if(null==a)return-1;var c=0,d=a.length;if(L&&a.indexOf===L)return a.indexOf(b);for(;d>c;c++)if(a[c]===b)return c;return-1},e=K||function(a){return"[object Array]"===H.call(a)},f=function(a){return a===Object(a)},g=function(a){return"[object String]"===H.call(a)},h=function(a){return"[object Number]"===H.call(a)},i=function(a){return a===!0||a===!1||"[object Boolean]"===H.call(a)},j="function"!=typeof/./?function(a){return"function"==typeof a}:function(a){return"[object Function]"===H.call(a)},k=function(b){return f(b)&&a(b,"_type")&&a(b,"toJSON")},l=function(a){return k(a)&&"query"===a._type()},m=function(a){return k(a)&&"rescore"===a._type()},n=function(a){return k(a)&&"filter"===a._type()},o=function(a){return k(a)&&"facet"===a._type()},p=function(a){return k(a)&&"aggregation"===a._type()},r=function(a){return k(a)&&"script field"===a._type()},q=function(a){return k(a)&&"partial field"===a._type()},s=function(a){return k(a)&&"geo point"===a._type()},t=function(a){return k(a)&&"indexed shape"===a._type()},u=function(a){return k(a)&&"shape"===a._type()},v=function(a){return k(a)&&"sort"===a._type()},w=function(a){return k(a)&&"highlight"===a._type()},x=function(a){return k(a)&&"suggest"===a._type()},y=function(a){return k(a)&&"generator"===a._type()},z=function(a){return k(a)&&"score function"===a._type()},A=function(a){return k(a)&&"inner hits"===a._type()},B.AggregationMixin=function(a){var b={};return b[a]={},{aggregation:function(d){if(null==d)return b[a].aggs;if(null==b[a].aggs&&(b[a].aggs={}),!p(d))throw new TypeError("Argument must be an Aggregation");return c(b[a].aggs,d.toJSON()),this},agg:function(a){return this.aggregation(a)},_type:function(){return"aggregation"},toJSON:function(){return b}}},B.BucketsAggregationMixin=function(a,b){var d=B.AggregationMixin(a),e=d.toJSON();return e[a][b]={},c(d,{field:function(c){return null==c?e[a][b].field:(e[a][b].field=c,this)},script:function(c){return null==c?e[a][b].script:(e[a][b].script=c,this)},scriptId:function(c){return null==c?e[a][b].script_id:(e[a][b].script_id=c,this)},scriptFile:function(c){return null==c?e[a][b].script_file:(e[a][b].script_file=c,this)},lang:function(c){return null==c?e[a][b].lang:(e[a][b].lang=c,this)},params:function(c){return null==c?e[a][b].params:(e[a][b].params=c,this)}})},B.DirectSettingsMixin=function(a){return{accuracy:function(b){return null==b?a.accuracy:(a.accuracy=b,this)},suggestMode:function(b){return null==b?a.suggest_mode:(b=b.toLowerCase(),("missing"===b||"popular"===b||"always"===b)&&(a.suggest_mode=b),this)},sort:function(b){return null==b?a.sort:(b=b.toLowerCase(),("score"===b||"frequency"===b)&&(a.sort=b),this)},stringDistance:function(b){return null==b?a.string_distance:(b=b.toLowerCase(),("internal"===b||"damerau_levenshtein"===b||"levenstein"===b||"jarowinkler"===b||"ngram"===b)&&(a.string_distance=b),this)},maxEdits:function(b){return null==b?a.max_edits:(a.max_edits=b,this)},maxInspections:function(b){return null==b?a.max_inspections:(a.max_inspections=b,this)},maxTermFreq:function(b){return null==b?a.max_term_freq:(a.max_term_freq=b,this)},prefixLen:function(b){return null==b?a.prefix_len:(a.prefix_len=b,this)},minWordLen:function(b){return null==b?a.min_word_len:(a.min_word_len=b,this)},minDocFreq:function(b){return null==b?a.min_doc_freq:(a.min_doc_freq=b,this)}}},B.FacetMixin=function(a){var b={};return b[a]={},{facetFilter:function(c){if(null==c)return b[a].facet_filter;if(!n(c))throw new TypeError("Argument must be a Filter");return b[a].facet_filter=c.toJSON(),this},global:function(c){return null==c?b[a].global:(b[a].global=c,this)},mode:function(c){return null==c?b[a].mode:(c=c.toLowerCase(),("collector"===c||"post"===c)&&(b[a].mode=c),this)},cacheFilter:function(c){return null==c?b[a].cache_filter:(b[a].cache_filter=c,this)},scope:function(a){return this},nested:function(c){return null==c?b[a].nested:(b[a].nested=c,this)},_type:function(){return"facet"},toJSON:function(){return b}}},B.FilterMixin=function(a){var b={};return b[a]={},{name:function(c){return null==c?b[a]._name:(b[a]._name=c,this)},cache:function(c){return null==c?b[a]._cache:(b[a]._cache=c,this)},cacheKey:function(c){return null==c?b[a]._cache_key:(b[a]._cache_key=c,this)},_type:function(){return"filter"},toJSON:function(){return b}}},B.MetricsAggregationMixin=function(a,b){var d=B.AggregationMixin(a),e=d.toJSON();return delete d.aggregation,delete d.agg,e[a][b]={},c(d,{field:function(c){return null==c?e[a][b].field:(e[a][b].field=c,this)},script:function(c){return null==c?e[a][b].script:(e[a][b].script=c,this)},scriptId:function(c){return null==c?e[a][b].script_id:(e[a][b].script_id=c,this)},scriptFile:function(c){return null==c?e[a][b].script_file:(e[a][b].script_file=c,this)},lang:function(c){return null==c?e[a][b].lang:(e[a][b].lang=c,this)},params:function(c){return null==c?e[a][b].params:(e[a][b].params=c,this)}})},B.QueryMixin=function(a){var b={};return b[a]={},{boost:function(c){return null==c?b[a].boost:(b[a].boost=c,this)},_type:function(){return"query"},toJSON:function(){return b}}},B.ScoreFunctionMixin=function(a){var b={};return null!=a&&(b[a]={}),{filter:function(a){if(null==a)return b.filter;if(!n(a))throw new TypeError("Argument must be a Filter");return b.filter=a.toJSON(),this},weight:function(a){if(null==a)return b.weight;if(!h(a))throw new TypeError("Argument must be a Number");return b.weight=a,this},_type:function(){return"score function"},toJSON:function(){return b}}},B.SuggestContextMixin=function(a){return{analyzer:function(b){return null==b?a.analyzer:(a.analyzer=b,this)},field:function(b){return null==b?a.field:(a.field=b,this)},size:function(b){return null==b?a.size:(a.size=b,this)},shardSize:function(b){return null==b?a.shard_size:(a.shard_size=b,this)}}},B.SuggesterMixin=function(a){var b={};return b[a]={},{text:function(c){return null==c?b[a].text:(b[a].text=c,this)},_type:function(){return"suggest"},toJSON:function(){return b}}},B.DateHistogramFacet=function(a){var b=B.FacetMixin(a),d=b.toJSON();return d[a].date_histogram={},c(b,{field:function(b){return null==b?d[a].date_histogram.field:(d[a].date_histogram.field=b,this)},keyField:function(b){return null==b?d[a].date_histogram.key_field:(d[a].date_histogram.key_field=b,this)},valueField:function(b){return null==b?d[a].date_histogram.value_field:(d[a].date_histogram.value_field=b,this)},interval:function(b){return null==b?d[a].date_histogram.interval:(d[a].date_histogram.interval=b,this)},timeZone:function(b){return null==b?d[a].date_histogram.time_zone:(d[a].date_histogram.time_zone=b,this)},preZone:function(b){return null==b?d[a].date_histogram.pre_zone:(d[a].date_histogram.pre_zone=b,this)},preZoneAdjustLargeInterval:function(b){return null==b?d[a].date_histogram.pre_zone_adjust_large_interval:(d[a].date_histogram.pre_zone_adjust_large_interval=b,this)},postZone:function(b){return null==b?d[a].date_histogram.post_zone:(d[a].date_histogram.post_zone=b,this)},preOffset:function(b){return null==b?d[a].date_histogram.pre_offset:(d[a].date_histogram.pre_offset=b,this)},postOffset:function(b){return null==b?d[a].date_histogram.post_offset:(d[a].date_histogram.post_offset=b,this)},factor:function(b){return null==b?d[a].date_histogram.factor:(d[a].date_histogram.factor=b,this)},valueScript:function(b){return null==b?d[a].date_histogram.value_script:(d[a].date_histogram.value_script=b,this)},order:function(b){return null==b?d[a].date_histogram.order:(b=b.toLowerCase(),("time"===b||"count"===b||"total"===b)&&(d[a].date_histogram.order=b),this)},lang:function(b){return null==b?d[a].date_histogram.lang:(d[a].date_histogram.lang=b,this)},params:function(b){return null==b?d[a].date_histogram.params:(d[a].date_histogram.params=b,this)}})},B.FilterFacet=function(a){var b=B.FacetMixin(a),d=b.toJSON();return c(b,{filter:function(b){if(null==b)return d[a].filter;if(!n(b))throw new TypeError("Argument must be a Filter");return d[a].filter=b.toJSON(),this}})},B.GeoDistanceFacet=function(a){var b=B.FacetMixin(a),d=b.toJSON(),e=B.GeoPoint([0,0]),f="location";return d[a].geo_distance={location:e.toJSON(),ranges:[]},c(b,{field:function(b){var c=d[a].geo_distance[f];return null==b?f:(delete d[a].geo_distance[f],f=b,d[a].geo_distance[b]=c,this)},point:function(b){if(null==b)return e;if(!s(b))throw new TypeError("Argument must be a GeoPoint");return e=b,d[a].geo_distance[f]=b.toJSON(),this},addRange:function(b,c){return 0===arguments.length?d[a].geo_distance.ranges:(d[a].geo_distance.ranges.push({from:b,to:c}),this)},addUnboundedFrom:function(b){return null==b?d[a].geo_distance.ranges:(d[a].geo_distance.ranges.push({from:b}),this)},addUnboundedTo:function(b){return null==b?d[a].geo_distance.ranges:(d[a].geo_distance.ranges.push({to:b}),this)},unit:function(b){return null==b?d[a].geo_distance.unit:(b=b.toLowerCase(),("mi"===b||"km"===b)&&(d[a].geo_distance.unit=b),this)},distanceType:function(b){return null==b?d[a].geo_distance.distance_type:(b=b.toLowerCase(),("arc"===b||"plane"===b)&&(d[a].geo_distance.distance_type=b),this)},normalize:function(b){return null==b?d[a].geo_distance.normalize:(d[a].geo_distance.normalize=b,this)},valueField:function(b){return null==b?d[a].geo_distance.value_field:(d[a].geo_distance.value_field=b,this)},valueScript:function(b){return null==b?d[a].geo_distance.value_script:(d[a].geo_distance.value_script=b,this)},lang:function(b){return null==b?d[a].geo_distance.lang:(d[a].geo_distance.lang=b,this)},params:function(b){return null==b?d[a].geo_distance.params:(d[a].geo_distance.params=b,this)}})},B.HistogramFacet=function(a){var b=B.FacetMixin(a),d=b.toJSON();return d[a].histogram={},c(b,{field:function(b){return null==b?d[a].histogram.field:(d[a].histogram.field=b,this)},interval:function(b){return null==b?d[a].histogram.interval:(d[a].histogram.interval=b,this)},timeInterval:function(b){return null==b?d[a].histogram.time_interval:(d[a].histogram.time_interval=b,this)},from:function(b){return null==b?d[a].histogram.from:(d[a].histogram.from=b,this)},to:function(b){return null==b?d[a].histogram.to:(d[a].histogram.to=b,this)},valueField:function(b){return null==b?d[a].histogram.value_field:(d[a].histogram.value_field=b,this)},keyField:function(b){return null==b?d[a].histogram.key_field:(d[a].histogram.key_field=b,this)},valueScript:function(b){return null==b?d[a].histogram.value_script:(d[a].histogram.value_script=b,this)},keyScript:function(b){return null==b?d[a].histogram.key_script:(d[a].histogram.key_script=b,this)},lang:function(b){return null==b?d[a].histogram.lang:(d[a].histogram.lang=b,this)},params:function(b){return null==b?d[a].histogram.params:(d[a].histogram.params=b,this)},order:function(b){return null==b?d[a].histogram.order:(b=b.toLowerCase(),("key"===b||"count"===b||"total"===b)&&(d[a].histogram.order=b),this)}})},B.QueryFacet=function(a){var b=B.FacetMixin(a),d=b.toJSON();return c(b,{query:function(b){if(null==b)return d[a].query;if(!l(b))throw new TypeError("Argument must be a Query");return d[a].query=b.toJSON(),this}})},B.RangeFacet=function(a){var b=B.FacetMixin(a),d=b.toJSON();return d[a].range={ranges:[]},c(b,{field:function(b){return null==b?d[a].range.field:(d[a].range.field=b,this)},keyField:function(b){return null==b?d[a].range.key_field:(d[a].range.key_field=b,this)},valueField:function(b){return null==b?d[a].range.value_field:(d[a].range.value_field=b,this)},valueScript:function(b){return null==b?d[a].range.value_script:(d[a].range.value_script=b,this)},keyScript:function(b){return null==b?d[a].range.key_script:(d[a].range.key_script=b,this)},lang:function(b){return null==b?d[a].range.lang:(d[a].range.lang=b,this)},params:function(b){return null==b?d[a].range.params:(d[a].range.params=b,this)},addRange:function(b,c){return 0===arguments.length?d[a].range.ranges:(d[a].range.ranges.push({from:b,to:c}),this)},addUnboundedFrom:function(b){return null==b?d[a].range.ranges:(d[a].range.ranges.push({from:b}),this)},addUnboundedTo:function(b){return null==b?d[a].range.ranges:(d[a].range.ranges.push({to:b}),this)}})},B.StatisticalFacet=function(a){var b=B.FacetMixin(a),d=b.toJSON();return d[a].statistical={},c(b,{field:function(b){return null==b?d[a].statistical.field:(d[a].statistical.field=b,this)},fields:function(b){if(null==b)return d[a].statistical.fields;if(!e(b))throw new TypeError("Argument must be an array");return d[a].statistical.fields=b,this},script:function(b){return null==b?d[a].statistical.script:(d[a].statistical.script=b,this)},lang:function(b){return null==b?d[a].statistical.lang:(d[a].statistical.lang=b,this)},params:function(b){return null==b?d[a].statistical.params:(d[a].statistical.params=b,this)}})},B.TermStatsFacet=function(a){var b=B.FacetMixin(a),d=b.toJSON();return d[a].terms_stats={},c(b,{valueField:function(b){return null==b?d[a].terms_stats.value_field:(d[a].terms_stats.value_field=b,this)},keyField:function(b){return null==b?d[a].terms_stats.key_field:(d[a].terms_stats.key_field=b,this)},scriptField:function(b){return null==b?d[a].terms_stats.script_field:(d[a].terms_stats.script_field=b,this)},valueScript:function(b){return null==b?d[a].terms_stats.value_script:(d[a].terms_stats.value_script=b,this)},allTerms:function(b){return null==b?d[a].terms_stats.all_terms:(d[a].terms_stats.all_terms=b,this)},lang:function(b){return null==b?d[a].terms_stats.lang:(d[a].terms_stats.lang=b,this)},params:function(b){return null==b?d[a].terms_stats.params:(d[a].terms_stats.params=b,this)},size:function(b){return null==b?d[a].terms_stats.size:(d[a].terms_stats.size=b,this)},order:function(b){return null==b?d[a].terms_stats.order:(b=b.toLowerCase(),("count"===b||"term"===b||"reverse_count"===b||"reverse_term"===b||"total"===b||"reverse_total"===b||"min"===b||"reverse_min"===b||"max"===b||"reverse_max"===b||"mean"===b||"reverse_mean"===b)&&(d[a].terms_stats.order=b),this)}})},B.TermsFacet=function(a){var b=B.FacetMixin(a),d=b.toJSON();return d[a].terms={},c(b,{field:function(b){return null==b?d[a].terms.field:(d[a].terms.field=b,this)},fields:function(b){if(null==b)return d[a].terms.fields;if(!e(b))throw new TypeError("Argument must be an array");return d[a].terms.fields=b,this},scriptField:function(b){return null==b?d[a].terms.script_field:(d[a].terms.script_field=b,this)},size:function(b){return null==b?d[a].terms.size:(d[a].terms.size=b,this)},shardSize:function(b){return null==b?d[a].terms.shard_size:(d[a].terms.shard_size=b,this)},order:function(b){return null==b?d[a].terms.order:(b=b.toLowerCase(),("count"===b||"term"===b||"reverse_count"===b||"reverse_term"===b)&&(d[a].terms.order=b),this)},allTerms:function(b){return null==b?d[a].terms.all_terms:(d[a].terms.all_terms=b,this)},exclude:function(b){if(null==d[a].terms.exclude&&(d[a].terms.exclude=[]),null==b)return d[a].terms.exclude;if(g(b))d[a].terms.exclude.push(b);else{if(!e(b))throw new TypeError("Argument must be string or array");d[a].terms.exclude=b}return this},regex:function(b){return null==b?d[a].terms.regex:(d[a].terms.regex=b,this)},regexFlags:function(b){return null==b?d[a].terms.regex_flags:(d[a].terms.regex_flags=b,this)},script:function(b){return null==b?d[a].terms.script:(d[a].terms.script=b,this)},lang:function(b){return null==b?d[a].terms.lang:(d[a].terms.lang=b,this)},params:function(b){return null==b?d[a].terms.params:(d[a].terms.params=b,this)},executionHint:function(b){return null==b?d[a].terms.execution_hint:(d[a].terms.execution_hint=b,this)}})},B.AvgAggregation=function(a){var b=B.MetricsAggregationMixin(a,"avg");b.toJSON();return b},B.CardinalityAggregation=function(a){var b=B.MetricsAggregationMixin(a,"cardinality"),d=b.toJSON();return c(b,{rehash:function(b){return null==b?d[a].cardinality.rehash:(d[a].cardinality.rehash=b,this)},precisionThreshold:function(b){return null==b?d[a].cardinality.precision_threshold:(d[a].cardinality.precision_threshold=b,this)}})},B.ChildrenAggregation=function(a){var b=B.AggregationMixin(a),d=b.toJSON();return d[a].children={},c(b,{children:function(b){return null==b?d[a].children.type:(d[a].children.type=b,this)}})},B.DateHistogramAggregation=function(a){var b=B.BucketsAggregationMixin(a,"date_histogram"),d=b.toJSON();return c(b,{timeZone:function(b){return null==b?d[a].date_histogram.time_zone:(d[a].date_histogram.time_zone=b,this)},preZone:function(b){return null==b?d[a].date_histogram.pre_zone:(d[a].date_histogram.pre_zone=b,this)},postZone:function(b){return null==b?d[a].date_histogram.post_zone:(d[a].date_histogram.post_zone=b,this)},preOffset:function(b){return null==b?d[a].date_histogram.pre_offset:(d[a].date_histogram.pre_offset=b,this)},postOffset:function(b){return null==b?d[a].date_histogram.post_offset:(d[a].date_histogram.post_offset=b,this)},extendedBounds:function(b,c){var e;return null==b&&null==c?d[a].date_histogram.extended_bounds:(e={},null!=b&&(e.min=b),null!=c&&(e.max=c),d[a].date_histogram.extended_bounds=e,this)},interval:function(b){return null==b?d[a].date_histogram.interval:(d[a].date_histogram.interval=b,this)},format:function(b){return null==b?d[a].date_histogram.format:(d[a].date_histogram.format=b,this)},keyed:function(b){return null==b?d[a].date_histogram.keyed:(d[a].date_histogram.keyed=b,this)},preZoneAdjustLargeInterval:function(b){return null==b?d[a].date_histogram.pre_zone_adjust_large_interval:(d[a].date_histogram.pre_zone_adjust_large_interval=b,this)},minDocCount:function(b){return null==b?d[a].date_histogram.min_doc_count:(d[a].date_histogram.min_doc_count=b,this)},order:function(b,c){return null==b?d[a].date_histogram.order:(null==c&&(c="desc"),c=c.toLowerCase(),"asc"!==c&&"desc"!==c&&(c="desc"),d[a].date_histogram.order={},d[a].date_histogram.order[b]=c,this)}})},B.DateRangeAggregation=function(a){var b=B.BucketsAggregationMixin(a,"date_range"),d=b.toJSON();return c(b,{format:function(b){return null==b?d[a].date_range.format:(d[a].date_range.format=b,this)},range:function(b,c,e){var f={};return null==d[a].date_range.ranges&&(d[a].date_range.ranges=[]),null==b&&null==c?d[a].date_range.ranges:(null!=b&&(f.from=b),null!=c&&(f.to=c),null!=e&&(f.key=e),d[a].date_range.ranges.push(f),this)},keyed:function(b){return null==b?d[a].date_range.keyed:(d[a].date_range.keyed=b,this)}})},B.ExtendedStatsAggregation=function(a){var b=B.MetricsAggregationMixin(a,"extended_stats");b.toJSON();return b},B.FilterAggregation=function(a){var b=B.AggregationMixin(a),d=b.toJSON();return c(b,{filter:function(b){if(null==b)return d[a].filter;if(!n(b))throw new TypeError("Argument must be a Filter");return d[a].filter=b.toJSON(),this}})},B.FiltersAggregation=function(a){var b=B.AggregationMixin(a),d=b.toJSON();return d[a].filters={filters:{}},c(b,{filter:function(b,c){if(!n(b))throw new TypeError("First argument must be a Filter");if(null==c)throw new TypeError("Second argument must be a name for the filter");return d[a].filters.filters[c]=b.toJSON(),this}})},B.GeoBoundsAggregation=function(a){var b=B.MetricsAggregationMixin(a,"geo_bounds"),d=b.toJSON();return delete b.script,delete b.scriptId,delete b.scriptFile,delete b.lang,delete b.params,c(b,{wrapLongitude:function(b){return null==b?d[a].geo_bounds.wrap_longitude:(d[a].geo_bounds.wrap_longitude=b,this)}})},B.GeoDistanceAggregation=function(a){var b=B.AggregationMixin(a),d=B.GeoPoint([0,0]),e=b.toJSON();return e[a].geo_distance={},c(b,{field:function(b){return null==b?e[a].geo_distance.field:(e[a].geo_distance.field=b,this)},unit:function(b){return null==b?e[a].geo_distance.unit:(("in"===b||"yd"===b||"ft"===b||"km"===b||"NM"===b||"mm"===b||"cm"===b||"mi"===b||"m"===b)&&(e[a].geo_distance.unit=b),this)},distanceType:function(b){return null==b?e[a].geo_distance.distance_type:(b=b.toLowerCase(),("plane"===b||"arc"===b||"sloppy_arc"===b||"factor"===b)&&(e[a].geo_distance.distance_type=b),this)},origin:function(b){if(null==b)return d;if(!s(b))throw new TypeError("Argument must be a GeoPoint");return d=b,e[a].geo_distance.origin=b.toJSON(),this},point:function(b){if(null==b)return d;if(!s(b))throw new TypeError("Argument must be a GeoPoint");return d=b,e[a].geo_distance.point=b.toJSON(),this},center:function(b){if(null==b)return d;if(!s(b))throw new TypeError("Argument must be a GeoPoint");return d=b,e[a].geo_distance.center=b.toJSON(),this},range:function(b,c,d){var f={};return null==e[a].geo_distance.ranges&&(e[a].geo_distance.ranges=[]),null==b&&null==c?e[a].geo_distance.ranges:(null!=b&&(f.from=b),null!=c&&(f.to=c),null!=d&&(f.key=d),e[a].geo_distance.ranges.push(f),this)},keyed:function(b){return null==b?e[a].geo_distance.keyed:(e[a].geo_distance.keyed=b,this)}})},B.GeoHashGridAggregation=function(a){var b=B.AggregationMixin(a),d=b.toJSON();return d[a].geohash_grid={},c(b,{field:function(b){return null==b?d[a].geohash_grid.field:(d[a].geohash_grid.field=b,this)},precision:function(b){return null==b?d[a].geohash_grid.precision:(d[a].geohash_grid.precision=b,this)},size:function(b){return null==b?d[a].geohash_grid.size:(d[a].geohash_grid.size=b,this)},shardSize:function(b){return null==b?d[a].geohash_grid.shard_size:(d[a].geohash_grid.shard_size=b,this)}})},B.GlobalAggregation=function(a){var b=B.AggregationMixin(a),c=b.toJSON();return c[a].global={},b},B.HistogramAggregation=function(a){var b=B.BucketsAggregationMixin(a,"histogram"),d=b.toJSON();return c(b,{format:function(b){return null==b?d[a].histogram.format:(d[a].histogram.format=b,this)},extendedBounds:function(b,c){var e;return null==b&&null==c?d[a].histogram.extended_bounds:(e={},null!=b&&(e.min=b),null!=c&&(e.max=c),d[a].histogram.extended_bounds=e,this)},interval:function(b){return null==b?d[a].histogram.interval:(d[a].histogram.interval=b,this)},minDocCount:function(b){return null==b?d[a].histogram.min_doc_count:(d[a].histogram.min_doc_count=b,this)},keyed:function(b){return null==b?d[a].histogram.keyed:(d[a].histogram.keyed=b,this)},order:function(b,c){return null==b?d[a].histogram.order:(null==c&&(c="desc"),c=c.toLowerCase(),"asc"!==c&&"desc"!==c&&(c="desc"),d[a].histogram.order={},d[a].histogram.order[b]=c,this)}})},B.IPv4RangeAggregation=function(a){var b=B.BucketsAggregationMixin(a,"ip_range"),d=b.toJSON();return c(b,{range:function(b,c,e,f){var g={};return null==d[a].ip_range.ranges&&(d[a].ip_range.ranges=[]),null==b&&null==c&&null==e?d[a].ip_range.ranges:(null!=b&&(g.from=b),null!=c&&(g.to=c),null!=e&&(g.mask=e),null!=f&&(g.key=f),d[a].ip_range.ranges.push(g),this)},keyed:function(b){return null==b?d[a].ip_range.keyed:(d[a].ip_range.keyed=b,this)}})},B.MaxAggregation=function(a){var b=B.MetricsAggregationMixin(a,"max");b.toJSON();return b},B.MinAggregation=function(a){var b=B.MetricsAggregationMixin(a,"min");b.toJSON();return b},B.MissingAggregation=function(a){var b=B.AggregationMixin(a),d=b.toJSON();return d[a].missing={},c(b,{field:function(b){return null==b?d[a].missing.field:(d[a].missing.field=b,this)}})},B.NestedAggregation=function(a){var b=B.AggregationMixin(a),d=b.toJSON();return d[a].nested={},c(b,{path:function(b){return null==b?d[a].nested.path:(d[a].nested.path=b,this)}})},B.PercentilesAggregation=function(a){var b=B.MetricsAggregationMixin(a,"percentiles"),d=b.toJSON();return c(b,{keyed:function(b){return null==b?d[a].percentiles.keyed:(d[a].percentiles.keyed=b,this)},percents:function(b){if(null==b)return d[a].percentiles.percents;if(!e(b))throw new TypeError("Percents must be an array of doubles");return d[a].percentiles.percents=b,this},percent:function(b){return null==d[a].percentiles.percents&&(d[a].percentiles.percents=[]),null==b?d[a].percentiles.percents:(d[a].percentiles.percents.push(b),this)},compression:function(b){return null==b?d[a].percentiles.compression:(d[a].percentiles.compression=b,this)}})},B.RangeAggregation=function(a){var b=B.BucketsAggregationMixin(a,"range"),d=b.toJSON();return c(b,{range:function(b,c,e){var f={};return null==d[a].range.ranges&&(d[a].range.ranges=[]),null==b&&null==c?d[a].range.ranges:(null!=b&&(f.from=b),null!=c&&(f.to=c),null!=e&&(f.key=e),d[a].range.ranges.push(f),this)},keyed:function(b){return null==b?d[a].range.keyed:(d[a].range.keyed=b,this)}})},B.ScriptedMetricAggregation=function(a){var b=B.MetricsAggregationMixin(a,"scripted_metric"),d=b.toJSON();return delete b.field,delete b.script,delete b.scriptId,delete b.scriptFile,c(b,{initScript:function(b){return null==b?d[a].scripted_metric.init_script:(d[a].scripted_metric.init_script=b,this)},mapScript:function(b){return null==b?d[a].scripted_metric.map_script:(d[a].scripted_metric.map_script=b,this)},combineScript:function(b){return null==b?d[a].scripted_metric.combine_script:(d[a].scripted_metric.combine_script=b,this)},reduceScript:function(b){return null==b?d[a].scripted_metric.reduce_script:(d[a].scripted_metric.reduce_script=b,this)},initScriptFile:function(b){return null==b?d[a].scripted_metric.init_script_file:(d[a].scripted_metric.init_script_file=b,this)},initScriptId:function(b){return null==b?d[a].scripted_metric.init_script_id:(d[a].scripted_metric.init_script_id=b,this)},mapScriptFile:function(b){return null==b?d[a].scripted_metric.map_script_file:(d[a].scripted_metric.map_script_file=b,this)},mapScriptId:function(b){return null==b?d[a].scripted_metric.map_script_id:(d[a].scripted_metric.map_script_id=b,this)},combineScriptFile:function(b){return null==b?d[a].scripted_metric.combine_script_file:(d[a].scripted_metric.combine_script_file=b,this)},combineScriptId:function(b){return null==b?d[a].scripted_metric.combine_script_id:(d[a].scripted_metric.combine_script_id=b,this)},reduceScriptFile:function(b){return null==b?d[a].scripted_metric.reduce_script_file:(d[a].scripted_metric.reduce_script_file=b,this)},reduceScriptId:function(b){return null==b?d[a].scripted_metric.reduce_script_id:(d[a].scripted_metric.reduce_script_id=b,this)},params:function(b){return null==b?d[a].scripted_metric.params:(d[a].scripted_metric.params=b,this)},reduceParams:function(b){return null==b?d[a].scripted_metric.reduce_params:(d[a].scripted_metric.reduce_params=b,this)},lang:function(b){return null==b?d[a].scripted_metric.lang:(d[a].scripted_metric.lang=b,this)}})},B.SignificantTermsAggregation=function(a){var b=B.AggregationMixin(a),d=b.toJSON();return d[a].significant_terms={},c(b,{field:function(b){return null==b?d[a].significant_terms.field:(d[a].significant_terms.field=b,this)},format:function(b){return null==b?d[a].significant_terms.format:(d[a].significant_terms.format=b,this)},include:function(b,c){return null==d[a].significant_terms.include&&(d[a].significant_terms.include={}),null==b?d[a].significant_terms.include:(d[a].significant_terms.include.pattern=b,null!=c&&(d[a].significant_terms.include.flags=c),this)},exclude:function(b,c){return null==d[a].significant_terms.exclude&&(d[a].significant_terms.exclude={}),null==b?d[a].significant_terms.exclude:(d[a].significant_terms.exclude.pattern=b,null!=c&&(d[a].significant_terms.exclude.flags=c),this)},executionHint:function(b){return null==b?d[a].significant_terms.execution_hint:(b=b.toLowerCase(),("map"===b||"ordinals"===b)&&(d[a].significant_terms.execution_hint=b),this)},size:function(b){return null==b?d[a].significant_terms.size:(d[a].significant_terms.size=b,this)},shardSize:function(b){return null==b?d[a].significant_terms.shard_size:(d[a].significant_terms.shard_size=b,this)},minDocCount:function(b){return null==b?d[a].significant_terms.min_doc_count:(d[a].significant_terms.min_doc_count=b,this)}})},B.StatsAggregation=function(a){var b=B.MetricsAggregationMixin(a,"stats");b.toJSON();return b},B.SumAggregation=function(a){var b=B.MetricsAggregationMixin(a,"sum");b.toJSON();return b},B.TermsAggregation=function(a){var b=B.BucketsAggregationMixin(a,"terms"),d=b.toJSON();return d[a].terms={},c(b,{format:function(b){return null==b?d[a].terms.format:(d[a].terms.format=b,this)},include:function(b,c){return null==d[a].terms.include&&(d[a].terms.include={}),null==b?d[a].terms.include:(d[a].terms.include.pattern=b,null!=c&&(d[a].terms.include.flags=c),this)},exclude:function(b,c){return null==d[a].terms.exclude&&(d[a].terms.exclude={}),null==b?d[a].terms.exclude:(d[a].terms.exclude.pattern=b,null!=c&&(d[a].terms.exclude.flags=c),this)},executionHint:function(b){return null==b?d[a].terms.execution_hint:(b=b.toLowerCase(),("map"===b||"ordinals"===b)&&(d[a].terms.execution_hint=b),this)},size:function(b){return null==b?d[a].terms.size:(d[a].terms.size=b,this)},shardSize:function(b){return null==b?d[a].terms.shard_size:(d[a].terms.shard_size=b,this)},minDocCount:function(b){return null==b?d[a].terms.min_doc_count:(d[a].terms.min_doc_count=b,this)},order:function(b,c){var e={};return null==b?d[a].terms.order:(null==c&&(c="desc"),c=c.toLowerCase(),"asc"!==c&&"desc"!==c&&(c="desc"),e[b]=c,d[a].terms.order=d[a].terms.order||[],d[a].terms.order.push(e),this)}})},B.TopHitsAggregation=function(a){var b=B.AggregationMixin(a),d=b.toJSON();return d[a].top_hits={},c(b,{from:function(b){return null===b?d[a].top_hits.from:(d[a].top_hits.from=b,this)},size:function(b){return null===b?d[a].top_hits.size:(d[a].top_hits.size=b,this)},sort:function(b){return null===b?d[a].top_hits.sort:(d[a].top_hits.sort=b,this)},trackScores:function(b){return null===b?d[a].top_hits.track_scores:(d[a].top_hits.track_scores=b,this)},version:function(b){return null===b?d[a].top_hits.version:(d[a].top_hits.version=b,this)},explain:function(b){return null===b?d[a].top_hits.explain:(d[a].top_hits.explain=b,this)},highlight:function(b){if(null===b)return d[a].top_hits.highlight;if(!w(b))throw new TypeError("Argument must be a Highlight object");return d[a].top_hits.highlight=b.toJSON(),this},scriptField:function(b){if(null===b)return d[a].top_hits.script_fields;if(void 0===d[a].top_hits.script_fields&&(d[a].top_hits.script_fields={}),!r(b))throw new TypeError("Argument must be a ScriptField");return c(d[a].top_hits.script_fields,b.toJSON()),this},fieldDataFields:function(b){return null===b?d[a].top_hits.fielddata_fields:(d[a].top_hits.fielddata_fields=b,this)},source:function(b,c){if(void 0===b&&void 0===c)return d[a].top_hits._source;if(!e(b)&&!g(b)&&!i(b))throw new TypeError("Argument includes must be a string, an array, or a boolean");if(void 0!==c&&!e(c)&&!g(c))throw new TypeError("Argument excludes must be a string or an array");return i(b)?d[a].top_hits._source=b:(d[a].top_hits._source={includes:b},null!=c&&(d[a].top_hits._source.excludes=c)),this}})},B.ValueCountAggregation=function(a){var b=B.MetricsAggregationMixin(a,"value_count");b.toJSON();return b},B.AndFilter=function(a){var b,d,f=B.FilterMixin("and"),g=f.toJSON();if(g.and.filters=[],n(a))g.and.filters.push(a.toJSON());else{if(!e(a))throw new TypeError("Argument must be a Filter or Array of Filters");for(b=0,d=a.length;d>b;b++){if(!n(a[b]))throw new TypeError("Array must contain only Filter objects");g.and.filters.push(a[b].toJSON())}}return c(f,{filters:function(a){var b,c;if(null==a)return g.and.filters;if(n(a))g.and.filters.push(a.toJSON());else{if(!e(a))throw new TypeError("Argument must be a Filter or an Array of Filters");for(g.and.filters=[],b=0,c=a.length;c>b;b++){if(!n(a[b]))throw new TypeError("Array must contain only Filter objects");g.and.filters.push(a[b].toJSON())}}return this}})},B.BoolFilter=function(){var a=B.FilterMixin("bool"),b=a.toJSON();return c(a,{must:function(a){var c,d;if(null==b.bool.must&&(b.bool.must=[]),null==a)return b.bool.must;if(n(a))b.bool.must.push(a.toJSON());else{if(!e(a))throw new TypeError("Argument must be a Filter or array of Filters"); +for(b.bool.must=[],c=0,d=a.length;d>c;c++){if(!n(a[c]))throw new TypeError("Argument must be an array of Filters");b.bool.must.push(a[c].toJSON())}}return this},mustNot:function(a){var c,d;if(null==b.bool.must_not&&(b.bool.must_not=[]),null==a)return b.bool.must_not;if(n(a))b.bool.must_not.push(a.toJSON());else{if(!e(a))throw new TypeError("Argument must be a Filter or array of Filters");for(b.bool.must_not=[],c=0,d=a.length;d>c;c++){if(!n(a[c]))throw new TypeError("Argument must be an array of Filters");b.bool.must_not.push(a[c].toJSON())}}return this},should:function(a){var c,d;if(null==b.bool.should&&(b.bool.should=[]),null==a)return b.bool.should;if(n(a))b.bool.should.push(a.toJSON());else{if(!e(a))throw new TypeError("Argument must be a Filter or array of Filters");for(b.bool.should=[],c=0,d=a.length;d>c;c++){if(!n(a[c]))throw new TypeError("Argument must be an array of Filters");b.bool.should.push(a[c].toJSON())}}return this}})},B.ExistsFilter=function(a){var b=B.FilterMixin("exists"),d=b.toJSON();return d.exists.field=a,c(b,{field:function(a){return null==a?d.exists.field:(d.exists.field=a,this)}})},B.GeoBboxFilter=function(a){var b=B.FilterMixin("geo_bounding_box"),d=b.toJSON();return d.geo_bounding_box[a]={},c(b,{field:function(b){var c=d.geo_bounding_box[a];return null==b?a:(delete d.geo_bounding_box[a],a=b,d.geo_bounding_box[b]=c,this)},topLeft:function(b){if(null==b)return d.geo_bounding_box[a].top_left;if(!s(b))throw new TypeError("Argument must be a GeoPoint");return d.geo_bounding_box[a].top_left=b.toJSON(),this},bottomRight:function(b){if(null==b)return d.geo_bounding_box[a].bottom_right;if(!s(b))throw new TypeError("Argument must be a GeoPoint");return d.geo_bounding_box[a].bottom_right=b.toJSON(),this},type:function(a){return null==a?d.geo_bounding_box.type:(a=a.toLowerCase(),("memory"===a||"indexed"===a)&&(d.geo_bounding_box.type=a),this)},normalize:function(a){return null==a?d.geo_bounding_box.normalize:(d.geo_bounding_box.normalize=a,this)}})},B.GeoDistanceFilter=function(a){var b=B.FilterMixin("geo_distance"),d=b.toJSON();return d.geo_distance[a]=[0,0],c(b,{field:function(b){var c=d.geo_distance[a];return null==b?a:(delete d.geo_distance[a],a=b,d.geo_distance[b]=c,this)},distance:function(a){if(null==a)return d.geo_distance.distance;if(!h(a))throw new TypeError("Argument must be a numeric value");return d.geo_distance.distance=a,this},unit:function(a){return null==a?d.geo_distance.unit:(a=a.toLowerCase(),("mi"===a||"km"===a)&&(d.geo_distance.unit=a),this)},point:function(b){if(null==b)return d.geo_distance[a];if(!s(b))throw new TypeError("Argument must be a GeoPoint");return d.geo_distance[a]=b.toJSON(),this},distanceType:function(a){return null==a?d.geo_distance.distance_type:(a=a.toLowerCase(),("arc"===a||"plane"===a)&&(d.geo_distance.distance_type=a),this)},normalize:function(a){return null==a?d.geo_distance.normalize:(d.geo_distance.normalize=a,this)},optimizeBbox:function(a){return null==a?d.geo_distance.optimize_bbox:(a=a.toLowerCase(),("memory"===a||"indexed"===a||"none"===a)&&(d.geo_distance.optimize_bbox=a),this)}})},B.GeoDistanceRangeFilter=function(a){var b=B.FilterMixin("geo_distance_range"),d=b.toJSON();return d.geo_distance_range[a]=[0,0],c(b,{field:function(b){var c=d.geo_distance_range[a];return null==b?a:(delete d.geo_distance_range[a],a=b,d.geo_distance_range[b]=c,this)},from:function(a){if(null==a)return d.geo_distance_range.from;if(!h(a))throw new TypeError("Argument must be a numeric value");return d.geo_distance_range.from=a,this},to:function(a){if(null==a)return d.geo_distance_range.to;if(!h(a))throw new TypeError("Argument must be a numeric value");return d.geo_distance_range.to=a,this},includeLower:function(a){return null==a?d.geo_distance_range.include_lower:(d.geo_distance_range.include_lower=a,this)},includeUpper:function(a){return null==a?d.geo_distance_range.include_upper:(d.geo_distance_range.include_upper=a,this)},gt:function(a){if(null==a)return d.geo_distance_range.gt;if(!h(a))throw new TypeError("Argument must be a numeric value");return d.geo_distance_range.gt=a,this},gte:function(a){if(null==a)return d.geo_distance_range.gte;if(!h(a))throw new TypeError("Argument must be a numeric value");return d.geo_distance_range.gte=a,this},lt:function(a){if(null==a)return d.geo_distance_range.lt;if(!h(a))throw new TypeError("Argument must be a numeric value");return d.geo_distance_range.lt=a,this},lte:function(a){if(null==a)return d.geo_distance_range.lte;if(!h(a))throw new TypeError("Argument must be a numeric value");return d.geo_distance_range.lte=a,this},unit:function(a){return null==a?d.geo_distance_range.unit:(a=a.toLowerCase(),("mi"===a||"km"===a)&&(d.geo_distance_range.unit=a),this)},point:function(b){if(null==b)return d.geo_distance_range[a];if(!s(b))throw new TypeError("Argument must be a GeoPoint");return d.geo_distance_range[a]=b.toJSON(),this},distanceType:function(a){return null==a?d.geo_distance_range.distance_type:(a=a.toLowerCase(),("arc"===a||"plane"===a)&&(d.geo_distance_range.distance_type=a),this)},normalize:function(a){return null==a?d.geo_distance_range.normalize:(d.geo_distance_range.normalize=a,this)},optimizeBbox:function(a){return null==a?d.geo_distance_range.optimize_bbox:(a=a.toLowerCase(),("memory"===a||"indexed"===a||"none"===a)&&(d.geo_distance_range.optimize_bbox=a),this)}})},B.GeoPolygonFilter=function(a){var b=B.FilterMixin("geo_polygon"),d=b.toJSON();return d.geo_polygon[a]={points:[]},c(b,{field:function(b){var c=d.geo_polygon[a];return null==b?a:(delete d.geo_polygon[a],a=b,d.geo_polygon[b]=c,this)},points:function(b){var c,f;if(null==b)return d.geo_polygon[a].points;if(s(b))d.geo_polygon[a].points.push(b.toJSON());else{if(!e(b))throw new TypeError("Argument must be a GeoPoint or Array of GeoPoints");for(d.geo_polygon[a].points=[],c=0,f=b.length;f>c;c++){if(!s(b[c]))throw new TypeError("Argument must be Array of GeoPoints");d.geo_polygon[a].points.push(b[c].toJSON())}}return this},normalize:function(a){return null==a?d.geo_polygon.normalize:(d.geo_polygon.normalize=a,this)}})},B.GeoShapeFilter=function(a){var b=B.FilterMixin("geo_shape"),d=b.toJSON();return d.geo_shape[a]={},c(b,{field:function(b){var c=d.geo_shape[a];return null==b?a:(delete d.geo_shape[a],a=b,d.geo_shape[b]=c,this)},shape:function(b){return null==b?d.geo_shape[a].shape:(null!=d.geo_shape[a].indexed_shape&&delete d.geo_shape[a].indexed_shape,d.geo_shape[a].shape=b.toJSON(),this)},indexedShape:function(b){return null==b?d.geo_shape[a].indexed_shape:(null!=d.geo_shape[a].shape&&delete d.geo_shape[a].shape,d.geo_shape[a].indexed_shape=b.toJSON(),this)},relation:function(b){return null==b?d.geo_shape[a].relation:(b=b.toLowerCase(),("intersects"===b||"disjoint"===b||"within"===b)&&(d.geo_shape[a].relation=b),this)},strategy:function(b){return null==b?d.geo_shape[a].strategy:(b=b.toLowerCase(),("recursive"===b||"term"===b)&&(d.geo_shape[a].strategy=b),this)}})},B.HasChildFilter=function(a,b){var d=B.FilterMixin("has_child"),e=d.toJSON();if(l(a))e.has_child.query=a.toJSON();else if(n(a))e.has_child.filter=a.toJSON();else if(null!=a)throw new TypeError("Argument must be query or filter");return e.has_child.type=b,c(d,{query:function(a){if(null==a)return e.has_child.query;if(!l(a))throw new TypeError("Argument must be a Query object");return e.has_child.query=a.toJSON(),this},filter:function(a){if(null==a)return e.has_child.filter;if(!n(a))throw new TypeError("Argument must be a Filter object");return e.has_child.filter=a.toJSON(),this},type:function(a){return null==a?e.has_child.type:(e.has_child.type=a,this)},shortCircuitCutoff:function(a){return null==a?e.has_child.short_circuit_cutoff:(e.has_child.short_circuit_cutoff=a,this)},scope:function(a){return this},innerHits:function(a){if(null==a)return e.has_child.inner_hits;if(!A(a))throw new TypeError("Argument must be a Highlight object");return e.has_child.inner_hits=a.toJSON(),this},minChildren:function(a){return null==a?e.has_child.min_children:(e.has_child.min_children=a,this)},maxChildren:function(a){return null==a?e.has_child.max_children:(e.has_child.max_children=a,this)}})},B.HasParentFilter=function(a,b){var d=B.FilterMixin("has_parent"),e=d.toJSON();if(l(a))e.has_parent.query=a.toJSON();else if(n(a))e.has_parent.filter=a.toJSON();else if(null!=a)throw new TypeError("Argument must be query or filter");return e.has_parent.parent_type=b,c(d,{query:function(a){if(null==a)return e.has_parent.query;if(!l(a))throw new TypeError("Argument must be a Query object");return e.has_parent.query=a.toJSON(),this},filter:function(a){if(null==a)return e.has_parent.filter;if(!n(a))throw new TypeError("Argument must be a Filter object");return e.has_parent.filter=a.toJSON(),this},parentType:function(a){return null==a?e.has_parent.parent_type:(e.has_parent.parent_type=a,this)},scope:function(a){return this},innerHits:function(a){if(null==a)return e.has_parent.inner_hits;if(!A(a))throw new TypeError("Argument must be a Highlight object");return e.has_parent.inner_hits=a.toJSON(),this}})},B.IdsFilter=function(a){var b=B.FilterMixin("ids"),d=b.toJSON();if(g(a))d.ids.values=[a];else{if(!e(a))throw new TypeError("Argument must be a string or an array");d.ids.values=a}return c(b,{values:function(a){if(null==a)return d.ids.values;if(g(a))d.ids.values.push(a);else{if(!e(a))throw new TypeError("Argument must be a string or an array");d.ids.values=a}return this},type:function(a){if(null==d.ids.type&&(d.ids.type=[]),null==a)return d.ids.type;if(g(a))d.ids.type.push(a);else{if(!e(a))throw new TypeError("Argument must be a string or an array");d.ids.type=a}return this}})},B.IndicesFilter=function(a,b){if(!n(a))throw new TypeError("Argument must be a Filter");var d=B.FilterMixin("indices"),f=d.toJSON();if(f.indices.filter=a.toJSON(),g(b))f.indices.indices=[b];else{if(!e(b))throw new TypeError("Argument must be a string or array");f.indices.indices=b}return c(d,{indices:function(a){if(null==a)return f.indices.indices;if(g(a))f.indices.indices.push(a);else{if(!e(a))throw new TypeError("Argument must be a string or array");f.indices.indices=a}return this},filter:function(a){if(null==a)return f.indices.filter;if(!n(a))throw new TypeError("Argument must be a Filter");return f.indices.filter=a.toJSON(),this},noMatchFilter:function(a){if(null==a)return f.indices.no_match_filter;if(g(a))a=a.toLowerCase(),("none"===a||"all"===a)&&(f.indices.no_match_filter=a);else{if(!n(a))throw new TypeError("Argument must be string or Filter");f.indices.no_match_filter=a.toJSON()}return this}})},B.LimitFilter=function(a){var b=B.FilterMixin("limit"),d=b.toJSON();return d.limit.value=a,c(b,{value:function(a){if(null==a)return d.limit.value;if(!h(a))throw new TypeError("Argument must be a numeric value");return d.limit.value=a,this}})},B.MatchAllFilter=function(){return B.FilterMixin("match_all")},B.MissingFilter=function(a){var b=B.FilterMixin("missing"),d=b.toJSON();return d.missing.field=a,c(b,{field:function(a){return null==a?d.missing.field:(d.missing.field=a,this)},existence:function(a){return null==a?d.missing.existence:(d.missing.existence=a,this)},nullValue:function(a){return null==a?d.missing.null_value:(d.missing.null_value=a,this)}})},B.NestedFilter=function(a){var b=B.FilterMixin("nested"),d=b.toJSON();return d.nested.path=a,c(b,{path:function(a){return null==a?d.nested.path:(d.nested.path=a,this)},query:function(a){if(null==a)return d.nested.query;if(!l(a))throw new TypeError("Argument must be a Query object");return d.nested.query=a.toJSON(),this},filter:function(a){if(null==a)return d.nested.filter;if(!n(a))throw new TypeError("Argument must be a Filter object");return d.nested.filter=a.toJSON(),this},boost:function(a){return null==a?d.nested.boost:(d.nested.boost=a,this)},join:function(a){return null==a?d.nested.join:(d.nested.join=a,this)},scope:function(a){return this},innerHits:function(a){if(null==a)return d.nested.inner_hits;if(!A(a))throw new TypeError("Argument must be a Highlight object");return d.nested.inner_hits=a.toJSON(),this}})},B.NotFilter=function(a){if(!n(a))throw new TypeError("Argument must be a Filter");var b=B.FilterMixin("not"),d=b.toJSON();return d.not=a.toJSON(),c(b,{filter:function(a){if(null==a)return d.not;if(!n(a))throw new TypeError("Argument must be a Filter");return d.not=a.toJSON(),this}})},B.NumericRangeFilter=function(a){var b=B.FilterMixin("numeric_range"),d=b.toJSON();return d.numeric_range[a]={},c(b,{field:function(b){var c=d.numeric_range[a];return null==b?a:(delete d.numeric_range[a],a=b,d.numeric_range[a]=c,this)},from:function(b){if(null==b)return d.numeric_range[a].from;if(!h(b))throw new TypeError("Argument must be a numeric value");return d.numeric_range[a].from=b,this},to:function(b){if(null==b)return d.numeric_range[a].to;if(!h(b))throw new TypeError("Argument must be a numeric value");return d.numeric_range[a].to=b,this},includeLower:function(b){return null==b?d.numeric_range[a].include_lower:(d.numeric_range[a].include_lower=b,this)},includeUpper:function(b){return null==b?d.numeric_range[a].include_upper:(d.numeric_range[a].include_upper=b,this)},gt:function(b){if(null==b)return d.numeric_range[a].gt;if(!h(b))throw new TypeError("Argument must be a numeric value");return d.numeric_range[a].gt=b,this},gte:function(b){if(null==b)return d.numeric_range[a].gte;if(!h(b))throw new TypeError("Argument must be a numeric value");return d.numeric_range[a].gte=b,this},lt:function(b){if(null==b)return d.numeric_range[a].lt;if(!h(b))throw new TypeError("Argument must be a numeric value");return d.numeric_range[a].lt=b,this},lte:function(b){if(null==b)return d.numeric_range[a].lte;if(!h(b))throw new TypeError("Argument must be a numeric value");return d.numeric_range[a].lte=b,this}})},B.OrFilter=function(a){var b,d,f=B.FilterMixin("or"),g=f.toJSON();if(g.or.filters=[],n(a))g.or.filters.push(a.toJSON());else{if(!e(a))throw new TypeError("Argument must be a Filter or array of Filters");for(b=0,d=a.length;d>b;b++){if(!n(a[b]))throw new TypeError("Argument must be array of Filters");g.or.filters.push(a[b].toJSON())}}return c(f,{filters:function(a){var b,c;if(null==a)return g.or.filters;if(n(a))g.or.filters.push(a.toJSON());else{if(!e(a))throw new TypeError("Argument must be a Filter or array of Filters");for(g.or.filters=[],b=0,c=a.length;c>b;b++){if(!n(a[b]))throw new TypeError("Argument must be an array of Filters");g.or.filters.push(a[b].toJSON())}}return this}})},B.PrefixFilter=function(a,b){var d=B.FilterMixin("prefix"),e=d.toJSON();return e.prefix[a]=b,c(d,{field:function(b){var c=e.prefix[a];return null==b?a:(delete e.prefix[a],a=b,e.prefix[a]=c,this)},prefix:function(b){return null==b?e.prefix[a]:(e.prefix[a]=b,this)}})},B.QueryFilter=function(a){if(!l(a))throw new TypeError("Argument must be a Query");var b=B.FilterMixin("fquery"),d=b.toJSON();return d.fquery.query=a.toJSON(),c(b,{query:function(a){if(null==a)return d.fquery.query;if(!l(a))throw new TypeError("Argument must be a Query");return d.fquery.query=a.toJSON(),this}})},B.RangeFilter=function(a){var b=B.FilterMixin("range"),d=b.toJSON();return d.range[a]={},c(b,{field:function(b){var c=d.range[a];return null==b?a:(delete d.range[a],a=b,d.range[b]=c,this)},from:function(b){return null==b?d.range[a].from:(d.range[a].from=b,this)},to:function(b){return null==b?d.range[a].to:(d.range[a].to=b,this)},includeLower:function(b){return null==b?d.range[a].include_lower:(d.range[a].include_lower=b,this)},includeUpper:function(b){return null==b?d.range[a].include_upper:(d.range[a].include_upper=b,this)},gt:function(b){return null==b?d.range[a].gt:(d.range[a].gt=b,this)},gte:function(b){return null==b?d.range[a].gte:(d.range[a].gte=b,this)},lt:function(b){return null==b?d.range[a].lt:(d.range[a].lt=b,this)},lte:function(b){return null==b?d.range[a].lte:(d.range[a].lte=b,this)}})},B.RegexpFilter=function(a,b){var d=B.FilterMixin("regexp"),e=d.toJSON();return e.regexp[a]={value:b},c(d,{field:function(b){var c=e.regexp[a];return null==b?a:(delete e.regexp[a],a=b,e.regexp[b]=c,this)},value:function(b){return null==b?e.regexp[a].value:(e.regexp[a].value=b,this)},flags:function(b){return null==b?e.regexp[a].flags:(e.regexp[a].flags=b,this)},flagsValue:function(b){return null==b?e.regexp[a].flags_value:(e.regexp[a].flags_value=b,this)}})},B.ScriptFilter=function(a){var b=B.FilterMixin("script"),d=b.toJSON();return d.script.script=a,c(b,{script:function(a){return null==a?d.script.script:(d.script.script=a,this)},params:function(a){return null==a?d.script.params:(d.script.params=a,this)},lang:function(a){return null==a?d.script.lang:(d.script.lang=a,this)}})},B.TermFilter=function(a,b){var d=B.FilterMixin("term"),e=d.toJSON();return e.term[a]=b,c(d,{field:function(b){var c=e.term[a];return null==b?a:(delete e.term[a],a=b,e.term[a]=c,this)},term:function(b){return null==b?e.term[a]:(e.term[a]=b,this)}})},B.TermsFilter=function(a,b){var d=B.FilterMixin("terms"),f=d.toJSON(),g=function(){e(f.terms[a])||(f.terms[a]=[])},h=function(){e(f.terms[a])&&(f.terms[a]={})};return e(b)?f.terms[a]=b:f.terms[a]=[b],c(d,{field:function(b){var c=f.terms[a];return null==b?a:(delete f.terms[a],a=b,f.terms[b]=c,this)},terms:function(b){return g(),null==b?f.terms[a]:(e(b)?f.terms[a]=b:f.terms[a].push(b),this)},index:function(b){return h(),null==b?f.terms[a].index:(f.terms[a].index=b,this)},type:function(b){return h(),null==b?f.terms[a].type:(f.terms[a].type=b,this)},id:function(b){return h(),null==b?f.terms[a].id:(f.terms[a].id=b,this)},path:function(b){return h(),null==b?f.terms[a].path:(f.terms[a].path=b,this)},routing:function(b){return h(),null==b?f.terms[a].routing:(f.terms[a].routing=b,this)},cacheLookup:function(b){return h(),null==b?f.terms[a].cache:(f.terms[a].cache=b,this)},execution:function(a){return null==a?f.terms.execution:(a=a.toLowerCase(),("plain"===a||"bool"===a||"bool_nocache"===a||"and"===a||"and_nocache"===a||"or"===a||"or_nocache"===a)&&(f.terms.execution=a),this)}})},B.TypeFilter=function(a){var b=B.FilterMixin("type"),d=b.toJSON();return d.type.value=a,c(b,{type:function(a){return null==a?d.type.value:(d.type.value=a,this)}})},B.BoolQuery=function(){var a=B.QueryMixin("bool"),b=a.toJSON();return c(a,{must:function(a){var c,d;if(null==b.bool.must&&(b.bool.must=[]),null==a)return b.bool.must;if(l(a))b.bool.must.push(a.toJSON());else{if(!e(a))throw new TypeError("Argument must be a Query or array of Queries");for(b.bool.must=[],c=0,d=a.length;d>c;c++){if(!l(a[c]))throw new TypeError("Argument must be an array of Queries");b.bool.must.push(a[c].toJSON())}}return this},mustNot:function(a){var c,d;if(null==b.bool.must_not&&(b.bool.must_not=[]),null==a)return b.bool.must_not;if(l(a))b.bool.must_not.push(a.toJSON());else{if(!e(a))throw new TypeError("Argument must be a Query or array of Queries");for(b.bool.must_not=[],c=0,d=a.length;d>c;c++){if(!l(a[c]))throw new TypeError("Argument must be an array of Queries");b.bool.must_not.push(a[c].toJSON())}}return this},should:function(a){var c,d;if(null==b.bool.should&&(b.bool.should=[]),null==a)return b.bool.should;if(l(a))b.bool.should.push(a.toJSON());else{if(!e(a))throw new TypeError("Argument must be a Query or array of Queries");for(b.bool.should=[],c=0,d=a.length;d>c;c++){if(!l(a[c]))throw new TypeError("Argument must be an array of Queries");b.bool.should.push(a[c].toJSON())}}return this},adjustPureNegative:function(a){return null==a?b.bool.adjust_pure_negative:(b.bool.adjust_pure_negative=a,this)},disableCoord:function(a){return null==a?b.bool.disable_coord:(b.bool.disable_coord=a,this)},minimumNumberShouldMatch:function(a){return null==a?b.bool.minimum_number_should_match:(b.bool.minimum_number_should_match=a,this)}})},B.BoostingQuery=function(a,b,d){if(!l(a)||!l(b))throw new TypeError("Arguments must be Queries");var e=B.QueryMixin("boosting"),f=e.toJSON();return f.boosting.positive=a.toJSON(),f.boosting.negative=b.toJSON(),f.boosting.negative_boost=d,c(e,{positive:function(a){if(null==a)return f.boosting.positive;if(!l(a))throw new TypeError("Argument must be a Query");return f.boosting.positive=a.toJSON(),this},negative:function(a){if(null==a)return f.boosting.negative;if(!l(a))throw new TypeError("Argument must be a Query");return f.boosting.negative=a.toJSON(),this},negativeBoost:function(a){return null==a?f.boosting.negative_boost:(f.boosting.negative_boost=a,this)}})},B.CommonTermsQuery=function(a,b){var d=B.QueryMixin("common"),e=d.toJSON();return null==a&&(a="no_field_set"),e.common[a]={},null!=b&&(e.common[a].query=b),c(d,{field:function(b){var c=e.common[a];return null==b?a:(delete e.common[a],a=b,e.common[b]=c,this)},query:function(b){return null==b?e.common[a].query:(e.common[a].query=b,this)},analyzer:function(b){return null==b?e.common[a].analyzer:(e.common[a].analyzer=b,this)},disableCoord:function(b){return null==b?e.common[a].disable_coord:(e.common[a].disable_coord=b,this)},cutoffFrequency:function(b){return null==b?e.common[a].cutoff_frequency:(e.common[a].cutoff_frequency=b,this)},highFreqOperator:function(b){return null==b?e.common[a].high_freq_operator:(b=b.toLowerCase(),("and"===b||"or"===b)&&(e.common[a].high_freq_operator=b),this)},lowFreqOperator:function(b){return null==b?e.common[a].low_freq_operator:(b=b.toLowerCase(),("and"===b||"or"===b)&&(e.common[a].low_freq_operator=b),this)},minimumShouldMatch:function(b){return null==b?e.common[a].minimum_should_match:(e.common[a].minimum_should_match=b,this)},minimumShouldMatchLowFreq:function(b){return null==b?e.common[a].minimum_should_match.low_freq:(f(e.common[a].minimum_should_match)||(e.common[a].minimum_should_match={}),e.common[a].minimum_should_match.low_freq=b,this)},minimumShouldMatchHighFreq:function(b){return null==b?e.common[a].minimum_should_match.high_freq:(f(e.common[a].minimum_should_match)||(e.common[a].minimum_should_match={}),e.common[a].minimum_should_match.high_freq=b,this)},boost:function(b){return null==b?e.common[a].boost:(e.common[a].boost=b,this)}})},B.ConstantScoreQuery=function(){var a=B.QueryMixin("constant_score"),b=a.toJSON();return c(a,{query:function(a){if(null==a)return b.constant_score.query;if(!l(a))throw new TypeError("Argument must be a Query");return b.constant_score.query=a.toJSON(),this},filter:function(a){if(null==a)return b.constant_score.filter;if(!n(a))throw new TypeError("Argument must be a Filter");return b.constant_score.filter=a.toJSON(),this},cache:function(a){return null==a?b.constant_score._cache:(b.constant_score._cache=a,this)},cacheKey:function(a){return null==a?b.constant_score._cache_key:(b.constant_score._cache_key=a,this)}})},B.DisMaxQuery=function(){var a=B.QueryMixin("dis_max"),b=a.toJSON();return c(a,{queries:function(a){var c,d;if(null==a)return b.dis_max.queries;if(null==b.dis_max.queries&&(b.dis_max.queries=[]),l(a))b.dis_max.queries.push(a.toJSON());else{if(!e(a))throw new TypeError("Argument must be a Query or array of Queries");for(b.dis_max.queries=[],c=0,d=a.length;d>c;c++){if(!l(a[c]))throw new TypeError("Argument must be array of Queries");b.dis_max.queries.push(a[c].toJSON())}}return this},tieBreaker:function(a){return null==a?b.dis_max.tie_breaker:(b.dis_max.tie_breaker=a,this)}})},B.FieldMaskingSpanQuery=function(a,b){if(!l(a))throw new TypeError("Argument must be a SpanQuery");var d=B.QueryMixin("field_masking_span"),e=d.toJSON();return e.field_masking_span.query=a.toJSON(),e.field_masking_span.field=b,c(d,{query:function(a){if(null==a)return e.field_masking_span.query;if(!l(a))throw new TypeError("Argument must be a SpanQuery");return e.field_masking_span.query=a.toJSON(),this},field:function(a){return null==a?e.field_masking_span.field:(e.field_masking_span.field=a,this)}})},B.FilteredQuery=function(a,b){if(!l(a))throw new TypeError("Argument must be a Query");if(null!=b&&!n(b))throw new TypeError("Argument must be a Filter");var d=B.QueryMixin("filtered"),e=d.toJSON();return e.filtered.query=a.toJSON(),null!=b&&(e.filtered.filter=b.toJSON()),c(d,{query:function(a){if(null==a)return e.filtered.query;if(!l(a))throw new TypeError("Argument must be a Query");return e.filtered.query=a.toJSON(),this},filter:function(a){if(null==a)return e.filtered.filter;if(!n(a))throw new TypeError("Argument must be a Filter");return e.filtered.filter=a.toJSON(),this},strategy:function(a){return null==a?e.filtered.strategy:(a=a.toLowerCase(),("query_first"===a||"random_access_always"===a||"leap_frog"===a||"leap_frog_filter_first"===a||0===a.indexOf("random_access_"))&&(e.filtered.strategy=a),this)},cache:function(a){return null==a?e.filtered._cache:(e.filtered._cache=a,this)},cacheKey:function(a){return null==a?e.filtered._cache_key:(e.filtered._cache_key=a,this)}})},B.FunctionScoreQuery=function(){var a=B.QueryMixin("function_score"),b=a.toJSON();return c(a,{query:function(a){if(null==a)return b.function_score.query;if(!l(a))throw new TypeError("Argument must be a Query");return b.function_score.query=a.toJSON(),this},filter:function(a){if(null==a)return b.function_score.filter;if(!n(a))throw new TypeError("Argument must be a Filter");return b.function_score.filter=a.toJSON(),this},scoreMode:function(a){return null==a?b.function_score.score_mode:(a=a.toLowerCase(),("avg"===a||"max"===a||"min"===a||"sum"===a||"multiply"===a||"first"===a)&&(b.function_score.score_mode=a),this)},boostMode:function(a){return null==a?b.function_score.boost_mode:(a=a.toLowerCase(),("multiply"===a||"replace"===a||"sum"===a||"avg"===a||"max"===a||"min"===a)&&(b.function_score.boost_mode=a),this)},boost:function(a){return null==a?b.function_score.boost:(b.function_score.boost=a,this)},maxBoost:function(a){return null==a?b.function_score.max_boost:(b.function_score.max_boost=a,this)},minScore:function(a){return null==a?b.function_score.min_score:(b.function_score.min_score=a,this)},"function":function(a){if(null==b.function_score.functions&&(b.function_score.functions=[]),null==a)return b.function_score.functions;if(!z(a))throw new TypeError("Argument must be a ScoreFunction");return b.function_score.functions.push(a.toJSON()),this},functions:function(a){var c,d;if(null==a)return b.function_score.functions;if(!e(a))throw new TypeError("Argument must be an array of ScoreFunctions");for(b.function_score.functions=[],c=0,d=a.length;d>c;c++){if(!z(a[c]))throw new TypeError("Argument must be an array of ScoreFunctions");b.function_score.functions.push(a[c].toJSON())}return this}})},B.FuzzyLikeThisFieldQuery=function(a,b){var d=B.QueryMixin("flt_field"),e=d.toJSON();return e.flt_field[a]={like_text:b},c(d,{field:function(b){var c=e.flt_field[a];return null==b?a:(delete e.flt_field[a],a=b,e.flt_field[b]=c,this)},likeText:function(b){return null==b?e.flt_field[a].like_text:(e.flt_field[a].like_text=b,this)},ignoreTf:function(b){return null==b?e.flt_field[a].ignore_tf:(e.flt_field[a].ignore_tf=b,this)},maxQueryTerms:function(b){return null==b?e.flt_field[a].max_query_terms:(e.flt_field[a].max_query_terms=b,this)},minSimilarity:function(b){return null==b?e.flt_field[a].min_similarity:(e.flt_field[a].min_similarity=b,this)},prefixLength:function(b){return null==b?e.flt_field[a].prefix_length:(e.flt_field[a].prefix_length=b,this)},analyzer:function(b){return null==b?e.flt_field[a].analyzer:(e.flt_field[a].analyzer=b,this)},failOnUnsupportedField:function(b){return null==b?e.flt_field[a].fail_on_unsupported_field:(e.flt_field[a].fail_on_unsupported_field=b,this)},boost:function(b){return null==b?e.flt_field[a].boost:(e.flt_field[a].boost=b,this)}})},B.FuzzyLikeThisQuery=function(a){var b=B.QueryMixin("flt"),d=b.toJSON();return d.flt.like_text=a,c(b,{fields:function(a){if(null==d.flt.fields&&(d.flt.fields=[]),null==a)return d.flt.fields;if(g(a))d.flt.fields.push(a);else{if(!e(a))throw new TypeError("Argument must be a string or array");d.flt.fields=a}return this},likeText:function(a){return null==a?d.flt.like_text:(d.flt.like_text=a,this)},ignoreTf:function(a){return null==a?d.flt.ignore_tf:(d.flt.ignore_tf=a,this)},maxQueryTerms:function(a){return null==a?d.flt.max_query_terms:(d.flt.max_query_terms=a,this)},minSimilarity:function(a){return null==a?d.flt.min_similarity:(d.flt.min_similarity=a,this)},prefixLength:function(a){return null==a?d.flt.prefix_length:(d.flt.prefix_length=a,this)},analyzer:function(a){return null==a?d.flt.analyzer:(d.flt.analyzer=a,this)},failOnUnsupportedField:function(a){return null==a?d.flt.fail_on_unsupported_field:(d.flt.fail_on_unsupported_field=a,this)}})},B.FuzzyQuery=function(a,b){var d=B.QueryMixin("fuzzy"),e=d.toJSON();return e.fuzzy[a]={value:b},c(d,{field:function(b){var c=e.fuzzy[a];return null==b?a:(delete e.fuzzy[a],a=b,e.fuzzy[b]=c,this)},value:function(b){return null==b?e.fuzzy[a].value:(e.fuzzy[a].value=b,this)},transpositions:function(b){return null==b?e.fuzzy[a].transpositions:(e.fuzzy[a].transpositions=b,this)},maxExpansions:function(b){return null==b?e.fuzzy[a].max_expansions:(e.fuzzy[a].max_expansions=b,this)},minSimilarity:function(b){return null==b?e.fuzzy[a].min_similarity:(e.fuzzy[a].min_similarity=b,this)},prefixLength:function(b){return null==b?e.fuzzy[a].prefix_length:(e.fuzzy[a].prefix_length=b,this)},rewrite:function(b){return null==b?e.fuzzy[a].rewrite:(b=b.toLowerCase(),("constant_score_auto"===b||"scoring_boolean"===b||"constant_score_boolean"===b||"constant_score_filter"===b||0===b.indexOf("top_terms_boost_")||0===b.indexOf("top_terms_"))&&(e.fuzzy[a].rewrite=b),this)},boost:function(b){return null==b?e.fuzzy[a].boost:(e.fuzzy[a].boost=b,this)}})},B.GeoShapeQuery=function(a){var b=B.QueryMixin("geo_shape"),d=b.toJSON();return d.geo_shape[a]={},c(b,{field:function(b){var c=d.geo_shape[a];return null==b?a:(delete d.geo_shape[a],a=b,d.geo_shape[b]=c,this)},shape:function(b){return null==b?d.geo_shape[a].shape:(null!=d.geo_shape[a].indexed_shape&&delete d.geo_shape[a].indexed_shape,d.geo_shape[a].shape=b.toJSON(),this)},indexedShape:function(b){return null==b?d.geo_shape[a].indexed_shape:(null!=d.geo_shape[a].shape&&delete d.geo_shape[a].shape,d.geo_shape[a].indexed_shape=b.toJSON(),this)},relation:function(b){return null==b?d.geo_shape[a].relation:(b=b.toLowerCase(),("intersects"===b||"disjoint"===b||"within"===b)&&(d.geo_shape[a].relation=b),this)},strategy:function(b){return null==b?d.geo_shape[a].strategy:(b=b.toLowerCase(),("recursive"===b||"term"===b)&&(d.geo_shape[a].strategy=b),this)},boost:function(b){return null==b?d.geo_shape[a].boost:(d.geo_shape[a].boost=b,this)}})},B.HasChildQuery=function(a,b){if(!l(a))throw new TypeError("Argument must be a valid Query");var d=B.QueryMixin("has_child"),e=d.toJSON();return e.has_child.query=a.toJSON(),e.has_child.type=b,c(d,{query:function(a){if(null==a)return e.has_child.query;if(!l(a))throw new TypeError("Argument must be a valid Query");return e.has_child.query=a.toJSON(),this},type:function(a){return null==a?e.has_child.type:(e.has_child.type=a,this)},scope:function(a){return this},scoreType:function(a){return null==a?e.has_child.score_type:(a=a.toLowerCase(),("none"===a||"max"===a||"sum"===a||"avg"===a)&&(e.has_child.score_type=a),this)},scoreMode:function(a){return null==a?e.has_child.score_mode:(a=a.toLowerCase(),("none"===a||"max"===a||"sum"===a||"avg"===a)&&(e.has_child.score_mode=a),this)},shortCircuitCutoff:function(a){return null==a?e.has_child.short_circuit_cutoff:(e.has_child.short_circuit_cutoff=a,this)},innerHits:function(a){if(null==a)return e.has_child.inner_hits;if(!A(a))throw new TypeError("Argument must be a Highlight object");return e.has_child.inner_hits=a.toJSON(),this},minChildren:function(a){return null==a?e.has_child.min_children:(e.has_child.min_children=a,this)},maxChildren:function(a){return null==a?e.has_child.max_children:(e.has_child.max_children=a,this)}})},B.HasParentQuery=function(a,b){if(!l(a))throw new TypeError("Argument must be a Query");var d=B.QueryMixin("has_parent"),e=d.toJSON();return e.has_parent.query=a.toJSON(),e.has_parent.parent_type=b,c(d,{query:function(a){if(null==a)return e.has_parent.query;if(!l(a))throw new TypeError("Argument must be a Query");return e.has_parent.query=a.toJSON(), +this},parentType:function(a){return null==a?e.has_parent.parent_type:(e.has_parent.parent_type=a,this)},scope:function(a){return this},scoreType:function(a){return null==a?e.has_parent.score_type:(a=a.toLowerCase(),("none"===a||"score"===a)&&(e.has_parent.score_type=a),this)},scoreMode:function(a){return null==a?e.has_parent.score_mode:(a=a.toLowerCase(),("none"===a||"score"===a)&&(e.has_parent.score_mode=a),this)},innerHits:function(a){if(null==a)return e.has_parent.inner_hits;if(!A(a))throw new TypeError("Argument must be a Highlight object");return e.has_parent.inner_hits=a.toJSON(),this}})},B.IdsQuery=function(a){var b=B.QueryMixin("ids"),d=b.toJSON();if(g(a))d.ids.values=[a];else{if(!e(a))throw new TypeError("Argument must be string or array");d.ids.values=a}return c(b,{values:function(a){if(null==a)return d.ids.values;if(g(a))d.ids.values.push(a);else{if(!e(a))throw new TypeError("Argument must be string or array");d.ids.values=a}return this},type:function(a){if(null==d.ids.type&&(d.ids.type=[]),null==a)return d.ids.type;if(g(a))d.ids.type.push(a);else{if(!e(a))throw new TypeError("Argument must be string or array");d.ids.type=a}return this}})},B.IndicesQuery=function(a,b){if(!l(a))throw new TypeError("Argument must be a Query");var d=B.QueryMixin("indices"),f=d.toJSON();if(f.indices.query=a.toJSON(),g(b))f.indices.indices=[b];else{if(!e(b))throw new TypeError("Argument must be a string or array");f.indices.indices=b}return c(d,{indices:function(a){if(null==a)return f.indices.indices;if(g(a))f.indices.indices.push(a);else{if(!e(a))throw new TypeError("Argument must be a string or array");f.indices.indices=a}return this},query:function(a){if(null==a)return f.indices.query;if(!l(a))throw new TypeError("Argument must be a Query");return f.indices.query=a.toJSON(),this},noMatchQuery:function(a){if(null==a)return f.indices.no_match_query;if(g(a))a=a.toLowerCase(),("none"===a||"all"===a)&&(f.indices.no_match_query=a);else{if(!l(a))throw new TypeError("Argument must be string or Query");f.indices.no_match_query=a.toJSON()}return this}})},B.MatchAllQuery=function(){return B.QueryMixin("match_all")},B.MatchQuery=function(a,b){var d=B.QueryMixin("match"),e=d.toJSON();return e.match[a]={query:b},c(d,{query:function(b){return null==b?e.match[a].query:(e.match[a].query=b,this)},type:function(b){return null==b?e.match[a].type:(b=b.toLowerCase(),("boolean"===b||"phrase"===b||"phrase_prefix"===b)&&(e.match[a].type=b),this)},fuzziness:function(b){return null==b?e.match[a].fuzziness:(e.match[a].fuzziness=b,this)},cutoffFrequency:function(b){return null==b?e.match[a].cutoff_frequency:(e.match[a].cutoff_frequency=b,this)},prefixLength:function(b){return null==b?e.match[a].prefix_length:(e.match[a].prefix_length=b,this)},maxExpansions:function(b){return null==b?e.match[a].max_expansions:(e.match[a].max_expansions=b,this)},operator:function(b){return null==b?e.match[a].operator:(b=b.toLowerCase(),("and"===b||"or"===b)&&(e.match[a].operator=b),this)},slop:function(b){return null==b?e.match[a].slop:(e.match[a].slop=b,this)},analyzer:function(b){return null==b?e.match[a].analyzer:(e.match[a].analyzer=b,this)},minimumShouldMatch:function(b){return null==b?e.match[a].minimum_should_match:(e.match[a].minimum_should_match=b,this)},rewrite:function(b){return null==b?e.match[a].rewrite:(b=b.toLowerCase(),("constant_score_auto"===b||"scoring_boolean"===b||"constant_score_boolean"===b||"constant_score_filter"===b||0===b.indexOf("top_terms_boost_")||0===b.indexOf("top_terms_"))&&(e.match[a].rewrite=b),this)},fuzzyRewrite:function(b){return null==b?e.match[a].fuzzy_rewrite:(b=b.toLowerCase(),("constant_score_auto"===b||"scoring_boolean"===b||"constant_score_boolean"===b||"constant_score_filter"===b||0===b.indexOf("top_terms_boost_")||0===b.indexOf("top_terms_"))&&(e.match[a].fuzzy_rewrite=b),this)},fuzzyTranspositions:function(b){return null==b?e.match[a].fuzzy_transpositions:(e.match[a].fuzzy_transpositions=b,this)},lenient:function(b){return null==b?e.match[a].lenient:(e.match[a].lenient=b,this)},zeroTermsQuery:function(b){return null==b?e.match[a].zero_terms_query:(b=b.toLowerCase(),("all"===b||"none"===b)&&(e.match[a].zero_terms_query=b),this)},boost:function(b){return null==b?e.match[a].boost:(e.match[a].boost=b,this)}})},B.MoreLikeThisFieldQuery=function(a,b){var d=B.QueryMixin("mlt_field"),e=d.toJSON();return e.mlt_field[a]={like_text:b},c(d,{field:function(b){var c=e.mlt_field[a];return null==b?a:(delete e.mlt_field[a],a=b,e.mlt_field[b]=c,this)},likeText:function(b){return null==b?e.mlt_field[a].like_text:(e.mlt_field[a].like_text=b,this)},percentTermsToMatch:function(b){return null==b?e.mlt_field[a].percent_terms_to_match:(e.mlt_field[a].percent_terms_to_match=b,this)},minTermFreq:function(b){return null==b?e.mlt_field[a].min_term_freq:(e.mlt_field[a].min_term_freq=b,this)},maxQueryTerms:function(b){return null==b?e.mlt_field[a].max_query_terms:(e.mlt_field[a].max_query_terms=b,this)},stopWords:function(b){return null==b?e.mlt_field[a].stop_words:(e.mlt_field[a].stop_words=b,this)},minDocFreq:function(b){return null==b?e.mlt_field[a].min_doc_freq:(e.mlt_field[a].min_doc_freq=b,this)},maxDocFreq:function(b){return null==b?e.mlt_field[a].max_doc_freq:(e.mlt_field[a].max_doc_freq=b,this)},minWordLen:function(b){return null==b?e.mlt_field[a].min_word_len:(e.mlt_field[a].min_word_len=b,this)},maxWordLen:function(b){return null==b?e.mlt_field[a].max_word_len:(e.mlt_field[a].max_word_len=b,this)},analyzer:function(b){return null==b?e.mlt_field[a].analyzer:(e.mlt_field[a].analyzer=b,this)},boostTerms:function(b){return null==b?e.mlt_field[a].boost_terms:(e.mlt_field[a].boost_terms=b,this)},failOnUnsupportedField:function(b){return null==b?e.mlt_field[a].fail_on_unsupported_field:(e.mlt_field[a].fail_on_unsupported_field=b,this)},boost:function(b){return null==b?e.mlt_field[a].boost:(e.mlt_field[a].boost=b,this)}})},B.MoreLikeThisQuery=function(a){var b=B.QueryMixin("mlt"),d=b.toJSON();return d.mlt.like_text=a,c(b,{fields:function(a){if(null==a)return this;if(g(a))d.mlt.fields=[a];else{if(!e(a))throw new TypeError("Must pass a field or an array of fields");d.mlt.fields=a}return this},docs:function(a){if(!e(a))throw new TypeError("Must pass an array of docs as argument");return d.mlt.docs=a,this},likeText:function(a){return null==a?d.mlt.like_text:(d.mlt.like_text=a,this)},percentTermsToMatch:function(a){return null==a?d.mlt.percent_terms_to_match:(d.mlt.percent_terms_to_match=a,this)},minTermFreq:function(a){return null==a?d.mlt.min_term_freq:(d.mlt.min_term_freq=a,this)},maxQueryTerms:function(a){return null==a?d.mlt.max_query_terms:(d.mlt.max_query_terms=a,this)},stopWords:function(a){return null==a?d.mlt.stop_words:(d.mlt.stop_words=a,this)},minDocFreq:function(a){return null==a?d.mlt.min_doc_freq:(d.mlt.min_doc_freq=a,this)},maxDocFreq:function(a){return null==a?d.mlt.max_doc_freq:(d.mlt.max_doc_freq=a,this)},minWordLen:function(a){return null==a?d.mlt.min_word_len:(d.mlt.min_word_len=a,this)},maxWordLen:function(a){return null==a?d.mlt.max_word_len:(d.mlt.max_word_len=a,this)},analyzer:function(a){return null==a?d.mlt.analyzer:(d.mlt.analyzer=a,this)},boostTerms:function(a){return null==a?d.mlt.boost_terms:(d.mlt.boost_terms=a,this)},failOnUnsupportedField:function(a){return null==a?d.mlt.fail_on_unsupported_field:(d.mlt.fail_on_unsupported_field=a,this)}})},B.MultiMatchQuery=function(a,b){var d=B.QueryMixin("multi_match"),f=d.toJSON();if(f.multi_match.query=b,f.multi_match.fields=[],g(a))f.multi_match.fields.push(a);else{if(!e(a))throw new TypeError("Argument must be string or array");f.multi_match.fields=a}return c(d,{fields:function(a){if(null==a)return f.multi_match.fields;if(g(a))f.multi_match.fields.push(a);else{if(!e(a))throw new TypeError("Argument must be string or array");f.multi_match.fields=a}return this},useDisMax:function(a){return null==a?f.multi_match.use_dis_max:(f.multi_match.use_dis_max=a,this)},tieBreaker:function(a){return null==a?f.multi_match.tie_breaker:(f.multi_match.tie_breaker=a,this)},cutoffFrequency:function(a){return null==a?f.multi_match.cutoff_frequency:(f.multi_match.cutoff_frequency=a,this)},minimumShouldMatch:function(a){return null==a?f.multi_match.minimum_should_match:(f.multi_match.minimum_should_match=a,this)},rewrite:function(a){return null==a?f.multi_match.rewrite:(a=a.toLowerCase(),("constant_score_auto"===a||"scoring_boolean"===a||"constant_score_boolean"===a||"constant_score_filter"===a||0===a.indexOf("top_terms_boost_")||0===a.indexOf("top_terms_"))&&(f.multi_match.rewrite=a),this)},fuzzyRewrite:function(a){return null==a?f.multi_match.fuzzy_rewrite:(a=a.toLowerCase(),("constant_score_auto"===a||"scoring_boolean"===a||"constant_score_boolean"===a||"constant_score_filter"===a||0===a.indexOf("top_terms_boost_")||0===a.indexOf("top_terms_"))&&(f.multi_match.fuzzy_rewrite=a),this)},lenient:function(a){return null==a?f.multi_match.lenient:(f.multi_match.lenient=a,this)},query:function(a){return null==a?f.multi_match.query:(f.multi_match.query=a,this)},type:function(a){return null==a?f.multi_match.type:(a=a.toLowerCase(),("best_fields"===a||"most_fields"===a||"cross_fields"===a||"phrase"===a||"phrase_prefix"===a)&&(f.multi_match.type=a),this)},fuzziness:function(a){return null==a?f.multi_match.fuzziness:(f.multi_match.fuzziness=a,this)},prefixLength:function(a){return null==a?f.multi_match.prefix_length:(f.multi_match.prefix_length=a,this)},maxExpansions:function(a){return null==a?f.multi_match.max_expansions:(f.multi_match.max_expansions=a,this)},operator:function(a){return null==a?f.multi_match.operator:(a=a.toLowerCase(),("and"===a||"or"===a)&&(f.multi_match.operator=a),this)},slop:function(a){return null==a?f.multi_match.slop:(f.multi_match.slop=a,this)},analyzer:function(a){return null==a?f.multi_match.analyzer:(f.multi_match.analyzer=a,this)},zeroTermsQuery:function(a){return null==a?f.multi_match.zero_terms_query:(a=a.toLowerCase(),("all"===a||"none"===a)&&(f.multi_match.zero_terms_query=a),this)}})},B.NestedQuery=function(a){var b=B.QueryMixin("nested"),d=b.toJSON();return d.nested.path=a,c(b,{path:function(a){return null==a?d.nested.path:(d.nested.path=a,this)},query:function(a){if(null==a)return d.nested.query;if(!l(a))throw new TypeError("Argument must be a Query");return d.nested.query=a.toJSON(),this},filter:function(a){if(null==a)return d.nested.filter;if(!n(a))throw new TypeError("Argument must be a Filter");return d.nested.filter=a.toJSON(),this},scoreMode:function(a){return null==a?d.nested.score_mode:(a=a.toLowerCase(),("avg"===a||"total"===a||"max"===a||"none"===a||"sum"===a)&&(d.nested.score_mode=a),this)},scope:function(a){return this},innerHits:function(a){if(null==a)return d.nested.inner_hits;if(!A(a))throw new TypeError("Argument must be a Highlight object");return d.nested.inner_hits=a.toJSON(),this}})},B.PrefixQuery=function(a,b){var d=B.QueryMixin("prefix"),e=d.toJSON();return e.prefix[a]={value:b},c(d,{field:function(b){var c=e.prefix[a];return null==b?a:(delete e.prefix[a],a=b,e.prefix[b]=c,this)},value:function(b){return null==b?e.prefix[a].value:(e.prefix[a].value=b,this)},rewrite:function(b){return null==b?e.prefix[a].rewrite:(b=b.toLowerCase(),("constant_score_auto"===b||"scoring_boolean"===b||"constant_score_boolean"===b||"constant_score_filter"===b||0===b.indexOf("top_terms_boost_")||0===b.indexOf("top_terms_"))&&(e.prefix[a].rewrite=b),this)},boost:function(b){return null==b?e.prefix[a].boost:(e.prefix[a].boost=b,this)}})},B.QueryStringQuery=function(a){var b=B.QueryMixin("query_string"),d=b.toJSON();return d.query_string.query=a,c(b,{query:function(a){return null==a?d.query_string.query:(d.query_string.query=a,this)},defaultField:function(a){return null==a?d.query_string.default_field:(d.query_string.default_field=a,this)},fields:function(a){if(null==d.query_string.fields&&(d.query_string.fields=[]),null==a)return d.query_string.fields;if(g(a))d.query_string.fields.push(a);else{if(!e(a))throw new TypeError("Argument must be a string or array");d.query_string.fields=a}return this},useDisMax:function(a){return null==a?d.query_string.use_dis_max:(d.query_string.use_dis_max=a,this)},defaultOperator:function(a){return null==a?d.query_string.default_operator:(a=a.toUpperCase(),("AND"===a||"OR"===a)&&(d.query_string.default_operator=a),this)},analyzer:function(a){return null==a?d.query_string.analyzer:(d.query_string.analyzer=a,this)},quoteAnalyzer:function(a){return null==a?d.query_string.quote_analyzer:(d.query_string.quote_analyzer=a,this)},allowLeadingWildcard:function(a){return null==a?d.query_string.allow_leading_wildcard:(d.query_string.allow_leading_wildcard=a,this)},lowercaseExpandedTerms:function(a){return null==a?d.query_string.lowercase_expanded_terms:(d.query_string.lowercase_expanded_terms=a,this)},enablePositionIncrements:function(a){return null==a?d.query_string.enable_position_increments:(d.query_string.enable_position_increments=a,this)},fuzzyPrefixLength:function(a){return null==a?d.query_string.fuzzy_prefix_length:(d.query_string.fuzzy_prefix_length=a,this)},fuzzyMinSim:function(a){return null==a?d.query_string.fuzzy_min_sim:(d.query_string.fuzzy_min_sim=a,this)},phraseSlop:function(a){return null==a?d.query_string.phrase_slop:(d.query_string.phrase_slop=a,this)},analyzeWildcard:function(a){return null==a?d.query_string.analyze_wildcard:(d.query_string.analyze_wildcard=a,this)},autoGeneratePhraseQueries:function(a){return null==a?d.query_string.auto_generate_phrase_queries:(d.query_string.auto_generate_phrase_queries=a,this)},minimumShouldMatch:function(a){return null==a?d.query_string.minimum_should_match:(d.query_string.minimum_should_match=a,this)},tieBreaker:function(a){return null==a?d.query_string.tie_breaker:(d.query_string.tie_breaker=a,this)},escape:function(a){return null==a?d.query_string.escape:(d.query_string.escape=a,this)},fuzzyMaxExpansions:function(a){return null==a?d.query_string.fuzzy_max_expansions:(d.query_string.fuzzy_max_expansions=a,this)},fuzzyRewrite:function(a){return null==a?d.query_string.fuzzy_rewrite:(a=a.toLowerCase(),("constant_score_auto"===a||"scoring_boolean"===a||"constant_score_boolean"===a||"constant_score_filter"===a||0===a.indexOf("top_terms_boost_")||0===a.indexOf("top_terms_"))&&(d.query_string.fuzzy_rewrite=a),this)},rewrite:function(a){return null==a?d.query_string.rewrite:(a=a.toLowerCase(),("constant_score_auto"===a||"scoring_boolean"===a||"constant_score_boolean"===a||"constant_score_filter"===a||0===a.indexOf("top_terms_boost_")||0===a.indexOf("top_terms_"))&&(d.query_string.rewrite=a),this)},quoteFieldSuffix:function(a){return null==a?d.query_string.quote_field_suffix:(d.query_string.quote_field_suffix=a,this)},lenient:function(a){return null==a?d.query_string.lenient:(d.query_string.lenient=a,this)}})},B.RangeQuery=function(a){var b=B.QueryMixin("range"),d=b.toJSON();return d.range[a]={},c(b,{field:function(b){var c=d.range[a];return null==b?a:(delete d.range[a],a=b,d.range[b]=c,this)},from:function(b){return null==b?d.range[a].from:(d.range[a].from=b,this)},to:function(b){return null==b?d.range[a].to:(d.range[a].to=b,this)},includeLower:function(b){return null==b?d.range[a].include_lower:(d.range[a].include_lower=b,this)},includeUpper:function(b){return null==b?d.range[a].include_upper:(d.range[a].include_upper=b,this)},gt:function(b){return null==b?d.range[a].gt:(d.range[a].gt=b,this)},gte:function(b){return null==b?d.range[a].gte:(d.range[a].gte=b,this)},lt:function(b){return null==b?d.range[a].lt:(d.range[a].lt=b,this)},lte:function(b){return null==b?d.range[a].lte:(d.range[a].lte=b,this)},boost:function(b){return null==b?d.range[a].boost:(d.range[a].boost=b,this)}})},B.RegexpQuery=function(a,b){var d=B.QueryMixin("regexp"),e=d.toJSON();return e.regexp[a]={value:b},c(d,{field:function(b){var c=e.regexp[a];return null==b?a:(delete e.regexp[a],a=b,e.regexp[b]=c,this)},value:function(b){return null==b?e.regexp[a].value:(e.regexp[a].value=b,this)},flags:function(b){return null==b?e.regexp[a].flags:(e.regexp[a].flags=b,this)},flagsValue:function(b){return null==b?e.regexp[a].flags_value:(e.regexp[a].flags_value=b,this)},rewrite:function(b){return null==b?e.regexp[a].rewrite:(b=b.toLowerCase(),("constant_score_auto"===b||"scoring_boolean"===b||"constant_score_boolean"===b||"constant_score_filter"===b||0===b.indexOf("top_terms_boost_")||0===b.indexOf("top_terms_"))&&(e.regexp[a].rewrite=b),this)},boost:function(b){return null==b?e.regexp[a].boost:(e.regexp[a].boost=b,this)}})},B.SpanFirstQuery=function(a,b){if(!l(a))throw new TypeError("Argument must be a SpanQuery");var d=B.QueryMixin("span_first"),e=d.toJSON();return e.span_first.match=a.toJSON(),e.span_first.end=b,c(d,{match:function(a){if(null==a)return e.span_first.match;if(!l(a))throw new TypeError("Argument must be a SpanQuery");return e.span_first.match=a.toJSON(),this},end:function(a){return null==a?e.span_first.end:(e.span_first.end=a,this)}})},B.SpanMultiTermQuery=function(a){if(null!=a&&!l(a))throw new TypeError("Argument must be a MultiTermQuery");var b=B.QueryMixin("span_multi"),d=b.toJSON();return d.span_multi.match={},null!=a&&(d.span_multi.match=a.toJSON()),c(b,{match:function(a){if(null==a)return d.span_multi.match;if(!l(a))throw new TypeError("Argument must be a MultiTermQuery");return d.span_multi.match=a.toJSON(),this}})},B.SpanNearQuery=function(a,b){var d,f,g=B.QueryMixin("span_near"),h=g.toJSON();if(h.span_near.clauses=[],h.span_near.slop=b,l(a))h.span_near.clauses.push(a.toJSON());else{if(!e(a))throw new TypeError("Argument must be SpanQuery or array of SpanQueries");for(d=0,f=a.length;f>d;d++){if(!l(a[d]))throw new TypeError("Argument must be array of SpanQueries");h.span_near.clauses.push(a[d].toJSON())}}return c(g,{clauses:function(a){var b,c;if(null==a)return h.span_near.clauses;if(l(a))h.span_near.clauses.push(a.toJSON());else{if(!e(a))throw new TypeError("Argument must be SpanQuery or array of SpanQueries");for(h.span_near.clauses=[],b=0,c=a.length;c>b;b++){if(!l(a[b]))throw new TypeError("Argument must be array of SpanQueries");h.span_near.clauses.push(a[b].toJSON())}}return this},slop:function(a){return null==a?h.span_near.slop:(h.span_near.slop=a,this)},inOrder:function(a){return null==a?h.span_near.in_order:(h.span_near.in_order=a,this)},collectPayloads:function(a){return null==a?h.span_near.collect_payloads:(h.span_near.collect_payloads=a,this)}})},B.SpanNotQuery=function(a,b){if(!l(a)||!l(b))throw new TypeError("Argument must be a SpanQuery");var d=B.QueryMixin("span_not"),e=d.toJSON();return e.span_not.include=a.toJSON(),e.span_not.exclude=b.toJSON(),c(d,{include:function(a){if(null==a)return e.span_not.include;if(!l(a))throw new TypeError("Argument must be a SpanQuery");return e.span_not.include=a.toJSON(),this},exclude:function(a){if(null==a)return e.span_not.exclude;if(!l(a))throw new TypeError("Argument must be a SpanQuery");return e.span_not.exclude=a.toJSON(),this}})},B.SpanOrQuery=function(a){var b,d,f=B.QueryMixin("span_or"),g=f.toJSON();if(g.span_or.clauses=[],l(a))g.span_or.clauses.push(a.toJSON());else{if(!e(a))throw new TypeError("Argument must be SpanQuery or array of SpanQueries");for(b=0,d=a.length;d>b;b++){if(!l(a[b]))throw new TypeError("Argument must be array of SpanQueries");g.span_or.clauses.push(a[b].toJSON())}}return c(f,{clauses:function(a){var b,c;if(null==a)return g.span_or.clauses;if(l(a))g.span_or.clauses.push(a.toJSON());else{if(!e(a))throw new TypeError("Argument must be SpanQuery or array of SpanQueries");for(g.span_or.clauses=[],b=0,c=a.length;c>b;b++){if(!l(a[b]))throw new TypeError("Argument must be array of SpanQueries");g.span_or.clauses.push(a[b].toJSON())}}return this}})},B.SpanTermQuery=function(a,b){var d=B.QueryMixin("span_term"),e=d.toJSON();return e.span_term[a]={term:b},c(d,{field:function(b){var c=e.span_term[a];return null==b?a:(delete e.span_term[a],a=b,e.span_term[b]=c,this)},term:function(b){return null==b?e.span_term[a].term:(e.span_term[a].term=b,this)},boost:function(b){return null==b?e.span_term[a].boost:(e.span_term[a].boost=b,this)}})},B.TermQuery=function(a,b){var d=B.QueryMixin("term"),e=d.toJSON();return e.term[a]={term:b},c(d,{field:function(b){var c=e.term[a];return null==b?a:(delete e.term[a],a=b,e.term[b]=c,this)},term:function(b){return null==b?e.term[a].term:(e.term[a].term=b,this)},boost:function(b){return null==b?e.term[a].boost:(e.term[a].boost=b,this)}})},B.TermsQuery=function(a,b){var d=B.QueryMixin("terms"),f=d.toJSON();if(g(b))f.terms[a]=[b];else{if(!e(b))throw new TypeError("Argument must be string or array");f.terms[a]=b}return c(d,{field:function(b){var c=f.terms[a];return null==b?a:(delete f.terms[a],a=b,f.terms[b]=c,this)},terms:function(b){if(null==b)return f.terms[a];if(g(b))f.terms[a].push(b);else{if(!e(b))throw new TypeError("Argument must be string or array");f.terms[a]=b}return this},minimumShouldMatch:function(a){return null==a?f.terms.minimum_should_match:(f.terms.minimum_should_match=a,this)},disableCoord:function(a){return null==a?f.terms.disable_coord:(f.terms.disable_coord=a,this)}})},B.TopChildrenQuery=function(a,b){if(!l(a))throw new TypeError("Argument must be a Query");var d=B.QueryMixin("top_children"),e=d.toJSON();return e.top_children.query=a.toJSON(),e.top_children.type=b,c(d,{query:function(a){if(null==a)return e.top_children.query;if(!l(a))throw new TypeError("Argument must be a Query");return e.top_children.query=a.toJSON(),this},type:function(a){return null==a?e.top_children.type:(e.top_children.type=a,this)},scope:function(a){return this},score:function(a){return null==a?e.top_children.score:(a=a.toLowerCase(),("max"===a||"sum"===a||"avg"===a||"total"===a)&&(e.top_children.score=a),this)},scoreMode:function(a){return null==a?e.top_children.score_mode:(a=a.toLowerCase(),("max"===a||"sum"===a||"avg"===a||"total"===a)&&(e.top_children.score_mode=a),this)},factor:function(a){return null==a?e.top_children.factor:(e.top_children.factor=a,this)},incrementalFactor:function(a){return null==a?e.top_children.incremental_factor:(e.top_children.incremental_factor=a,this)}})},B.WildcardQuery=function(a,b){var d=B.QueryMixin("wildcard"),e=d.toJSON();return e.wildcard[a]={value:b},c(d,{field:function(b){var c=e.wildcard[a];return null==b?a:(delete e.wildcard[a],a=b,e.wildcard[b]=c,this)},value:function(b){return null==b?e.wildcard[a].value:(e.wildcard[a].value=b,this)},rewrite:function(b){return null==b?e.wildcard[a].rewrite:(b=b.toLowerCase(),("constant_score_auto"===b||"scoring_boolean"===b||"constant_score_boolean"===b||"constant_score_filter"===b||0===b.indexOf("top_terms_boost_")||0===b.indexOf("top_terms_"))&&(e.wildcard[a].rewrite=b),this)},boost:function(b){return null==b?e.wildcard[a].boost:(e.wildcard[a].boost=b,this)}})},B.BoostFactorScoreFunction=function(a){var b=B.ScoreFunctionMixin("boost_factor"),d=b.toJSON();return d.boost_factor=a,c(b,{boost:function(a){return null==a?d.boost_factor:(d.boost_factor=a,this)}})},B.DecayScoreFunction=function(a){var b="gauss",d=B.ScoreFunctionMixin(b),e=d.toJSON(),f=function(a){var c;b!==a&&(c=e[b],delete e[b],b=a,e[b]=c)};return e[b][a]={},c(d,{linear:function(){f("linear")},exp:function(){f("exp")},gauss:function(){f("gauss")},field:function(c){var d=e[b][a];return null==c?a:(delete e[b][a],a=c,e[b][a]=d,this)},scale:function(c){return null==c?e[b][a].scale:(e[b][a].scale=c,this)},origin:function(c){if(null==c)return e[b][a].origin;if(s(c))e[b][a].origin=c.toJSON();else{if(k(c))throw new TypeError("origin must be a GeoPoint or native type");e[b][a].origin=c}return this},decay:function(c){return null==c?e[b][a].decay:(e[b][a].decay=c,this)},offset:function(c){return null==c?e[b][a].offset:(e[b][a].offset=c,this)}})},B.FieldValueFactorFunction=function(a){var b=B.ScoreFunctionMixin("field_value_factor"),d=b.toJSON();return d.field_value_factor.field=a,c(b,{factor:function(a){return null==a?d.field_value_factor.factor:(d.field_value_factor.factor=a,this)},modifier:function(a){return null==a?d.field_value_factor.modifier:(d.field_value_factor.modifier=a,this)}})},B.RandomScoreFunction=function(){var a=B.ScoreFunctionMixin("random_score"),b=a.toJSON();return c(a,{seed:function(a){return null==a?b.random_score.seed:(b.random_score.seed=a,this)}})},B.ScoreFunction=function(){var a=B.ScoreFunctionMixin();return a},B.ScriptScoreFunction=function(){var a=B.ScoreFunctionMixin("script_score"),b=a.toJSON();return c(a,{script:function(a){return null==a?b.script_score.script:(b.script_score.script=a,b.script_score.script_id&&delete b.script_score.script_id,this)},scriptId:function(a){return null==a?b.script_score.scriptId:(b.script_score.script_id=a,b.script_score.script&&delete b.script_score.script,this)},lang:function(a){return null==a?b.script_score.lang:(b.script_score.lang=a,this)},params:function(a){return null==a?b.script_score.params:(b.script_score.params=a,this)}})},B.GeoPoint=function(b){var c=[0,0];return null!=b&&e(b)&&2===b.length&&(c=[b[1],b[0]]),{properties:function(b){return null==b?c:(f(b)&&a(b,"lat")&&a(b,"lon")?c={lat:b.lat,lon:b.lon}:f(b)&&a(b,"geohash")&&(c={geohash:b.geohash}),this)},string:function(a){return null==a?c:(g(a)&&-1!==a.indexOf(",")&&(c=a),this)},geohash:function(a,b){return b=null!=b&&h(b)?b:12,null==a?c:(g(a)&&a.length===b&&(c=a),this)},array:function(a){return null==a?c:(e(a)&&2===a.length&&(c=[a[1],a[0]]),this)},_type:function(){return"geo point"},toJSON:function(){return c}}},B.Highlight=function(c){var d={fields:{}},h=function(b,c,e){null==b?d[c]=e:(a(d.fields,b)||(d.fields[b]={}),d.fields[b][c]=e)};return null!=c&&(g(c)?d.fields[c]={}:e(c)&&b(c,function(a){d.fields[a]={}})),{fields:function(c){return null==c?d.fields:void(g(c)?a(d.fields,c)||(d.fields[c]={}):e(c)&&b(c,function(b){a(d.fields,b)||(d.fields[b]={})}))},preTags:function(a,b){return null===a&&null!=b?d.fields[b].pre_tags:null==a?d.pre_tags:(g(a)?h(b,"pre_tags",[a]):e(a)&&h(b,"pre_tags",a),this)},postTags:function(a,b){return null===a&&null!=b?d.fields[b].post_tags:null==a?d.post_tags:(g(a)?h(b,"post_tags",[a]):e(a)&&h(b,"post_tags",a),this)},order:function(a,b){return null===a&&null!=b?d.fields[b].order:null==a?d.order:(a=a.toLowerCase(),"score"===a&&h(b,"order",a),this)},tagsSchema:function(a){return null==a?d.tags_schema:(a=a.toLowerCase(),"styled"===a&&(d.tags_schema=a),this)},highlightFilter:function(a,b){return null===a&&null!=b?d.fields[b].highlight_filter:null==a?d.highlight_filter:(h(b,"highlight_filter",a),this)},fragmentSize:function(a,b){return null===a&&null!=b?d.fields[b].fragment_size:null==a?d.fragment_size:(h(b,"fragment_size",a),this)},numberOfFragments:function(a,b){return null===a&&null!=b?d.fields[b].number_of_fragments:null==a?d.number_of_fragments:(h(b,"number_of_fragments",a),this)},encoder:function(a){return null==a?d.encoder:(a=a.toLowerCase(),("default"===a||"html"===a)&&(d.encoder=a),this)},requireFieldMatch:function(a,b){return null===a&&null!=b?d.fields[b].require_field_match:null==a?d.require_field_match:(h(b,"require_field_match",a),this)},boundaryMaxScan:function(a,b){return null===a&&null!=b?d.fields[b].boundary_max_scan:null==a?d.boundary_max_scan:(h(b,"boundary_max_scan",a),this)},boundaryChars:function(a,b){return null===a&&null!=b?d.fields[b].boundary_chars:null==a?d.boundary_chars:(h(b,"boundary_chars",a),this)},type:function(a,b){return null===a&&null!=b?d.fields[b].type:null==a?d.type:(a=a.toLowerCase(),("fvh"===a||"plain"===a||"postings"===a)&&h(b,"type",a),this)},fragmenter:function(a,b){return null===a&&null!=b?d.fields[b].fragmenter:null==a?d.fragmenter:(a=a.toLowerCase(),("simple"===a||"span"===a)&&h(b,"fragmenter",a),this)},options:function(a,b){if(null===a&&null!=b)return d.fields[b].options;if(null==a)return d.options;if(!f(a)||e(a)||k(a))throw new TypeError("Parameter must be an object");return h(b,"options",a),this},_type:function(){return"highlight"},toJSON:function(){return d}}},B.IndexedShape=function(a,b){var c={type:a,id:b};return{type:function(a){return null==a?c.type:(c.type=a,this)},id:function(a){return null==a?c.id:(c.id=a,this)},index:function(a){return null==a?c.index:(c.index=a,this)},shapeFieldName:function(a){return null==a?c.shape_field_name:(c.shape_field_name=a,this)},_type:function(){return"indexed shape"},toJSON:function(){return c}}},B.InnerHits=function(){var a={};return{name:function(b){return null===b?a.name:(a.name=b,this)},from:function(b){return null===b?a.from:(a.from=b,this)},size:function(b){return null===b?a.size:(a.size=b,this)},sort:function(b){return null===b?a.sort:(a.sort=b,this)},version:function(b){return null===b?a.version:(a.version=b,this)},explain:function(b){return null===b?a.explain:(a.explain=b,this)},highlight:function(b){if(null===b)return a.highlight;if(!w(b))throw new TypeError("Argument must be a Highlight object");return a.highlight=b.toJSON(),this},scriptField:function(b){if(null===b)return a.script_fields;if(void 0===a.script_fields&&(a.script_fields={}),!r(b))throw new TypeError("Argument must be a ScriptField");return c(a.script_fields,b.toJSON()),this},fieldDataFields:function(b){return null===b?a.fielddata_fields:(a.fielddata_fields=b,this)},source:function(b,c){if(void 0===b&&void 0===c)return a._source;if(!e(b)&&!g(b)&&!i(b))throw new TypeError("Argument includes must be a string, an array, or a boolean");if(void 0!==c&&!e(c)&&!g(c))throw new TypeError("Argument excludes must be a string or an array");return i(b)?a._source=b:(a._source={includes:b},null!=c&&(a._source.excludes=c)),this},_type:function(){return"inner hits"},toJSON:function(){return a}}},B.PartialField=function(a){var b={};return b[a]={},{include:function(c){if(null==c)return b[a].include;if(!e(c)&&!g(c))throw new TypeError("Argument include must be a string or an array");return b[a].include=c,this},exclude:function(c){if(null==c)return b[a].exclude;if(!e(c)&&!g(c))throw new TypeError("Argument exclude must be a string or an array");return b[a].exclude=c,this},_type:function(){return"partial field"},toJSON:function(){return b}}},B.Request=function(){var b={};return{sort:function(){var c,d;if(a(b,"sort")||(b.sort=[]),0===arguments.length)return b.sort;if(1===arguments.length){var f=arguments[0];if(g(f))b.sort.push(f);else if(v(f))b.sort.push(f.toJSON());else{if(!e(f))throw new TypeError("Argument must be string, Sort, or array");for(b.sort=[],c=0,d=f.length;d>c;c++)if(g(f[c]))b.sort.push(f[c]);else{if(!v(f[c]))throw new TypeError("Invalid object in array");b.sort.push(f[c].toJSON())}}}else if(2===arguments.length){var h=arguments[0],i=arguments[1];if(g(h)&&g(i)&&(i=i.toLowerCase(),"asc"===i||"desc"===i)){var j={};j[h]={order:i},b.sort.push(j)}}return this},trackScores:function(a){return null==a?b.track_scores:(b.track_scores=a,this)},from:function(a){return null==a?b.from:(b.from=a,this)},size:function(a){return null==a?b.size:(b.size=a,this)},timeout:function(a){return null==a?b.timeout:(b.timeout=a,this)},fields:function(a){if(null==a)return b.fields;if(null==b.fields&&(b.fields=[]),g(a))b.fields.push(a);else{if(!e(a))throw new TypeError("Argument must be a string or an array");b.fields=a}return this},source:function(a,c){if(null==a&&null==c)return b._source;if(!e(a)&&!g(a)&&!i(a))throw new TypeError("Argument includes must be a string, an array, or a boolean");if(null!=c&&!e(c)&&!g(c))throw new TypeError("Argument excludes must be a string or an array");return i(a)?b._source=a:(b._source={includes:a},null!=c&&(b._source.excludes=c)),this},partialField:function(a){if(null==a)return b.partial_fields;if(null==b.partial_fields&&(b.partial_fields={}),!q(a))throw new TypeError("Argument must be a PartialField");return c(b.partial_fields,a.toJSON()),this},rescore:function(a){if(null==a)return b.rescore;if(!m(a))throw new TypeError("Argument must be a Rescore");return b.rescore=a.toJSON(),this},query:function(a){if(null==a)return b.query;if(!l(a))throw new TypeError("Argument must be a Query");return b.query=a.toJSON(),this},facet:function(a){if(null==a)return b.facets;if(null==b.facets&&(b.facets={}), +!o(a))throw new TypeError("Argument must be a Facet");return c(b.facets,a.toJSON()),this},aggregation:function(a){if(null==a)return b.aggs;if(null==b.aggs&&(b.aggs={}),!p(a))throw new TypeError("Argument must be an Aggregation");return c(b.aggs,a.toJSON()),this},agg:function(a){return this.aggregation(a)},filter:function(a){if(null==a)return b.filter;if(!n(a))throw new TypeError("Argument must be a Filter");return b.filter=a.toJSON(),this},post_filter:function(a){if(null==a)return b.filter;if(!n(a))throw new TypeError("Argument must be a Filter");return b.post_filter=a.toJSON(),this},highlight:function(a){if(null==a)return b.highlight;if(!w(a))throw new TypeError("Argument must be a Highlight object");return b.highlight=a.toJSON(),this},suggest:function(a){if(null==a)return b.suggest;if(null==b.suggest&&(b.suggest={}),g(a))b.suggest.text=a;else{if(!x(a))throw new TypeError("Argument must be a string or Suggest object");c(b.suggest,a.toJSON())}return this},scriptField:function(a){if(null==a)return b.script_fields;if(null==b.script_fields&&(b.script_fields={}),!r(a))throw new TypeError("Argument must be a ScriptField");return c(b.script_fields,a.toJSON()),this},indexBoost:function(a,c){return null==b.indices_boost&&(b.indices_boost={}),0===arguments.length?b.indices_boost:(b.indices_boost[a]=c,this)},explain:function(a){return null==a?b.explain:(b.explain=a,this)},version:function(a){return null==a?b.version:(b.version=a,this)},minScore:function(a){return null==a?b.min_score:(b.min_score=a,this)},_type:function(){return"request"},toJSON:function(){return b}}},B.Rescore=function(a,b){if(null!=a&&!h(a))throw new TypeError("Argument must be a Number");if(null!=b&&!l(b))throw new TypeError("Argument must be a Query");var c={query:{}};return null!=a&&(c.window_size=a),null!=b&&(c.query.rescore_query=b.toJSON()),{rescoreQuery:function(a){if(null==a)return c.query.rescore_query;if(!l(a))throw new TypeError("Argument must be a Query");return c.query.rescore_query=a.toJSON(),this},queryWeight:function(a){if(null==a)return c.query.query_weight;if(!h(a))throw new TypeError("Argument must be a Number");return c.query.query_weight=a,this},rescoreQueryWeight:function(a){if(null==a)return c.query.rescore_query_weight;if(!h(a))throw new TypeError("Argument must be a Number");return c.query.rescore_query_weight=a,this},windowSize:function(a){if(null==a)return c.window_size;if(!h(a))throw new TypeError("Argument must be a Number");return c.window_size=a,this},scoreMode:function(a){return null==a?c.query.score_mode:(a=a.toLowerCase(),("total"===a||"min"===a||"max"===a||"multiply"===a||"avg"===a)&&(c.query.score_mode=a),this)},_type:function(){return"rescore"},toJSON:function(){return c}}},B.ScriptField=function(a){var b={};return b[a]={},{lang:function(c){return null==c?b[a].lang:(b[a].lang=c,this)},script:function(c){return null==c?b[a].script:(b[a].script=c,this)},params:function(c){return null==c?b[a].params:(b[a].params=c,this)},ignoreFailure:function(c){return null==c?b[a].ignore_failure:(b[a].ignore_failure=c,this)},_type:function(){return"script field"},toJSON:function(){return b}}},B.Shape=function(a,b){var c={},d=function(a){var b=!1;return("point"===a||"linestring"===a||"polygon"===a||"multipoint"===a||"envelope"===a||"multipolygon"===a||"circle"===a||"multilinestring"===a)&&(b=!0),b};return a=a.toLowerCase(),d(a)&&(c.type=a,c.coordinates=b),{type:function(a){return null==a?c.type:(a=a.toLowerCase(),d(a)&&(c.type=a),this)},coordinates:function(a){return null==a?c.coordinates:(c.coordinates=a,this)},radius:function(a){return null==a?c.radius:(c.radius=a,this)},_type:function(){return"shape"},toJSON:function(){return c}}},B.Sort=function(a){null==a&&(a="_score");var b={},c=a,d="_geo_distance",e="_script";return b[c]={},{field:function(d){var e=b[c];return null==d?a:(delete b[c],a=d,c=d,b[c]=e,this)},geoDistance:function(e){var f=b[c];if(null==e)return b[c][a];if(!s(e))throw new TypeError("Argument must be a GeoPoint");return delete b[c],c=d,b[c]=f,b[c][a]=e.toJSON(),this},script:function(a){var d=b[c];return null==a?b[c].script:(delete b[c],c=e,b[c]=d,b[c].script=a,this)},order:function(a){return null==a?b[c].order:(a=a.toLowerCase(),("asc"===a||"desc"===a)&&(b[c].order=a),this)},asc:function(){return b[c].order="asc",this},desc:function(){return b[c].order="desc",this},reverse:function(a){return null==a?b[c].reverse:(b[c].reverse=a,this)},missing:function(a){return null==a?b[c].missing:(b[c].missing=a,this)},ignoreUnmapped:function(a){return null==a?b[c].ignore_unmapped:(b[c].ignore_unmapped=a,this)},unit:function(a){return null==a?b[c].unit:(a=a.toLowerCase(),("mi"===a||"km"===a)&&(b[c].unit=a),this)},normalize:function(a){return null==a?b[c].normalize:(b[c].normalize=a,this)},distanceType:function(a){return null==a?b[c].distance_type:(a=a.toLowerCase(),("arc"===a||"plane"===a)&&(b[c].distance_type=a),this)},params:function(a){return null==a?b[c].params:(b[c].params=a,this)},lang:function(a){return null==a?b[c].lang:(b[c].lang=a,this)},type:function(a){return null==a?b[c].type:(a=a.toLowerCase(),("string"===a||"number"===a)&&(b[c].type=a),this)},mode:function(a){return null==a?b[c].mode:(a=a.toLowerCase(),("min"===a||"max"===a||"sum"===a||"avg"===a)&&(b[c].mode=a),this)},nestedPath:function(a){return null==a?b[c].nested_path:(b[c].nested_path=a,this)},nestedFilter:function(a){if(null==a)return b[c].nested_filter;if(!n(a))throw new TypeError("Argument must be a Filter");return b[c].nested_filter=a.toJSON(),this},_type:function(){return"sort"},toJSON:function(){return b}}},B.CompletionSuggester=function(a){var b,d=B.SuggesterMixin(a),e=d.toJSON();return e[a].completion={},b=B.SuggestContextMixin(e[a].completion),c(d,b,{fuzzy:function(b){return null==b?e[a].completion.fuzzy:(b&&null==e[a].completion.fuzzy?e[a].completion.fuzzy={}:b||null==e[a].completion.fuzzy||delete e[a].completion.fuzzy,this)},transpositions:function(b){return null==e[a].completion.fuzzy&&(e[a].completion.fuzzy={}),null==b?e[a].completion.fuzzy.transpositions:(e[a].completion.fuzzy.transpositions=b,this)},unicodeAware:function(b){return null==e[a].completion.fuzzy&&(e[a].completion.fuzzy={}),null==b?e[a].completion.fuzzy.unicode_aware:(e[a].completion.fuzzy.unicode_aware=b,this)},editDistance:function(b){return null==e[a].completion.fuzzy&&(e[a].completion.fuzzy={}),null==b?e[a].completion.fuzzy.edit_distance:(e[a].completion.fuzzy.edit_distance=b,this)},minLength:function(b){return null==e[a].completion.fuzzy&&(e[a].completion.fuzzy={}),null==b?e[a].completion.fuzzy.min_length:(e[a].completion.fuzzy.min_length=b,this)},prefixLength:function(b){return null==e[a].completion.fuzzy&&(e[a].completion.fuzzy={}),null==b?e[a].completion.fuzzy.prefix_length:(e[a].completion.fuzzy.prefix_length=b,this)}})},B.DirectGenerator=function(){var a={},b=B.DirectSettingsMixin(a);return c(b,{preFilter:function(b){return null==b?a.pre_filter:(a.pre_filter=b,this)},postFilter:function(b){return null==b?a.post_filter:(a.post_filter=b,this)},field:function(b){return null==b?a.field:(a.field=b,this)},size:function(b){return null==b?a.size:(a.size=b,this)},_type:function(){return"generator"},toJSON:function(){return a}})},B.PhraseSuggester=function(a){var b,d=B.SuggesterMixin(a),f=d.toJSON();return f[a].phrase={},b=B.SuggestContextMixin(f[a].phrase),c(d,b,{realWordErrorLikelihood:function(b){return null==b?f[a].phrase.real_word_error_likelihood:(f[a].phrase.real_word_error_likelihood=b,this)},confidence:function(b){return null==b?f[a].phrase.confidence:(f[a].phrase.confidence=b,this)},separator:function(b){return null==b?f[a].phrase.separator:(f[a].phrase.separator=b,this)},maxErrors:function(b){return null==b?f[a].phrase.max_errors:(f[a].phrase.max_errors=b,this)},gramSize:function(b){return null==b?f[a].phrase.gram_size:(f[a].phrase.gram_size=b,this)},forceUnigrams:function(b){return null==b?f[a].phrase.force_unigrams:(f[a].phrase.force_unigrams=b,this)},tokenLimit:function(b){return null==b?f[a].phrase.token_limit:(f[a].phrase.token_limit=b,this)},linearSmoothing:function(b,c,d){return 0===arguments.length?f[a].phrase.smoothing:(f[a].phrase.smoothing={linear:{trigram_lambda:b,bigram_lambda:c,unigram_lambda:d}},this)},laplaceSmoothing:function(b){return null==b?f[a].phrase.smoothing:(f[a].phrase.smoothing={laplace:{alpha:b}},this)},stupidBackoffSmoothing:function(b){return null==b?f[a].phrase.smoothing:(f[a].phrase.smoothing={stupid_backoff:{discount:b}},this)},highlight:function(b,c){return 0===arguments.length?f[a].phrase.highlight:(f[a].phrase.highlight={pre_tag:b,post_tag:c},this)},directGenerator:function(b){var c,d;if(null==f[a].phrase.direct_generator&&(f[a].phrase.direct_generator=[]),null==b)return f[a].phrase.direct_generator;if(y(b))f[a].phrase.direct_generator.push(b.toJSON());else{if(!e(b))throw new TypeError("Argument must be a Generator or array of Generators");for(f[a].phrase.direct_generator=[],c=0,d=b.length;d>c;c++){if(!y(b[c]))throw new TypeError("Argument must be an array of Generators");f[a].phrase.direct_generator.push(b[c].toJSON())}}return this}})},B.TermSuggester=function(a){var b,d,e=B.SuggesterMixin(a),f=e.toJSON();return f[a].term={},b=B.DirectSettingsMixin(f[a].term),d=B.SuggestContextMixin(f[a].term),c(e,b,d)},B.noConflict=function(){return C.ejs=D,this}}).call(this); \ No newline at end of file diff --git a/package.json b/package.json index 92c8260..38e45a6 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "elastic.js", "description": "Javascript API for ElasticSearch DSL", - "version": "1.2.0", + "version": "1.3.9", "homepage": "https://github.com/fullscale/elastic.js", "keywords": [ "elasticsearch", diff --git a/src/aggregations/AvgAggregation.js b/src/aggregations/AvgAggregation.js index c965d18..4eb45c4 100644 --- a/src/aggregations/AvgAggregation.js +++ b/src/aggregations/AvgAggregation.js @@ -9,8 +9,9 @@ @ejs aggregation @borrows ejs.MetricsAggregationMixin.field as field @borrows ejs.MetricsAggregationMixin.script as script + @borrows ejs.MetricsAggregationMixin.scriptId as scriptId + @borrows ejs.MetricsAggregationMixin.scriptFile as scriptFile @borrows ejs.MetricsAggregationMixin.lang as lang - @borrows ejs.MetricsAggregationMixin.scriptValuesSorted as scriptValuesSorted @borrows ejs.MetricsAggregationMixin.params as params @borrows ejs.AggregationMixin._type as _type @borrows ejs.AggregationMixin.toJSON as toJSON diff --git a/src/aggregations/CardinalityAggregation.js b/src/aggregations/CardinalityAggregation.js index 64c3fa3..60bb6e7 100644 --- a/src/aggregations/CardinalityAggregation.js +++ b/src/aggregations/CardinalityAggregation.js @@ -8,6 +8,8 @@ @ejs aggregation @borrows ejs.MetricsAggregationMixin.field as field @borrows ejs.MetricsAggregationMixin.script as script + @borrows ejs.MetricsAggregationMixin.scriptId as scriptId + @borrows ejs.MetricsAggregationMixin.scriptFile as scriptFile @borrows ejs.MetricsAggregationMixin.lang as lang @borrows ejs.MetricsAggregationMixin.params as params @borrows ejs.AggregationMixin._type as _type @@ -25,9 +27,6 @@ _common = ejs.MetricsAggregationMixin(name, 'cardinality'), agg = _common.toJSON(); - // not supported in cardinality aggregation - delete _common.scriptValuesSorted; - return extend(_common, { /** diff --git a/src/aggregations/ChildrenAggregation.js b/src/aggregations/ChildrenAggregation.js new file mode 100644 index 0000000..42ad114 --- /dev/null +++ b/src/aggregations/ChildrenAggregation.js @@ -0,0 +1,47 @@ + /** + @class +

A special single bucket aggregation that enables aggregating children + documents.

+ + @name ejs.ChildrenAggregation + @ejs aggregation + @borrows ejs.AggregationMixin.aggregation as aggregation + @borrows ejs.AggregationMixin.agg as agg + @borrows ejs.AggregationMixin._type as _type + @borrows ejs.AggregationMixin.toJSON as toJSON + + @desc +

A special single bucket aggregation that enables aggregating children + documents.

+ + @param {String} name The name which be used to refer to this aggregation. + + */ + ejs.ChildrenAggregation = function (name) { + + var + _common = ejs.AggregationMixin(name), + agg = _common.toJSON(); + + agg[name].children = {}; + + return extend(_common, { + + /** +

Sets the children type.

+ + @member ejs.ChildrenAggregation + @param {String} children The children type value. + @returns {Object} returns this so that calls can be chained. + */ + children: function (children) { + if (children == null) { + return agg[name].children.type; + } + + agg[name].children.type = children; + return this; + } + + }); + }; diff --git a/src/aggregations/DateHistogramAggregation.js b/src/aggregations/DateHistogramAggregation.js index d81db83..d028638 100644 --- a/src/aggregations/DateHistogramAggregation.js +++ b/src/aggregations/DateHistogramAggregation.js @@ -27,61 +27,11 @@ ejs.DateHistogramAggregation = function (name) { var - _common = ejs.AggregationMixin(name), + _common = ejs.BucketsAggregationMixin(name, 'date_histogram'), agg = _common.toJSON(); - agg[name].date_histogram = {}; - return extend(_common, { - /** -

Sets the field to gather terms from.

- - @member ejs.DateHistogramAggregation - @param {String} field a valid field name.. - @returns {Object} returns this so that calls can be chained. - */ - field: function (field) { - if (field == null) { - return agg[name].date_histogram.field; - } - - agg[name].date_histogram.field = field; - return this; - }, - - /** - Allows you generate or modify the terms using a script. - - @member ejs.DateHistogramAggregation - @param {String} scriptCode A valid script string to execute. - @returns {Object} returns this so that calls can be chained. - */ - script: function (scriptCode) { - if (scriptCode == null) { - return agg[name].date_histogram.script; - } - - agg[name].date_histogram.script = scriptCode; - return this; - }, - - /** - The script language being used. - - @member ejs.DateHistogramAggregation - @param {String} language The language of the script. - @returns {Object} returns this so that calls can be chained. - */ - lang: function (language) { - if (language == null) { - return agg[name].date_histogram.lang; - } - - agg[name].date_histogram.lang = language; - return this; - }, - /** Set the date time zone. @@ -242,22 +192,6 @@ return this; }, - /** - Set to true to assume script values are sorted. - - @member ejs.DateHistogramAggregation - @param {Boolean} trueFalse assume sorted values or not - @returns {Object} returns this so that calls can be chained. - */ - scriptValuesSorted: function (trueFalse) { - if (trueFalse == null) { - return agg[name].date_histogram.script_values_sorted; - } - - agg[name].date_histogram.script_values_sorted = trueFalse; - return this; - }, - /** Set to true to apply interval adjusts to day and above intervals. @@ -290,24 +224,6 @@ return this; }, - /** - Sets parameters that will be applied to the script. Overwrites - any existing params. - - @member ejs.DateHistogramAggregation - @param {Object} p An object where the keys are the parameter name and - values are the parameter value. - @returns {Object} returns this so that calls can be chained. - */ - params: function (p) { - if (p == null) { - return agg[name].date_histogram.params; - } - - agg[name].date_histogram.params = p; - return this; - }, - /** Sets order for the aggregated values. diff --git a/src/aggregations/DateRangeAggregation.js b/src/aggregations/DateRangeAggregation.js index d7e9efc..0821eeb 100644 --- a/src/aggregations/DateRangeAggregation.js +++ b/src/aggregations/DateRangeAggregation.js @@ -12,6 +12,12 @@ @name ejs.DateRangeAggregation @ejs aggregation + @borrows ejs.BucketsAggregationMixin.field as field + @borrows ejs.BucketsAggregationMixin.script as script + @borrows ejs.BucketsAggregationMixin.scriptId as scriptId + @borrows ejs.BucketsAggregationMixin.scriptFile as scriptFile + @borrows ejs.BucketsAggregationMixin.lang as lang + @borrows ejs.BucketsAggregationMixin.params as params @borrows ejs.AggregationMixin.aggregation as aggregation @borrows ejs.AggregationMixin.agg as agg @borrows ejs.AggregationMixin._type as _type @@ -26,61 +32,11 @@ ejs.DateRangeAggregation = function (name) { var - _common = ejs.AggregationMixin(name), + _common = ejs.BucketsAggregationMixin(name, 'date_range'), agg = _common.toJSON(); - agg[name].date_range = {}; - return extend(_common, { - /** -

Sets the field to gather terms from.

- - @member ejs.DateRangeAggregation - @param {String} field a valid field name.. - @returns {Object} returns this so that calls can be chained. - */ - field: function (field) { - if (field == null) { - return agg[name].date_range.field; - } - - agg[name].date_range.field = field; - return this; - }, - - /** - Allows you generate or modify the terms using a script. - - @member ejs.DateRangeAggregation - @param {String} scriptCode A valid script string to execute. - @returns {Object} returns this so that calls can be chained. - */ - script: function (scriptCode) { - if (scriptCode == null) { - return agg[name].date_range.script; - } - - agg[name].date_range.script = scriptCode; - return this; - }, - - /** - The script language being used. - - @member ejs.DateRangeAggregation - @param {String} language The language of the script. - @returns {Object} returns this so that calls can be chained. - */ - lang: function (language) { - if (language == null) { - return agg[name].date_range.lang; - } - - agg[name].date_range.lang = language; - return this; - }, - /** Sets the date format expression. @@ -147,41 +103,7 @@ agg[name].date_range.keyed = trueFalse; return this; - }, - - /** - Set to true to assume script values are sorted. - - @member ejs.DateRangeAggregation - @param {Boolean} trueFalse assume sorted values or not - @returns {Object} returns this so that calls can be chained. - */ - scriptValuesSorted: function (trueFalse) { - if (trueFalse == null) { - return agg[name].date_range.script_values_sorted; - } - - agg[name].date_range.script_values_sorted = trueFalse; - return this; - }, - - /** - Sets parameters that will be applied to the script. Overwrites - any existing params. - - @member ejs.DateRangeAggregation - @param {Object} p An object where the keys are the parameter name and - values are the parameter value. - @returns {Object} returns this so that calls can be chained. - */ - params: function (p) { - if (p == null) { - return agg[name].date_range.params; - } - - agg[name].date_range.params = p; - return this; } - + }); }; diff --git a/src/aggregations/ExtendedStatsAggregation.js b/src/aggregations/ExtendedStatsAggregation.js index 01354d1..c3ea58a 100644 --- a/src/aggregations/ExtendedStatsAggregation.js +++ b/src/aggregations/ExtendedStatsAggregation.js @@ -13,8 +13,9 @@ @ejs aggregation @borrows ejs.MetricsAggregationMixin.field as field @borrows ejs.MetricsAggregationMixin.script as script + @borrows ejs.MetricsAggregationMixin.scriptId as scriptId + @borrows ejs.MetricsAggregationMixin.scriptFile as scriptFile @borrows ejs.MetricsAggregationMixin.lang as lang - @borrows ejs.MetricsAggregationMixin.scriptValuesSorted as scriptValuesSorted @borrows ejs.MetricsAggregationMixin.params as params @borrows ejs.AggregationMixin._type as _type @borrows ejs.AggregationMixin.toJSON as toJSON diff --git a/src/aggregations/FiltersAggregation.js b/src/aggregations/FiltersAggregation.js new file mode 100644 index 0000000..84a6746 --- /dev/null +++ b/src/aggregations/FiltersAggregation.js @@ -0,0 +1,59 @@ + /** + @class +

Defines a multi bucket aggregations where each bucket is + associated with a filter. Each bucket will collect all documents + that match its associated filter.

+ + @name ejs.FiltersAggregation + @ejs aggregation + @borrows ejs.AggregationMixin.aggregation as aggregation + @borrows ejs.AggregationMixin.agg as agg + @borrows ejs.AggregationMixin._type as _type + @borrows ejs.AggregationMixin.toJSON as toJSON + + @desc +

Defines a multi bucket aggregations where each bucket is + associated with a filter. Each bucket will collect all documents + that match its associated filter.

+ + @param {String} name The name which be used to refer to this aggregation. + + */ + ejs.FiltersAggregation = function (name) { + + var + _common = ejs.AggregationMixin(name), + agg = _common.toJSON(); + + agg[name].filters = {'filters':{}}; + + return extend(_common, { + + /** +

Sets the filters to be used for this aggregation.

+ + @member ejs.FiltersAggregation + @param {Filter} oFilter A valid Filter object. + @param {string} id A name for the filter. + @returns {Object} returns this so that calls can be chained. + */ + filter: function (oFilter, id) { + var filters = {}; + // if (agg[name].filters.filters == null) { + // agg[name].filters.filters = {}; + // } + + if (!isFilter(oFilter)) { + throw new TypeError('First argument must be a Filter'); + } + + if (id == null) { + throw new TypeError('Second argument must be a name for the filter'); + } + + agg[name].filters.filters[id] = oFilter.toJSON(); + return this; + } + + }); + }; diff --git a/src/aggregations/GeoBoundsAggregation.js b/src/aggregations/GeoBoundsAggregation.js new file mode 100644 index 0000000..0631515 --- /dev/null +++ b/src/aggregations/GeoBoundsAggregation.js @@ -0,0 +1,51 @@ +/** + @class +

A metric aggregation that computes the bounding box containing all geo_point values for a field.

+ + @name ejs.GeoBoundsAggregation + @ejs aggregation + @borrows ejs.MetricsAggregationMixin.field as field + @borrows ejs.AggregationMixin._type as _type + @borrows ejs.AggregationMixin.toJSON as toJSON + + @desc +

Aggregation that computes the bounding box containing all geo_point values for a field.

+ + @param {String} name The name which be used to refer to this aggregation. + + */ + ejs.GeoBoundsAggregation = function (name) { + + var + _common = ejs.MetricsAggregationMixin(name, 'geo_bounds'), + agg = _common.toJSON(); + + // not supported in geo bounds aggregation + delete _common.script; + delete _common.scriptId; + delete _common.scriptFile; + delete _common.lang; + delete _common.params; + + + return extend(_common, { + + /** + Optional parameter which specifies whether the bounding box should be allowed to overlap the international date line. The default value is true + + @member ejs.GeoBoundsAggregation + @param {Boolean} trueFalse to overlap the international date line. + @returns {Object} returns this so that calls can be chained. + */ + wrapLongitude: function (trueFalse) { + if (trueFalse == null) { + return agg[name].geo_bounds.wrap_longitude; + } + + agg[name].geo_bounds.wrap_longitude = trueFalse; + return this; + } + + }); + + }; diff --git a/src/aggregations/HistogramAggregation.js b/src/aggregations/HistogramAggregation.js index f77b2d8..1aee72d 100644 --- a/src/aggregations/HistogramAggregation.js +++ b/src/aggregations/HistogramAggregation.js @@ -6,6 +6,12 @@ @name ejs.HistogramAggregation @ejs aggregation + @borrows ejs.BucketsAggregationMixin.field as field + @borrows ejs.BucketsAggregationMixin.script as script + @borrows ejs.BucketsAggregationMixin.scriptId as scriptId + @borrows ejs.BucketsAggregationMixin.scriptFile as scriptFile + @borrows ejs.BucketsAggregationMixin.lang as lang + @borrows ejs.BucketsAggregationMixin.params as params @borrows ejs.AggregationMixin.aggregation as aggregation @borrows ejs.AggregationMixin.agg as agg @borrows ejs.AggregationMixin._type as _type @@ -21,61 +27,11 @@ ejs.HistogramAggregation = function (name) { var - _common = ejs.AggregationMixin(name), + _common = ejs.BucketsAggregationMixin(name, 'histogram'), agg = _common.toJSON(); - agg[name].histogram = {}; - return extend(_common, { - /** -

Sets the field to gather terms from.

- - @member ejs.HistogramAggregation - @param {String} field a valid field name.. - @returns {Object} returns this so that calls can be chained. - */ - field: function (field) { - if (field == null) { - return agg[name].histogram.field; - } - - agg[name].histogram.field = field; - return this; - }, - - /** - Allows you generate or modify the terms using a script. - - @member ejs.HistogramAggregation - @param {String} scriptCode A valid script string to execute. - @returns {Object} returns this so that calls can be chained. - */ - script: function (scriptCode) { - if (scriptCode == null) { - return agg[name].histogram.script; - } - - agg[name].histogram.script = scriptCode; - return this; - }, - - /** - The script language being used. - - @member ejs.HistogramAggregation - @param {String} language The language of the script. - @returns {Object} returns this so that calls can be chained. - */ - lang: function (language) { - if (language == null) { - return agg[name].histogram.lang; - } - - agg[name].histogram.lang = language; - return this; - }, - /** Sets the format expression for the terms. Use for number or date formatting @@ -172,40 +128,6 @@ return this; }, - /** - Set to true to assume script values are sorted. - - @member ejs.HistogramAggregation - @param {Boolean} trueFalse assume sorted values or not - @returns {Object} returns this so that calls can be chained. - */ - scriptValuesSorted: function (trueFalse) { - if (trueFalse == null) { - return agg[name].histogram.script_values_sorted; - } - - agg[name].histogram.script_values_sorted = trueFalse; - return this; - }, - - /** - Sets parameters that will be applied to the script. Overwrites - any existing params. - - @member ejs.HistogramAggregation - @param {Object} p An object where the keys are the parameter name and - values are the parameter value. - @returns {Object} returns this so that calls can be chained. - */ - params: function (p) { - if (p == null) { - return agg[name].histogram.params; - } - - agg[name].histogram.params = p; - return this; - }, - /** Sets order for the aggregated values. diff --git a/src/aggregations/IPv4RangeAggregation.js b/src/aggregations/IPv4RangeAggregation.js index 060f900..480034a 100644 --- a/src/aggregations/IPv4RangeAggregation.js +++ b/src/aggregations/IPv4RangeAggregation.js @@ -7,6 +7,12 @@ @name ejs.IPv4RangeAggregation @ejs aggregation + @borrows ejs.BucketsAggregationMixin.field as field + @borrows ejs.BucketsAggregationMixin.script as script + @borrows ejs.BucketsAggregationMixin.scriptId as scriptId + @borrows ejs.BucketsAggregationMixin.scriptFile as scriptFile + @borrows ejs.BucketsAggregationMixin.lang as lang + @borrows ejs.BucketsAggregationMixin.params as params @borrows ejs.AggregationMixin.aggregation as aggregation @borrows ejs.AggregationMixin.agg as agg @borrows ejs.AggregationMixin._type as _type @@ -21,61 +27,11 @@ ejs.IPv4RangeAggregation = function (name) { var - _common = ejs.AggregationMixin(name), + _common = ejs.BucketsAggregationMixin(name, 'ip_range'), agg = _common.toJSON(); - agg[name].ip_range = {}; - return extend(_common, { - /** -

Sets the field to gather terms from.

- - @member ejs.IPv4RangeAggregation - @param {String} field a valid field name.. - @returns {Object} returns this so that calls can be chained. - */ - field: function (field) { - if (field == null) { - return agg[name].ip_range.field; - } - - agg[name].ip_range.field = field; - return this; - }, - - /** - Allows you generate or modify the terms using a script. - - @member ejs.IPv4RangeAggregation - @param {String} scriptCode A valid script string to execute. - @returns {Object} returns this so that calls can be chained. - */ - script: function (scriptCode) { - if (scriptCode == null) { - return agg[name].ip_range.script; - } - - agg[name].ip_range.script = scriptCode; - return this; - }, - - /** - The script language being used. - - @member ejs.IPv4RangeAggregation - @param {String} language The language of the script. - @returns {Object} returns this so that calls can be chained. - */ - lang: function (language) { - if (language == null) { - return agg[name].ip_range.lang; - } - - agg[name].ip_range.lang = language; - return this; - }, - /** Adds a range to the list of exsiting range expressions. @@ -130,40 +86,6 @@ agg[name].ip_range.keyed = trueFalse; return this; - }, - - /** - Set to true to assume script values are sorted. - - @member ejs.IPv4RangeAggregation - @param {Boolean} trueFalse assume sorted values or not - @returns {Object} returns this so that calls can be chained. - */ - scriptValuesSorted: function (trueFalse) { - if (trueFalse == null) { - return agg[name].ip_range.script_values_sorted; - } - - agg[name].ip_range.script_values_sorted = trueFalse; - return this; - }, - - /** - Sets parameters that will be applied to the script. Overwrites - any existing params. - - @member ejs.IPv4RangeAggregation - @param {Object} p An object where the keys are the parameter name and - values are the parameter value. - @returns {Object} returns this so that calls can be chained. - */ - params: function (p) { - if (p == null) { - return agg[name].ip_range.params; - } - - agg[name].ip_range.params = p; - return this; } }); diff --git a/src/aggregations/MaxAggregation.js b/src/aggregations/MaxAggregation.js index ea72a70..053d070 100644 --- a/src/aggregations/MaxAggregation.js +++ b/src/aggregations/MaxAggregation.js @@ -9,8 +9,9 @@ @ejs aggregation @borrows ejs.MetricsAggregationMixin.field as field @borrows ejs.MetricsAggregationMixin.script as script + @borrows ejs.MetricsAggregationMixin.scriptId as scriptId + @borrows ejs.MetricsAggregationMixin.scriptFile as scriptFile @borrows ejs.MetricsAggregationMixin.lang as lang - @borrows ejs.MetricsAggregationMixin.scriptValuesSorted as scriptValuesSorted @borrows ejs.MetricsAggregationMixin.params as params @borrows ejs.AggregationMixin._type as _type @borrows ejs.AggregationMixin.toJSON as toJSON diff --git a/src/aggregations/MinAggregation.js b/src/aggregations/MinAggregation.js index 35bc932..2d32833 100644 --- a/src/aggregations/MinAggregation.js +++ b/src/aggregations/MinAggregation.js @@ -9,8 +9,9 @@ @ejs aggregation @borrows ejs.MetricsAggregationMixin.field as field @borrows ejs.MetricsAggregationMixin.script as script + @borrows ejs.MetricsAggregationMixin.scriptId as scriptId + @borrows ejs.MetricsAggregationMixin.scriptFile as scriptFile @borrows ejs.MetricsAggregationMixin.lang as lang - @borrows ejs.MetricsAggregationMixin.scriptValuesSorted as scriptValuesSorted @borrows ejs.MetricsAggregationMixin.params as params @borrows ejs.AggregationMixin._type as _type @borrows ejs.AggregationMixin.toJSON as toJSON diff --git a/src/aggregations/PercentilesAggregation.js b/src/aggregations/PercentilesAggregation.js index 13f61f0..02f76a1 100644 --- a/src/aggregations/PercentilesAggregation.js +++ b/src/aggregations/PercentilesAggregation.js @@ -9,8 +9,9 @@ @ejs aggregation @borrows ejs.MetricsAggregationMixin.field as field @borrows ejs.MetricsAggregationMixin.script as script + @borrows ejs.MetricsAggregationMixin.scriptId as scriptId + @borrows ejs.MetricsAggregationMixin.scriptFile as scriptFile @borrows ejs.MetricsAggregationMixin.lang as lang - @borrows ejs.MetricsAggregationMixin.scriptValuesSorted as scriptValuesSorted @borrows ejs.MetricsAggregationMixin.params as params @borrows ejs.AggregationMixin._type as _type @borrows ejs.AggregationMixin.toJSON as toJSON diff --git a/src/aggregations/RangeAggregation.js b/src/aggregations/RangeAggregation.js index 249ce82..21b5404 100644 --- a/src/aggregations/RangeAggregation.js +++ b/src/aggregations/RangeAggregation.js @@ -10,6 +10,12 @@ @name ejs.RangeAggregation @ejs aggregation + @borrows ejs.BucketsAggregationMixin.field as field + @borrows ejs.BucketsAggregationMixin.script as script + @borrows ejs.BucketsAggregationMixin.scriptId as scriptId + @borrows ejs.BucketsAggregationMixin.scriptFile as scriptFile + @borrows ejs.BucketsAggregationMixin.lang as lang + @borrows ejs.BucketsAggregationMixin.params as params @borrows ejs.AggregationMixin.aggregation as aggregation @borrows ejs.AggregationMixin.agg as agg @borrows ejs.AggregationMixin._type as _type @@ -25,61 +31,11 @@ ejs.RangeAggregation = function (name) { var - _common = ejs.AggregationMixin(name), + _common = ejs.BucketsAggregationMixin(name, 'range'), agg = _common.toJSON(); - agg[name].range = {}; - return extend(_common, { - /** -

Sets the field to gather terms from.

- - @member ejs.RangeAggregation - @param {String} field a valid field name.. - @returns {Object} returns this so that calls can be chained. - */ - field: function (field) { - if (field == null) { - return agg[name].range.field; - } - - agg[name].range.field = field; - return this; - }, - - /** - Allows you generate or modify the terms using a script. - - @member ejs.RangeAggregation - @param {String} scriptCode A valid script string to execute. - @returns {Object} returns this so that calls can be chained. - */ - script: function (scriptCode) { - if (scriptCode == null) { - return agg[name].range.script; - } - - agg[name].range.script = scriptCode; - return this; - }, - - /** - The script language being used. - - @member ejs.RangeAggregation - @param {String} language The language of the script. - @returns {Object} returns this so that calls can be chained. - */ - lang: function (language) { - if (language == null) { - return agg[name].range.lang; - } - - agg[name].range.lang = language; - return this; - }, - /** Adds a range to the list of exsiting range expressions. @@ -132,39 +88,5 @@ return this; }, - /** - Set to true to assume script values are sorted. - - @member ejs.RangeAggregation - @param {Boolean} trueFalse assume sorted values or not - @returns {Object} returns this so that calls can be chained. - */ - scriptValuesSorted: function (trueFalse) { - if (trueFalse == null) { - return agg[name].range.script_values_sorted; - } - - agg[name].range.script_values_sorted = trueFalse; - return this; - }, - - /** - Sets parameters that will be applied to the script. Overwrites - any existing params. - - @member ejs.RangeAggregation - @param {Object} p An object where the keys are the parameter name and - values are the parameter value. - @returns {Object} returns this so that calls can be chained. - */ - params: function (p) { - if (p == null) { - return agg[name].range.params; - } - - agg[name].range.params = p; - return this; - } - }); }; diff --git a/src/aggregations/ScriptedMetricAggregation.js b/src/aggregations/ScriptedMetricAggregation.js new file mode 100644 index 0000000..b27f362 --- /dev/null +++ b/src/aggregations/ScriptedMetricAggregation.js @@ -0,0 +1,266 @@ + /** + @class +

A metric aggregation that executes using scripts to provide a metric output.

+ + @name ejs.ScriptedMetricAggregation + @ejs aggregation + @borrows ejs.MetricsAggregationMixin.lang as lang + @borrows ejs.MetricsAggregationMixin.params as params + @borrows ejs.AggregationMixin._type as _type + @borrows ejs.AggregationMixin.toJSON as toJSON + + @desc +

Aggregation that keeps track and returns the minimum value among numeric + values extracted from the aggregated documents.

+ + @param {String} name The name which be used to refer to this aggregation. + + */ + ejs.ScriptedMetricAggregation = function (name) { + + var + _common = ejs.MetricsAggregationMixin(name, 'scripted_metric'), + agg = _common.toJSON(); + + delete _common.field; + delete _common.script; + delete _common.scriptId; + delete _common.scriptFile; + + return extend(_common, { + + /** +

Sets the initialization script.

+ + @member ejs.ScriptedMetricAggregation + @param {String} initScript The initialization script + @returns {Object} returns this so that calls can be chained. + */ + initScript: function (initScript) { + if (initScript == null) { + return agg[name].scripted_metric.init_script; + } + + agg[name].scripted_metric.init_script = initScript; + return this; + }, + + /** +

Sets the map script. This is the only required script.

+ @member ejs.ScriptedMetricAggregation + @param {String} mapScript The map script. + @returns {Object} returns this so that calls can be chained. + */ + mapScript: function (mapScript) { + if (mapScript == null) { + return agg[name].scripted_metric.map_script; + } + + agg[name].scripted_metric.map_script = mapScript; + return this; + }, + + /** +

Sets the combine phase script.

+ @member ejs.ScriptedMetricAggregation + @param {String} combineScript The combine script. + @returns {Object} returns this so that calls can be chained. + */ + combineScript: function (combineScript) { + if (combineScript == null) { + return agg[name].scripted_metric.combine_script; + } + + agg[name].scripted_metric.combine_script = combineScript; + return this; + }, + + /** +

Sets the combine phase script.

+ @member ejs.ScriptedMetricAggregation + @param {String} reduceScript The reduce script. + @returns {Object} returns this so that calls can be chained. + */ + reduceScript: function (reduceScript) { + if (reduceScript == null) { + return agg[name].scripted_metric.reduce_script; + } + + agg[name].scripted_metric.reduce_script = reduceScript; + return this; + }, + + /** +

Sets the init_script_file.

+ + @member ejs.ScriptedMetricAggregation + @param {String} init_script_file A valid script file name. + @returns {Object} returns this so that calls can be chained. + */ + initScriptFile: function (init_script_file) { + if (init_script_file == null) { + return agg[name].scripted_metric.init_script_file; + } + + agg[name].scripted_metric.init_script_file = init_script_file; + return this; + }, + + /** +

Sets the init_script_id.

+ + @member ejs.ScriptedMetricAggregation + @param {String} init_script_id A valid id from indexed script. + @returns {Object} returns this so that calls can be chained. + */ + initScriptId: function (init_script_id) { + if (init_script_id == null) { + return agg[name].scripted_metric.init_script_id; + } + + agg[name].scripted_metric.init_script_id = init_script_id; + return this; + }, + + /** +

Sets the map_script_file.

+ + @member ejs.ScriptedMetricAggregation + @param {String} map_script_file A valid script file name. + @returns {Object} returns this so that calls can be chained. + */ + mapScriptFile : function (map_script_file) { + if (map_script_file == null) { + return agg[name].scripted_metric.map_script_file; + } + + agg[name].scripted_metric.map_script_file = map_script_file; + return this; + }, + + /** +

Sets the map_script_id.

+ + @member ejs.ScriptedMetricAggregation + @param {String} map_script_id A valid id from indexed script. + @returns {Object} returns this so that calls can be chained. + */ + mapScriptId : function (map_script_id) { + if (map_script_id == null) { + return agg[name].scripted_metric.map_script_id; + } + + agg[name].scripted_metric.map_script_id = map_script_id; + return this; + }, + + /** +

Sets the combine_script_file.

+ + @member ejs.ScriptedMetricAggregation + @param {String} combine_script_file A valid script file name. + @returns {Object} returns this so that calls can be chained. + */ + combineScriptFile: function (combine_script_file) { + if (combine_script_file == null) { + return agg[name].scripted_metric.combine_script_file; + } + + agg[name].scripted_metric.combine_script_file = combine_script_file; + return this; + }, + + /** +

Sets the combine_script_id.

+ + @member ejs.ScriptedMetricAggregation + @param {String} combine_script_id A valid id from indexed script. + @returns {Object} returns this so that calls can be chained. + */ + combineScriptId: function (combine_script_id) { + if (combine_script_id == null) { + return agg[name].scripted_metric.combine_script_id; + } + + agg[name].scripted_metric.combine_script_id = combine_script_id; + return this; + }, + + /** +

Sets the reduce_script_file.

+ + @member ejs.ScriptedMetricAggregation + @param {String} reduce_script_file A valid script file name. + @returns {Object} returns this so that calls can be chained. + */ + reduceScriptFile: function (reduce_script_file) { + if (reduce_script_file == null) { + return agg[name].scripted_metric.reduce_script_file; + } + + agg[name].scripted_metric.reduce_script_file = reduce_script_file; + return this; + }, + + /** +

Sets the reduce_script_id.

+ + @member ejs.ScriptedMetricAggregation + @param {String} reduce_script_id A valid id from indexed script. + @returns {Object} returns this so that calls can be chained. + */ + reduceScriptId: function (reduce_script_id) { + if (reduce_script_id == null) { + return agg[name].scripted_metric.reduce_script_id; + } + + agg[name].scripted_metric.reduce_script_id = reduce_script_id; + return this; + }, + + /** +

Set parameters which will be passed to the init, map and combine scripts.

+ @member ejs.ScriptedMetricAggregation + @param {String} params Parameters passed to the init, map and combine scripts. + @returns {Object} returns this so that calls can be chained. + */ + params: function (params) { + if (params == null) { + return agg[name].scripted_metric.params; + } + + agg[name].scripted_metric.params = params; + return this; + }, + + /** +

Set parameters which will be passed to the reduce script.

+ @member ejs.ScriptedMetricAggregation + @param {String} reduceParams Paramters to pass to the recude script. + @returns {Object} returns this so that calls can be chained. + */ + reduceParams: function (reduceParams) { + if (reduceParams == null) { + return agg[name].scripted_metric.reduce_params; + } + + agg[name].scripted_metric.reduce_params = reduceParams; + return this; + }, + + /** +

Set the scripting language used for this aggregation.

+ @member ejs.ScriptedMetricAggregation + @param {String} lang The script langauge. + @returns {Object} returns this so that calls can be chained. + */ + lang: function (lang) { + if (lang == null) { + return agg[name].scripted_metric.lang; + } + + agg[name].scripted_metric.lang = lang; + return this; + } + }); + }; diff --git a/src/aggregations/StatsAggregation.js b/src/aggregations/StatsAggregation.js index 2086f7f..ee6d4ec 100644 --- a/src/aggregations/StatsAggregation.js +++ b/src/aggregations/StatsAggregation.js @@ -11,8 +11,9 @@ @ejs aggregation @borrows ejs.MetricsAggregationMixin.field as field @borrows ejs.MetricsAggregationMixin.script as script + @borrows ejs.MetricsAggregationMixin.scriptId as scriptId + @borrows ejs.MetricsAggregationMixin.scriptFile as scriptFile @borrows ejs.MetricsAggregationMixin.lang as lang - @borrows ejs.MetricsAggregationMixin.scriptValuesSorted as scriptValuesSorted @borrows ejs.MetricsAggregationMixin.params as params @borrows ejs.AggregationMixin._type as _type @borrows ejs.AggregationMixin.toJSON as toJSON diff --git a/src/aggregations/SumAggregation.js b/src/aggregations/SumAggregation.js index 206d0db..7896b08 100644 --- a/src/aggregations/SumAggregation.js +++ b/src/aggregations/SumAggregation.js @@ -9,8 +9,9 @@ @ejs aggregation @borrows ejs.MetricsAggregationMixin.field as field @borrows ejs.MetricsAggregationMixin.script as script + @borrows ejs.MetricsAggregationMixin.scriptId as scriptId + @borrows ejs.MetricsAggregationMixin.scriptFile as scriptFile @borrows ejs.MetricsAggregationMixin.lang as lang - @borrows ejs.MetricsAggregationMixin.scriptValuesSorted as scriptValuesSorted @borrows ejs.MetricsAggregationMixin.params as params @borrows ejs.AggregationMixin._type as _type @borrows ejs.AggregationMixin.toJSON as toJSON diff --git a/src/aggregations/TermsAggregation.js b/src/aggregations/TermsAggregation.js index 5446eac..22eb3ec 100644 --- a/src/aggregations/TermsAggregation.js +++ b/src/aggregations/TermsAggregation.js @@ -5,6 +5,12 @@ @name ejs.TermsAggregation @ejs aggregation + @borrows ejs.BucketsAggregationMixin.field as field + @borrows ejs.BucketsAggregationMixin.script as script + @borrows ejs.BucketsAggregationMixin.scriptId as scriptId + @borrows ejs.BucketsAggregationMixin.scriptFile as scriptFile + @borrows ejs.BucketsAggregationMixin.lang as lang + @borrows ejs.BucketsAggregationMixin.params as params @borrows ejs.AggregationMixin.aggregation as aggregation @borrows ejs.AggregationMixin.agg as agg @borrows ejs.AggregationMixin._type as _type @@ -19,83 +25,13 @@ ejs.TermsAggregation = function (name) { var - _common = ejs.AggregationMixin(name), + _common = ejs.BucketsAggregationMixin(name, 'terms'), agg = _common.toJSON(); agg[name].terms = {}; return extend(_common, { - /** -

Sets the field to gather terms from.

- - @member ejs.TermsAggregation - @param {String} field a valid field name.. - @returns {Object} returns this so that calls can be chained. - */ - field: function (field) { - if (field == null) { - return agg[name].terms.field; - } - - agg[name].terms.field = field; - return this; - }, - - /** - Allows you generate or modify the terms using a script. - - @member ejs.TermsAggregation - @param {String} scriptCode A valid script string to execute. - @returns {Object} returns this so that calls can be chained. - */ - script: function (scriptCode) { - if (scriptCode == null) { - return agg[name].terms.script; - } - - agg[name].terms.script = scriptCode; - return this; - }, - - /** - The script language being used. - - @member ejs.TermsAggregation - @param {String} language The language of the script. - @returns {Object} returns this so that calls can be chained. - */ - lang: function (language) { - if (language == null) { - return agg[name].terms.lang; - } - - agg[name].terms.lang = language; - return this; - }, - - /** - Sets the type of the field value for use in scripts. Current values are: - string, double, float, long, integer, short, and byte. - - @member ejs.TermsAggregation - @param {String} v The value type - @returns {Object} returns this so that calls can be chained. - */ - valueType: function (v) { - if (v == null) { - return agg[name].terms.value_type; - } - - v = v.toLowerCase(); - if (v === 'string' || v === 'double' || v === 'float' || v === 'long' || - v === 'integer' || v === 'short' || v === 'byte') { - agg[name].terms.value_type = v; - } - - return this; - }, - /** Sets the format expression for the terms. Use for number or date formatting @@ -194,22 +130,6 @@ return this; }, - /** - Set to true to assume script values are unique. - - @member ejs.TermsAggregation - @param {Boolean} trueFalse assume unique values or not - @returns {Object} returns this so that calls can be chained. - */ - scriptValuesUnique: function (trueFalse) { - if (trueFalse == null) { - return agg[name].terms.script_values_unique; - } - - agg[name].terms.script_values_unique = trueFalse; - return this; - }, - /** Sets the number of aggregation entries that will be returned. @@ -260,24 +180,6 @@ return this; }, - /** - Sets parameters that will be applied to the script. Overwrites - any existing params. - - @member ejs.TermsAggregation - @param {Object} p An object where the keys are the parameter name and - values are the parameter value. - @returns {Object} returns this so that calls can be chained. - */ - params: function (p) { - if (p == null) { - return agg[name].terms.params; - } - - agg[name].terms.params = p; - return this; - }, - /** Sets order for the aggregated values. @@ -287,6 +189,8 @@ @returns {Object} returns this so that calls can be chained. */ order: function (order, direction) { + var orderAsObj = {}; + if (order == null) { return agg[name].terms.order; } @@ -300,8 +204,9 @@ direction = 'desc'; } - agg[name].terms.order = {}; - agg[name].terms.order[order] = direction; + orderAsObj[order] = direction; + agg[name].terms.order = agg[name].terms.order || []; + agg[name].terms.order.push(orderAsObj); return this; } diff --git a/src/aggregations/TopHitsAggregation.js b/src/aggregations/TopHitsAggregation.js index 309bbeb..7a81b5c 100644 --- a/src/aggregations/TopHitsAggregation.js +++ b/src/aggregations/TopHitsAggregation.js @@ -21,8 +21,10 @@ ejs.TopHitsAggregation = function (name) { var - _common = ejs.MetricsAggregationMixin(name, 'top_hits'), - agg = _common.toJSON(); + _common = ejs.AggregationMixin(name), + agg = _common.toJSON(); + + agg[name].top_hits = {}; return extend(_common, { /** @@ -215,8 +217,8 @@ includes: includes }; - if (excludes !== undefined) { - agg[name].top_hits._source = excludes; + if (excludes != null) { + agg[name].top_hits._source.excludes = excludes; } } diff --git a/src/aggregations/ValueCountAggregation.js b/src/aggregations/ValueCountAggregation.js index 903c58e..355ea08 100644 --- a/src/aggregations/ValueCountAggregation.js +++ b/src/aggregations/ValueCountAggregation.js @@ -10,6 +10,8 @@ @ejs aggregation @borrows ejs.MetricsAggregationMixin.field as field @borrows ejs.MetricsAggregationMixin.script as script + @borrows ejs.MetricsAggregationMixin.scriptId as scriptId + @borrows ejs.MetricsAggregationMixin.scriptFile as scriptFile @borrows ejs.MetricsAggregationMixin.lang as lang @borrows ejs.MetricsAggregationMixin.params as params @borrows ejs.AggregationMixin._type as _type @@ -28,27 +30,6 @@ _common = ejs.MetricsAggregationMixin(name, 'value_count'), agg = _common.toJSON(); - // not supported in value count aggregation - delete _common.scriptValuesSorted; - - return extend(_common, { - - /** - Set to true to assume script values are unique. - - @member ejs.ValueCountAggregation - @param {Boolean} trueFalse assume unique values or not - @returns {Object} returns this so that calls can be chained. - */ - scriptValuesUnique: function (trueFalse) { - if (trueFalse == null) { - return agg[name].value_count.script_values_unique; - } - - agg[name].value_count.script_values_unique = trueFalse; - return this; - } - - }); + return _common; }; diff --git a/src/filter/HasChildFilter.js b/src/filter/HasChildFilter.js index 1090337..8c273c8 100644 --- a/src/filter/HasChildFilter.js +++ b/src/filter/HasChildFilter.js @@ -118,6 +118,60 @@ @returns {Object} returns this so that calls can be chained. */ scope: function (s) { + return this; + }, + + /** + Sets the inner hits options + + @member ejs.HasChildFilter + @param {InnerHits} i A valid InnerHits object + @returns {Object} returns this so that calls can be chained. + */ + innerHits: function(i) { + if (i == null) { + return filter.has_child.inner_hits; + } + + if (!isInnerHits(i)) { + throw new TypeError('Argument must be a Highlight object'); + } + + filter.has_child.inner_hits = i.toJSON(); + + return this; + }, + + /** + Sets the min_children value. + + @member ejs.HasChildQuery + @param {Integer} min A positive integer value. + @returns {Object} returns this so that calls can be chained. + */ + minChildren: function(min) { + if (min == null) { + return filter.has_child.min_children; + } + + filter.has_child.min_children = min; + return this; + }, + + /** + Sets the max_children value. + + @member ejs.HasChildQuery + @param {Integer} max A positive integer value. + @returns {Object} returns this so that calls can be chained. + */ + maxChildren: function(max) { + if (max == null) { + return filter.has_child.max_children; + } + + filter.has_child.max_children = max; + return this; } diff --git a/src/filter/HasParentFilter.js b/src/filter/HasParentFilter.js index aad9ad8..2e17eb3 100644 --- a/src/filter/HasParentFilter.js +++ b/src/filter/HasParentFilter.js @@ -103,6 +103,26 @@ */ scope: function (s) { return this; + }, + + /** + Sets the inner hits options + + @member ejs.HasParentFilter + @param {InnerHits} i A valid InnerHits object + @returns {Object} returns this so that calls can be chained. + */ + innerHits: function(i) { + if (i == null) { + return filter.has_parent.inner_hits; + } + + if (!isInnerHits(i)) { + throw new TypeError('Argument must be a Highlight object'); + } + + filter.has_parent.inner_hits = i.toJSON(); + return this; } }); diff --git a/src/filter/NestedFilter.js b/src/filter/NestedFilter.js index c8f7126..5bad69a 100644 --- a/src/filter/NestedFilter.js +++ b/src/filter/NestedFilter.js @@ -132,7 +132,27 @@ */ scope: function (s) { return this; + }, + + /** + Sets the inner hits options + + @member ejs.NestedFilter + @param {InnerHits} i A valid InnerHits object + @returns {Object} returns this so that calls can be chained. + */ + innerHits: function(i) { + if (i == null) { + return filter.nested.inner_hits; + } + + if (!isInnerHits(i)) { + throw new TypeError('Argument must be a Highlight object'); + } + + filter.nested.inner_hits = i.toJSON(); + return this; } - + }); }; diff --git a/src/mixins/BucketsAggregationMixin.js b/src/mixins/BucketsAggregationMixin.js new file mode 100644 index 0000000..284e116 --- /dev/null +++ b/src/mixins/BucketsAggregationMixin.js @@ -0,0 +1,125 @@ + /** + @mixin +

The BucketsAggregationMixin provides support for common options used across + various buckets Aggregation implementations. This object should + not be used directly.

+ + @name ejs.BucketsAggregationMixin + @ejs aggregation + @borrows ejs.AggregationMixin.aggregation as aggregation + @borrows ejs.AggregationMixin.agg as agg + @borrows ejs.AggregationMixin._type as _type + @borrows ejs.AggregationMixin.toJSON as toJSON + + */ + ejs.BucketsAggregationMixin = function (name, type) { + + var + _common = ejs.AggregationMixin(name), + agg = _common.toJSON(); + + + agg[name][type] = {}; + + return extend(_common, { + + /** +

Sets the field to operate on.

+ + @member ejs.BucketsAggregationMixin + @param {String} field a valid field name.. + @returns {Object} returns this so that calls can be chained. + */ + field: function (field) { + if (field == null) { + return agg[name][type].field; + } + + agg[name][type].field = field; + return this; + }, + + /** + Allows you generate or modify the terms/values using a script. + + @member ejs.BucketsAggregationMixin + @param {String} scriptCode A valid script string to execute. + @returns {Object} returns this so that calls can be chained. + */ + script: function (scriptCode) { + if (scriptCode == null) { + return agg[name][type].script; + } + + agg[name][type].script = scriptCode; + return this; + }, + + /** + Allows you generate or modify the terms/values using a script. + + @member ejs.BucketsAggregationMixin + @param {String} scriptId A valid script id to execute. + @returns {Object} returns this so that calls can be chained. + */ + scriptId: function (scriptId) { + if (scriptId == null) { + return agg[name][type].script_id; + } + + agg[name][type].script_id = scriptId; + return this; + }, + + /** + Allows you generate or modify the terms/values using a script. + + @member ejs.BucketsAggregationMixin + @param {String} scriptFile A valid script file to execute. + @returns {Object} returns this so that calls can be chained. + */ + scriptFile: function (scriptFile) { + if (scriptFile == null) { + return agg[name][type].script_file; + } + + agg[name][type].script_file = scriptFile; + return this; + }, + + /** + The script language being used. + + @member ejs.BucketsAggregationMixin + @param {String} language The language of the script. + @returns {Object} returns this so that calls can be chained. + */ + lang: function (language) { + if (language == null) { + return agg[name][type].lang; + } + + agg[name][type].lang = language; + return this; + }, + + /** + Sets parameters that will be applied to the script. Overwrites + any existing params. + + @member ejs.BucketsAggregationMixin + @param {Object} p An object where the keys are the parameter name and + values are the parameter value. + @returns {Object} returns this so that calls can be chained. + */ + params: function (p) { + if (p == null) { + return agg[name][type].params; + } + + agg[name][type].params = p; + return this; + } + + }); + }; diff --git a/src/mixins/MetricsAggregationMixin.js b/src/mixins/MetricsAggregationMixin.js index 6dcfd14..8bc20ca 100644 --- a/src/mixins/MetricsAggregationMixin.js +++ b/src/mixins/MetricsAggregationMixin.js @@ -58,34 +58,50 @@ }, /** - The script language being used. + Allows you generate or modify the terms/values using a script. @member ejs.MetricsAggregationMixin - @param {String} language The language of the script. + @param {String} scriptId A valid script id to execute. @returns {Object} returns this so that calls can be chained. */ - lang: function (language) { - if (language == null) { - return agg[name][type].lang; + scriptId: function (scriptId) { + if (scriptId == null) { + return agg[name][type].script_id; } - agg[name][type].lang = language; + agg[name][type].script_id = scriptId; + return this; + }, + + /** + Allows you generate or modify the terms/values using a script. + + @member ejs.MetricsAggregationMixin + @param {String} scriptFile A valid script file to execute. + @returns {Object} returns this so that calls can be chained. + */ + scriptFile: function (scriptFile) { + if (scriptFile == null) { + return agg[name][type].script_file; + } + + agg[name][type].script_file = scriptFile; return this; }, /** - Set to true to assume script values are sorted. + The script language being used. @member ejs.MetricsAggregationMixin - @param {Boolean} trueFalse assume sorted values or not + @param {String} language The language of the script. @returns {Object} returns this so that calls can be chained. */ - scriptValuesSorted: function (trueFalse) { - if (trueFalse == null) { - return agg[name][type].script_values_sorted; + lang: function (language) { + if (language == null) { + return agg[name][type].lang; } - agg[name][type].script_values_sorted = trueFalse; + agg[name][type].lang = language; return this; }, diff --git a/src/mixins/ScoreFunctionMixin.js b/src/mixins/ScoreFunctionMixin.js index b3f03de..8405c75 100644 --- a/src/mixins/ScoreFunctionMixin.js +++ b/src/mixins/ScoreFunctionMixin.js @@ -9,7 +9,10 @@ ejs.ScoreFunctionMixin = function (name) { var func = {}; - func[name] = {}; + + if (name != null) { + func[name] = {}; + } return { @@ -33,6 +36,26 @@ return this; }, + /** + Sets the weight of the score function + + @member ejs.ScoreFunctionMixin + @param {Number} oWeight The weight of this score function. + @returns {Object} returns this so that calls can be chained. + */ + weight: function (oWeight) { + if (oWeight == null) { + return func.weight; + } + + if (!isNumber(oWeight)) { + throw new TypeError('Argument must be a Number'); + } + + func.weight = oWeight; + return this; + }, + /** The type of ejs object. For internal use only. diff --git a/src/pre.js b/src/pre.js index 17081dc..5cbc01e 100644 --- a/src/pre.js +++ b/src/pre.js @@ -42,6 +42,7 @@ isFilter, // checks valid ejs Filter object isFacet, // checks valid ejs Facet object isAggregation, // checks valid ejs Aggregation object + isPartialField, // checks valid ejs PartialField object isScriptField, // checks valid ejs ScriptField object isGeoPoint, // checks valid ejs GeoPoint object isIndexedShape, // checks valid ejs IndexedShape object @@ -51,6 +52,7 @@ isSuggest, // checks valid ejs Suggest object isGenerator, // checks valid ejs Generator object isScoreFunction, // checks valid ejs ScoreFunction object + isInnerHits, // checks valid ejs InnerHits object // create ejs object ejs; diff --git a/src/query/CommonTermsQuery.js b/src/query/CommonTermsQuery.js index b96e856..14aceeb 100644 --- a/src/query/CommonTermsQuery.js +++ b/src/query/CommonTermsQuery.js @@ -175,23 +175,19 @@ }, /** - Sets the minimum number of low freq matches that need to match in - a document before that document is returned in the results. + Sets a string value controlling how many "should" clauses in the + resulting Query should match. - @member ejs.CommonTermsQuery - @param {Integer} min A positive integer. + @member ejs.MatchQuery + @param {String} minMatch A min should match parameter. @returns {Object} returns this so that calls can be chained. */ - minimumShouldMatch: function (min) { - if (min == null) { - return query.common[field].minimum_should_match.low_freq; + minimumShouldMatch: function (minMatch) { + if (minMatch == null) { + return query.common[field].minimum_should_match; } - - if (query.common[field].minimum_should_match == null) { - query.common[field].minimum_should_match = {}; - } - - query.common[field].minimum_should_match.low_freq = min; + + query.common[field].minimum_should_match = minMatch; return this; }, @@ -204,7 +200,16 @@ @returns {Object} returns this so that calls can be chained. */ minimumShouldMatchLowFreq: function (min) { - return this.minimumShouldMatch(min); + if (min == null) { + return query.common[field].minimum_should_match.low_freq; + } + + if (!isObject(query.common[field].minimum_should_match)) { + query.common[field].minimum_should_match = {}; + } + + query.common[field].minimum_should_match.low_freq = min; + return this; }, /** @@ -219,11 +224,11 @@ if (min == null) { return query.common[field].minimum_should_match.high_freq; } - - if (query.common[field].minimum_should_match == null) { + + if (!isObject(query.common[field].minimum_should_match)) { query.common[field].minimum_should_match = {}; } - + query.common[field].minimum_should_match.high_freq = min; return this; }, diff --git a/src/query/FunctionScoreQuery.js b/src/query/FunctionScoreQuery.js old mode 100644 new mode 100755 index b2ce5ea..cbb23d8 --- a/src/query/FunctionScoreQuery.js +++ b/src/query/FunctionScoreQuery.js @@ -1,182 +1,214 @@ - /** - @class -

The function_score allows you to modify the score of documents that are - retrieved by a query. This can be useful if, for example, a score function is - computationally expensive and it is sufficient to compute the score on a - filtered set of documents.

- - @name ejs.FunctionScoreQuery - @ejs query - @borrows ejs.QueryMixin.boost as boost - @borrows ejs.QueryMixin._type as _type - @borrows ejs.QueryMixin.toJSON as toJSON - - @desc -

A query that allows you to modify the score of matching documents.

- - */ - ejs.FunctionScoreQuery = function () { - - var - _common = ejs.QueryMixin('function_score'), - query = _common.toJSON(); - - return extend(_common, { - - /** - Set the source query. - - @member ejs.FunctionScoreQuery - @param {Query} oQuery A valid Query object - @returns {Object} returns this so that calls can be chained. - */ - query: function (oQuery) { - if (oQuery == null) { - return query.function_score.query; - } - - if (!isQuery(oQuery)) { - throw new TypeError('Argument must be a Query'); - } - - query.function_score.query = oQuery.toJSON(); - return this; - }, - - /** - Set the source filter. - - @member ejs.FunctionScoreQuery - @param {Filter} oFilter A valid Filter object - @returns {Object} returns this so that calls can be chained. - */ - filter: function (oFilter) { - if (oFilter == null) { - return query.function_score.filter; - } - - if (!isFilter(oFilter)) { - throw new TypeError('Argument must be a Filter'); - } - - query.function_score.filter = oFilter.toJSON(); - return this; - }, - - /** - Set the scoring mode which specifies how the computed scores are combined. - Valid values are: avg, max, min, sum, multiply, and first. - - @member ejs.FunctionScoreQuery - @param {String} mode A scoring mode. - @returns {Object} returns this so that calls can be chained. - */ - scoreMode: function (mode) { - if (mode == null) { - return query.function_score.score_mode; - } - - mode = mode.toLowerCase(); - if (mode === 'avg' || mode === 'max' || mode === 'min' || - mode === 'sum' || mode === 'multiply' || mode === 'first') { - query.function_score.score_mode = mode; - } - - return this; - }, - - /** - Set the setermines how the new calculated score is combined with the - score from the original query. Valid values are: multiply, replace, sum, - avg, max, and min. - - @member ejs.FunctionScoreQuery - @param {String} mode A boosting mode. - @returns {Object} returns this so that calls can be chained. - */ - boostMode: function (mode) { - if (mode == null) { - return query.function_score.boost_mode; - } - - mode = mode.toLowerCase(); - if (mode === 'multiply' || mode === 'replace' || mode === 'sum' || - mode === 'avg' || mode === 'max' || mode === 'min') { - query.function_score.boost_mode = mode; - } - - return this; - }, - - /** - Sets the boost value for all documents matching the query. - - @member ejs.FunctionScoreQuery - @param {Float} boost A positive float value. - @returns {Object} returns this so that calls can be chained. - */ - boost: function (boost) { - if (boost == null) { - return query.function_score.boost; - } - - query.function_score.boost = boost; - return this; - }, - - /** - Add a single score function to the list of existing functions. - - @member ejs.FunctionScoreQuery - @param {ScoreFunction} func A valid ScoreFunction object. - @returns {Object} returns this so that calls can be chained. - */ - function: function (func) { - if (query.function_score.functions == null) { - query.function_score.functions = []; - } - - if (func == null) { - return query.function_score.functions; - } - - if (!isScoreFunction(func)) { - throw new TypeError('Argument must be a ScoreFunction'); - } - - query.function_score.functions.push(func.toJSON()); - return this; - }, - - /** - Sets the score functions. Replaces any existing score functions. - - @member ejs.FunctionScoreQuery - @param {ScoreFunction[]} funcs A array of ScoreFunctions. - @returns {Object} returns this so that calls can be chained. - */ - functions: function (funcs) { - var i, len; - - if (funcs == null) { - return query.function_score.functions; - } - - if (!isArray(funcs)) { - throw new TypeError('Argument must be an array of ScoreFunctions'); - } - - query.function_score.functions = []; - for (i = 0, len = funcs.length; i < len; i++) { - if (!isScoreFunction(funcs[i])) { - throw new TypeError('Argument must be an array of ScoreFunctions'); - } - - query.function_score.functions.push(funcs[i].toJSON()); - } - - return this; - } - - }); - }; + /** + @class +

The function_score allows you to modify the score of documents that are + retrieved by a query. This can be useful if, for example, a score function is + computationally expensive and it is sufficient to compute the score on a + filtered set of documents.

+ + @name ejs.FunctionScoreQuery + @ejs query + @borrows ejs.QueryMixin.boost as boost + @borrows ejs.QueryMixin._type as _type + @borrows ejs.QueryMixin.toJSON as toJSON + + @desc +

A query that allows you to modify the score of matching documents.

+ + */ + ejs.FunctionScoreQuery = function () { + + var + _common = ejs.QueryMixin('function_score'), + query = _common.toJSON(); + + return extend(_common, { + + /** + Set the source query. + + @member ejs.FunctionScoreQuery + @param {Query} oQuery A valid Query object + @returns {Object} returns this so that calls can be chained. + */ + query: function (oQuery) { + if (oQuery == null) { + return query.function_score.query; + } + + if (!isQuery(oQuery)) { + throw new TypeError('Argument must be a Query'); + } + + query.function_score.query = oQuery.toJSON(); + return this; + }, + + /** + Set the source filter. + + @member ejs.FunctionScoreQuery + @param {Filter} oFilter A valid Filter object + @returns {Object} returns this so that calls can be chained. + */ + filter: function (oFilter) { + if (oFilter == null) { + return query.function_score.filter; + } + + if (!isFilter(oFilter)) { + throw new TypeError('Argument must be a Filter'); + } + + query.function_score.filter = oFilter.toJSON(); + return this; + }, + + /** + Set the scoring mode which specifies how the computed scores are combined. + Valid values are: avg, max, min, sum, multiply, and first. + + @member ejs.FunctionScoreQuery + @param {String} mode A scoring mode. + @returns {Object} returns this so that calls can be chained. + */ + scoreMode: function (mode) { + if (mode == null) { + return query.function_score.score_mode; + } + + mode = mode.toLowerCase(); + if (mode === 'avg' || mode === 'max' || mode === 'min' || + mode === 'sum' || mode === 'multiply' || mode === 'first') { + query.function_score.score_mode = mode; + } + + return this; + }, + + /** + Set the setermines how the new calculated score is combined with the + score from the original query. Valid values are: multiply, replace, sum, + avg, max, and min. + + @member ejs.FunctionScoreQuery + @param {String} mode A boosting mode. + @returns {Object} returns this so that calls can be chained. + */ + boostMode: function (mode) { + if (mode == null) { + return query.function_score.boost_mode; + } + + mode = mode.toLowerCase(); + if (mode === 'multiply' || mode === 'replace' || mode === 'sum' || + mode === 'avg' || mode === 'max' || mode === 'min') { + query.function_score.boost_mode = mode; + } + + return this; + }, + + /** + Sets the boost value for all documents matching the query. + + @member ejs.FunctionScoreQuery + @param {Float} boost A positive float value. + @returns {Object} returns this so that calls can be chained. + */ + boost: function (boost) { + if (boost == null) { + return query.function_score.boost; + } + + query.function_score.boost = boost; + return this; + }, + + /** + Sets the maximum boost value. + + @member ejs.FunctionScoreQuery + @param {Float} maxBoost A positive float value. + @returns {Object} returns this so that calls can be chained. + */ + maxBoost: function (maxBoost) { + if (maxBoost == null) { + return query.function_score.max_boost; + } + + query.function_score.max_boost = maxBoost; + return this; + }, + + /** + Sets the minimum score a document should have to be included. + + @member ejs.FunctionScoreQuery + @param {Float} minScore A positive float value. + @returns {Object} returns this so that calls can be chained. + */ + minScore: function (minScore) { + if (minScore == null) { + return query.function_score.min_score; + } + + query.function_score.min_score = minScore; + return this; + }, + + /** + Add a single score function to the list of existing functions. + + @member ejs.FunctionScoreQuery + @param {ScoreFunction} func A valid ScoreFunction object. + @returns {Object} returns this so that calls can be chained. + */ + function: function (func) { + if (query.function_score.functions == null) { + query.function_score.functions = []; + } + + if (func == null) { + return query.function_score.functions; + } + + if (!isScoreFunction(func)) { + throw new TypeError('Argument must be a ScoreFunction'); + } + + query.function_score.functions.push(func.toJSON()); + return this; + }, + + /** + Sets the score functions. Replaces any existing score functions. + + @member ejs.FunctionScoreQuery + @param {ScoreFunction[]} funcs A array of ScoreFunctions. + @returns {Object} returns this so that calls can be chained. + */ + functions: function (funcs) { + var i, len; + + if (funcs == null) { + return query.function_score.functions; + } + + if (!isArray(funcs)) { + throw new TypeError('Argument must be an array of ScoreFunctions'); + } + + query.function_score.functions = []; + for (i = 0, len = funcs.length; i < len; i++) { + if (!isScoreFunction(funcs[i])) { + throw new TypeError('Argument must be an array of ScoreFunctions'); + } + + query.function_score.functions.push(funcs[i].toJSON()); + } + + return this; + } + + }); + }; diff --git a/src/query/HasChildQuery.js b/src/query/HasChildQuery.js index 6fb92d5..552ff1e 100644 --- a/src/query/HasChildQuery.js +++ b/src/query/HasChildQuery.js @@ -1,9 +1,9 @@ /** @class -

The has_child query works the same as the has_child filter, - by automatically wrapping the filter with a constant_score. Results in +

The has_child query works the same as the has_child filter, + by automatically wrapping the filter with a constant_score. Results in parent documents that have child docs matching the query being returned.

- + @name ejs.HasChildQuery @ejs query @borrows ejs.QueryMixin.boost as boost @@ -21,11 +21,11 @@ if (!isQuery(qry)) { throw new TypeError('Argument must be a valid Query'); } - - var + + var _common = ejs.QueryMixin('has_child'), query = _common.toJSON(); - + query.has_child.query = qry.toJSON(); query.has_child.type = type; @@ -42,11 +42,11 @@ if (q == null) { return query.has_child.query; } - + if (!isQuery(q)) { throw new TypeError('Argument must be a valid Query'); } - + query.has_child.query = q.toJSON(); return this; }, @@ -62,14 +62,14 @@ if (t == null) { return query.has_child.type; } - + query.has_child.type = t; return this; }, /** - Sets the scope of the query. A scope allows to run facets on the - same scope name that will work against the child documents. + Sets the scope of the query. A scope allows to run facets on the + same scope name that will work against the child documents. @deprecated since elasticsearch 0.90 @member ejs.HasChildQuery @@ -82,14 +82,14 @@ /** Sets the scoring method. Valid values are: - + none - the default, no scoring max - the highest score of all matched child documents is used sum - the sum the all the matched child documents is used avg - the average of all matched child documents is used @deprecated since elasticsearch 0.90.1, use scoreMode - + @member ejs.HasChildQuery @param {String} s The score type as a string. @returns {Object} returns this so that calls can be chained. @@ -98,18 +98,18 @@ if (s == null) { return query.has_child.score_type; } - + s = s.toLowerCase(); if (s === 'none' || s === 'max' || s === 'sum' || s === 'avg') { query.has_child.score_type = s; } - + return this; }, - + /** Sets the scoring method. Valid values are: - + none - the default, no scoring max - the highest score of all matched child documents is used sum - the sum the all the matched child documents is used @@ -123,15 +123,15 @@ if (s == null) { return query.has_child.score_mode; } - + s = s.toLowerCase(); if (s === 'none' || s === 'max' || s === 'sum' || s === 'avg') { query.has_child.score_mode = s; } - + return this; }, - + /** Sets the cutoff value to short circuit processing. @@ -146,7 +146,59 @@ query.has_child.short_circuit_cutoff = cutoff; return this; + }, + + /** + Sets the inner hits options + + @member ejs.HasChildQuery + @param {InnerHits} i A valid InnerHits object + @returns {Object} returns this so that calls can be chained. + */ + innerHits: function(i) { + if (i == null) { + return query.has_child.inner_hits; + } + + if (!isInnerHits(i)) { + throw new TypeError('Argument must be a Highlight object'); + } + + query.has_child.inner_hits = i.toJSON(); + return this; + }, + + /** + Sets the min_children value. + + @member ejs.HasChildQuery + @param {Integer} min A positive integer value. + @returns {Object} returns this so that calls can be chained. + */ + minChildren: function(min) { + if (min == null) { + return query.has_child.min_children; + } + + query.has_child.min_children = min; + return this; + }, + + /** + Sets the max_children value. + + @member ejs.HasChildQuery + @param {Integer} max A positive integer value. + @returns {Object} returns this so that calls can be chained. + */ + maxChildren: function(max) { + if (max == null) { + return query.has_child.max_children; + } + + query.has_child.max_children = max; + return this; } - + }); }; diff --git a/src/query/HasParentQuery.js b/src/query/HasParentQuery.js index 1fc62ca..7cb6829 100644 --- a/src/query/HasParentQuery.js +++ b/src/query/HasParentQuery.js @@ -124,9 +124,29 @@ if (s === 'none' || s === 'score') { query.has_parent.score_mode = s; } - + + return this; + }, + + /** + Sets the inner hits options + + @member ejs.HasParentQuery + @param {InnerHits} i A valid InnerHits object + @returns {Object} returns this so that calls can be chained. + */ + innerHits: function(i) { + if (i == null) { + return query.has_parent.inner_hits; + } + + if (!isInnerHits(i)) { + throw new TypeError('Argument must be a Highlight object'); + } + + query.has_parent.inner_hits = i.toJSON(); return this; } - + }); }; diff --git a/src/query/MatchQuery.js b/src/query/MatchQuery.js index 8ec85ff..cce814d 100644 --- a/src/query/MatchQuery.js +++ b/src/query/MatchQuery.js @@ -189,7 +189,7 @@ resulting Query should match. @member ejs.MatchQuery - @param {Integer} minMatch An integer between 0 and 100. + @param {String} minMatch A min should match parameter. @returns {Object} returns this so that calls can be chained. */ minimumShouldMatch: function (minMatch) { diff --git a/src/query/MoreLikeThisQuery.js b/src/query/MoreLikeThisQuery.js index 6572df5..ef077b6 100644 --- a/src/query/MoreLikeThisQuery.js +++ b/src/query/MoreLikeThisQuery.js @@ -16,23 +16,14 @@ @param {String} likeText The text to find documents like it. */ - ejs.MoreLikeThisQuery = function (fields, likeText) { + ejs.MoreLikeThisQuery = function (likeText) { var _common = ejs.QueryMixin('mlt'), query = _common.toJSON(); query.mlt.like_text = likeText; - query.mlt.fields = []; - if (isString(fields)) { - query.mlt.fields.push(fields); - } else if (isArray(fields)) { - query.mlt.fields = fields; - } else { - throw new TypeError('Argument must be string or array'); - } - return extend(_common, { /** @@ -46,20 +37,29 @@ */ fields: function (f) { if (f == null) { - return query.mlt.fields; + return this; } if (isString(f)) { - query.mlt.fields.push(f); + query.mlt.fields = [f]; } else if (isArray(f)) { query.mlt.fields = f; } else { - throw new TypeError('Argument must be a string or array'); + throw new TypeError('Must pass a field or an array of fields'); } return this; }, - + + docs: function(doc) { + if (isArray(doc)) { + query.mlt.docs = doc; + } else { + throw new TypeError('Must pass an array of docs as argument'); + } + return this; + }, + /** The text to find documents like diff --git a/src/query/MultiMatchQuery.js b/src/query/MultiMatchQuery.js index 26a10e4..c35798e 100644 --- a/src/query/MultiMatchQuery.js +++ b/src/query/MultiMatchQuery.js @@ -126,7 +126,7 @@ resulting Query should match. @member ejs.MultiMatchQuery - @param {Integer} minMatch An integer between 0 and 100. + @param {String} minMatch A min should match parameter. @returns {Object} returns this so that calls can be chained. */ minimumShouldMatch: function (minMatch) { @@ -280,7 +280,7 @@ } type = type.toLowerCase(); - if (type === 'boolean' || type === 'phrase' || type === 'phrase_prefix') { + if (type === 'best_fields' || type === 'most_fields' || type === 'cross_fields' || type === 'phrase' || type === 'phrase_prefix') { query.multi_match.type = type; } diff --git a/src/query/NestedQuery.js b/src/query/NestedQuery.js index 38c0243..35eacef 100644 --- a/src/query/NestedQuery.js +++ b/src/query/NestedQuery.js @@ -122,7 +122,27 @@ */ scope: function (s) { return this; + }, + + /** + Sets the inner hits options + + @member ejs.NestedFilter + @param {InnerHits} i A valid InnerHits object + @returns {Object} returns this so that calls can be chained. + */ + innerHits: function(i) { + if (i == null) { + return query.nested.inner_hits; + } + + if (!isInnerHits(i)) { + throw new TypeError('Argument must be a Highlight object'); + } + + query.nested.inner_hits = i.toJSON(); + return this; } - + }); }; diff --git a/src/query/QueryStringQuery.js b/src/query/QueryStringQuery.js index 14fdd8a..24bc531 100644 --- a/src/query/QueryStringQuery.js +++ b/src/query/QueryStringQuery.js @@ -307,7 +307,7 @@ resulting Query should match. @member ejs.QueryStringQuery - @param {Integer} minMatch An integer between 0 and 100. + @param {String} minMatch A min should match parameter. @returns {Object} returns this so that calls can be chained. */ minimumShouldMatch: function (minMatch) { diff --git a/src/query/TermsQuery.js b/src/query/TermsQuery.js index 8331ccf..3ff65d5 100644 --- a/src/query/TermsQuery.js +++ b/src/query/TermsQuery.js @@ -83,15 +83,15 @@ before that document is returned in the results. @member ejs.TermsQuery - @param {Integer} min A positive integer. + @param {String} minMatch A min should match parameter. @returns {Object} returns this so that calls can be chained. */ - minimumShouldMatch: function (min) { - if (min == null) { + minimumShouldMatch: function (minMatch) { + if (minMatch == null) { return query.terms.minimum_should_match; } - query.terms.minimum_should_match = min; + query.terms.minimum_should_match = minMatch; return this; }, diff --git a/src/query/functions/FieldValueFactorFunction.js b/src/query/functions/FieldValueFactorFunction.js new file mode 100644 index 0000000..7afc359 --- /dev/null +++ b/src/query/functions/FieldValueFactorFunction.js @@ -0,0 +1,63 @@ + /** + @class +

The field_value_factor function allows you to use a field from a document to + influence the score. It’s similar to using the script_score function, however, + it avoids the overhead of scripting. If used on a multi-valued field, only the + first value of the field is used in calculations.

+ + @name ejs.FieldValueFactorFunction + @ejs scorefunction + @borrows ejs.ScoreFunctionMixin.filter as filter + @borrows ejs.ScoreFunctionMixin._type as _type + @borrows ejs.ScoreFunctionMixin.toJSON as toJSON + + @param {String} field the field to apply the function to. + + @desc +

Multiply the score by the value of the field, multiplied by the factor.

+ + */ + ejs.FieldValueFactorFunction = function (field) { + + var + _common = ejs.ScoreFunctionMixin('field_value_factor'), + func = _common.toJSON(); + + func.field_value_factor.field = field; + + return extend(_common, { + + /** + Sets the factor. + + @member ejs.FieldValueFactorFunction + @param {Float} factor the factor. + @returns {Object} returns this so that calls can be chained. + */ + factor: function (factor) { + if (factor == null) { + return func.field_value_factor.factor; + } + + func.field_value_factor.factor = factor; + return this; + }, + + /** + Sets the modifier. + + @member ejs.FieldValueFactorFunction + @param {Float} modifier the modifier, one of none, log, log1p, log2p, ln, ln1p, ln2p, square, sqrt or reciprocal + @returns {Object} returns this so that calls can be chained. + */ + modifier: function (modifier) { + if (modifier == null) { + return func.field_value_factor.modifier; + } + + func.field_value_factor.modifier = modifier; + return this; + } + + }); + }; diff --git a/src/query/functions/ScoreFunction.js b/src/query/functions/ScoreFunction.js new file mode 100644 index 0000000..811100c --- /dev/null +++ b/src/query/functions/ScoreFunction.js @@ -0,0 +1,23 @@ + /** + @class +

A basic filter score function, which mathces a filter and applies a + weight.

+ + @name ejs.ScoreFunction + @ejs scorefunction + @borrows ejs.ScoreFunctionMixin.filter as filter + @borrows ejs.ScoreFunctionMixin.weight as weight + @borrows ejs.ScoreFunctionMixin._type as _type + @borrows ejs.ScoreFunctionMixin.toJSON as toJSON + + @desc +

Randomly score documents.

+ + */ + ejs.ScoreFunction = function () { + + var + _common = ejs.ScoreFunctionMixin(); + + return _common; + }; diff --git a/src/query/functions/ScriptScoreFunction.js b/src/query/functions/ScriptScoreFunction.js index a128cc0..8e33dc0 100644 --- a/src/query/functions/ScriptScoreFunction.js +++ b/src/query/functions/ScriptScoreFunction.js @@ -35,6 +35,32 @@ } func.script_score.script = scriptCode; + + if (func.script_score.script_id) { + delete func.script_score.script_id; + } + + return this; + }, + + /** + Set the script id that will modify the score. + + @member ejs.ScriptScoreFunction + @param {String} scriptId Id of an indexed script. + @returns {Object} returns this so that calls can be chained. + */ + scriptId: function (scriptId) { + if (scriptId == null) { + return func.script_score.scriptId; + } + + func.script_score.script_id = scriptId; + + if (func.script_score.script) { + delete func.script_score.script; + } + return this; }, diff --git a/src/search/InnerHits.js b/src/search/InnerHits.js new file mode 100644 index 0000000..c58ddf1 --- /dev/null +++ b/src/search/InnerHits.js @@ -0,0 +1,248 @@ + /** + @class +

Inner hits can be used by defining a inner_hits definition on a nested, + has_child or has_parent query and filter. This feature returns per search hit + in the search response additional nested hits that caused a search hit to + match in a different scope.

+ +

See https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-inner-hits.html

+ + @name ejs.InnerHits + @ejs request + + @desc +

Include additional nested hits in the response.

+ + */ + ejs.InnerHits = function () { + + var innerHits = {}; + + return { + + /** +

The name to be used for the particular inner hit definition in the response. + Useful when multiple inner hits have been defined in a single search request. + The default depends in which query the inner hit is defined. For has_child query + and filter this is the child type, has_parent query and filter this is the parent + type and the nested query and filter this is the nested path..

+ + @member ejs.InnerHits + @param {String} name The name to be used for the inner hit definition. + @returns {Object} returns this so that calls can be chained. + */ + name: function (name) { + if (name === null) { + return innerHits.name; + } + + innerHits.name = name; + return this; + }, + + + /** +

The offset from where the first hit to fetch in the returned regular search hits.

+ + @member ejs.InnerHits + @param {Integer} from The offset from the first result you want to fetch. + @returns {Object} returns this so that calls can be chained. + */ + from: function (from) { + if (from === null) { + return innerHits.from; + } + + innerHits.from = from; + return this; + }, + + /** +

The maximum number of hits to return. By default the top three matching hits are returned.

+ + @member ejs.InnerHits + @param {Integer} size The numer of hits to be returned. + @returns {Object} returns this so that calls can be chained. + */ + size: function (size) { + if (size === null) { + return innerHits.size; + } + + innerHits.size = size; + return this; + }, + + /** +

How the inner hits should be sorted. By default the hits are sorted by the score.

+ + @member ejs.InnerHits + @param {String} sort The field to be sorted on. + @returns {Object} returns this so that calls can be chained. + */ + sort: function (sort) { + if (sort === null) { + return innerHits.sort; + } + + innerHits.sort = sort; + return this; + }, + + + /** +

Enable/Disable returning version number for each hit.

+ + @member ejs.InnerHits + @param {Boolean} trueFalse true to enable, false to disable + @returns {Object} returns this so that calls can be chained. + */ + version: function (trueFalse) { + if (trueFalse === null) { + return innerHits.version; + } + + innerHits.version = trueFalse; + return this; + }, + + /** +

Enable/Disable explanation of score for each hit.

+ + @member ejs.InnerHits + @param {Boolean} trueFalse true to enable, false to disable + @returns {Object} returns this so that calls can be chained. + */ + explain: function (trueFalse) { + if (trueFalse === null) { + return innerHits.explain; + } + + innerHits.explain = trueFalse; + return this; + }, + + /** +

Performs highlighting based on the Highlight settings.

+ + @member ejs.InnerHits + @param {Highlight} h A valid Highlight object + @returns {Object} returns this so that calls can be chained. + */ + highlight: function (h) { + if (h === null) { + return innerHits.highlight; + } + + if (!isHighlight(h)) { + throw new TypeError('Argument must be a Highlight object'); + } + + innerHits.highlight = h.toJSON(); + return this; + }, + + /** +

Computes a document property dynamically based on the supplied ScriptField.

+ + @member ejs.InnerHits + @param {ScriptField} oScriptField A valid ScriptField. + @returns {Object} returns this so that calls can be chained. + */ + scriptField: function (oScriptField) { + if (oScriptField === null) { + return innerHits.script_fields; + } + + if (innerHits.script_fields === undefined) { + innerHits.script_fields = {}; + } + + if (!isScriptField(oScriptField)) { + throw new TypeError('Argument must be a ScriptField'); + } + + extend(innerHits.script_fields, oScriptField.toJSON()); + return this; + }, + + /** +

Allows to return the field data representation of a field for each hit.

+ + @member ejs.InnerHits + @param {Array} Fields to return field data representation for. + @returns {Object} returns this so that calls can be chained. + */ + fieldDataFields: function (fielddata_fields) { + if (fielddata_fields === null) { + return innerHits.fielddata_fields; + } + + innerHits.fielddata_fields = fielddata_fields; + return this; + }, + + /** +

Allows to control how the _source field is returned with every hit. + By default operations return the contents of the _source field + unless you have used the fields parameter or if the _source field + is disabled. Set the includes parameter to false to completely + disable returning the source field.

+ + @member ejs.InnerHits + @param {(String|Boolean|String[])} includes The field or list of fields to include as array. + Set to a boolean false to disable the source completely. + @param {(String|String[])} excludes The optional field or list of fields to exclude. + @returns {Object} returns this so that calls can be chained. + */ + source: function (includes, excludes) { + if (includes === undefined && excludes === undefined) { + return innerHits._source; + } + + if (!isArray(includes) && !isString(includes) && !isBoolean(includes)) { + throw new TypeError('Argument includes must be a string, an array, or a boolean'); + } + + if (excludes !== undefined && !isArray(excludes) && !isString(excludes)) { + throw new TypeError('Argument excludes must be a string or an array'); + } + + if (isBoolean(includes)) { + innerHits._source = includes; + } else { + innerHits._source = { + includes: includes + }; + + if (excludes != null) { + innerHits._source.excludes = excludes; + } + } + + return this; + }, + + + /** + The type of ejs object. For internal use only. + + @member ejs.InnerHits + @returns {String} the type of object + */ + _type: function () { + return 'inner hits'; + }, + + /** + Retrieves the internal script object. This is typically used by + internal API functions so use with caution. + + @member ejs.InnerHits + @returns {String} returns this object's internal object representation. + */ + toJSON: function () { + return innerHits; + } + }; + }; diff --git a/src/search/PartialField.js b/src/search/PartialField.js new file mode 100644 index 0000000..75db64d --- /dev/null +++ b/src/search/PartialField.js @@ -0,0 +1,94 @@ + /** + @class +

When loading data from _source, partial fields can be used + to use wildcards to control what part of the _source will be loaded + based on include and exclude patterns.

+ + @name ejs.PartialField + @ejs request + + @desc +

Control what part of the _source will be loaded.

+ + @param {String} fieldName A name of the partial field to create. + + */ + ejs.PartialField = function (fieldName) { + var partial = {}; + + partial[fieldName] = {}; + + return { + + /** + Allows to control how the _source field is returned with every hit. + By default operations return the contents of the _source field + unless you have used the fields parameter or if the _source field + is disabled. Set the includes parameter to false to completely + disable returning the source field. + + @member ejs.PartialField + @param {(String|String[])} include The field or list of fields to include as array. + @returns {Object} returns this so that calls can be chained. + */ + include: function (include) { + if (include == null) { + return partial[fieldName].include; + } + + if (!isArray(include) && !isString(include)) { + throw new TypeError('Argument include must be a string or an array'); + } + + partial[fieldName].include = include; + + return this; + }, + + /** + Allows to control how the _source field is returned with every hit. + By default operations return the contents of the _source field + unless you have used the fields parameter or if the _source field + is disabled. Set the includes parameter to false to completely + disable returning the source field. + + @member ejs.PartialField + @param {(String|String[])} exclude The optional field or list of fields to exclude. + @returns {Object} returns this so that calls can be chained. + */ + exclude: function (exclude) { + if (exclude == null) { + return partial[fieldName].exclude; + } + + if (!isArray(exclude) && !isString(exclude)) { + throw new TypeError('Argument exclude must be a string or an array'); + } + + partial[fieldName].exclude = exclude; + + return this; + }, + + /** + The type of ejs object. For internal use only. + + @member ejs.PartialField + @returns {String} the type of object + */ + _type: function () { + return 'partial field'; + }, + + /** + Retrieves the internal script object. This is typically used by + internal API functions so use with caution. + + @member ejs.PartialField + @returns {String} returns this object's internal facet property. + */ + toJSON: function () { + return partial; + } + }; + }; diff --git a/src/search/Request.js b/src/search/Request.js index e51026f..0390587 100644 --- a/src/search/Request.js +++ b/src/search/Request.js @@ -250,6 +250,30 @@ return this; }, + /** + Control what part of the _source will be loaded based on PartialField. + + @member ejs.Request + @param {PartialField} oPartialField A valid PartialField. + @returns {Object} returns this so that calls can be chained. + */ + partialField: function (oPartialField) { + if (oPartialField == null) { + return query.partial_fields; + } + + if (query.partial_fields == null) { + query.partial_fields = {}; + } + + if (!isPartialField(oPartialField)) { + throw new TypeError('Argument must be a PartialField'); + } + + extend(query.partial_fields, oPartialField.toJSON()); + return this; + }, + /** Once a query executes, you can use rescore to run a secondary, more expensive query to re-order the results. @@ -379,6 +403,26 @@ return this; }, + /** + Allows you to set a specified post_filter on this request object. + + @member ejs.Request + @param {Object} filter Any valid Filter object. + @returns {Object} returns this so that calls can be chained. + */ + post_filter: function (filter) { + if (filter == null) { + return query.filter; + } + + if (!isFilter(filter)) { + throw new TypeError('Argument must be a Filter'); + } + + query.post_filter = filter.toJSON(); + return this; + }, + /** Performs highlighting based on the Highlight settings. diff --git a/src/util.js b/src/util.js index 624b613..f3989e9 100644 --- a/src/util.js +++ b/src/util.js @@ -133,6 +133,10 @@ return (isEJSObject(obj) && obj._type() === 'script field'); }; + isPartialField = function (obj) { + return (isEJSObject(obj) && obj._type() === 'partial field'); + }; + isGeoPoint = function (obj) { return (isEJSObject(obj) && obj._type() === 'geo point'); }; @@ -164,3 +168,7 @@ isScoreFunction = function (obj) { return (isEJSObject(obj) && obj._type() === 'score function'); }; + + isInnerHits = function(obj) { + return (isEJSObject(obj) && obj._type() === 'inner hits'); + }; \ No newline at end of file diff --git a/tests/aggregation_test.js b/tests/aggregation_test.js index 45e09de..2f92e90 100644 --- a/tests/aggregation_test.js +++ b/tests/aggregation_test.js @@ -28,15 +28,17 @@ exports.aggregations = { done(); }, exists: function (test) { - test.expect(23); + test.expect(27); test.ok(ejs.GlobalAggregation, 'GlobalAggregation'); test.ok(ejs.FilterAggregation, 'FilterAggregation'); + test.ok(ejs.FiltersAggregation, 'FiltersAggregation'); test.ok(ejs.TermsAggregation, 'TermsAggregation'); test.ok(ejs.GeoHashGridAggregation, 'GeoHashGridAggregation'); test.ok(ejs.HistogramAggregation, 'HistogramAggregation'); test.ok(ejs.MissingAggregation, 'MissingAggregation'); test.ok(ejs.NestedAggregation, 'NestedAggregation'); + test.ok(ejs.ChildrenAggregation, 'ChildrenAggregation'); test.ok(ejs.RangeAggregation, 'RangeAggregation'); test.ok(ejs.SignificantTermsAggregation, 'SignificantTermsAggregation'); test.ok(ejs.AvgAggregation, 'AvgAggregation'); @@ -53,12 +55,14 @@ exports.aggregations = { test.ok(ejs.GeoDistanceAggregation, 'GeoDistanceAggregation'); test.ok(ejs.IPv4RangeAggregation, 'IPv4RangeAggregation'); test.ok(ejs.TopHitsAggregation, 'TopHitsAggregation'); + test.ok(ejs.GeoBoundsAggregation, 'GeoBoundsAggregation'); + test.ok(ejs.ScriptedMetricAggregation, 'ScriptedMetricAggregation'); test.done(); }, ExtendedStatsAggregation: function (test) { - test.expect(9); + test.expect(10); var agg = ejs.ExtendedStatsAggregation('myagg'), ta1 = ejs.TermsAggregation('ta1').field('f1'), @@ -83,12 +87,16 @@ exports.aggregations = { expected.myagg.extended_stats.script = 's1'; doTest(); - agg.lang('mvel'); - expected.myagg.extended_stats.lang = 'mvel'; + agg.scriptId('id1'); + expected.myagg.extended_stats.script_id = 'id1'; doTest(); - agg.scriptValuesSorted(false); - expected.myagg.extended_stats.script_values_sorted = false; + agg.scriptFile('file1'); + expected.myagg.extended_stats.script_file = 'file1'; + doTest(); + + agg.lang('mvel'); + expected.myagg.extended_stats.lang = 'mvel'; doTest(); agg.params({p1: 'v1'}); @@ -100,7 +108,7 @@ exports.aggregations = { test.done(); }, ValueCountAggregation: function (test) { - test.expect(9); + test.expect(10); var agg = ejs.ValueCountAggregation('myagg'), ta1 = ejs.TermsAggregation('ta1').field('f1'), @@ -121,16 +129,21 @@ exports.aggregations = { expected.myagg.value_count.field = 'f1'; doTest(); + agg.script('s1'); expected.myagg.value_count.script = 's1'; doTest(); - agg.lang('mvel'); - expected.myagg.value_count.lang = 'mvel'; + agg.scriptId('id1'); + expected.myagg.value_count.script_id = 'id1'; + doTest(); + + agg.scriptFile('file1'); + expected.myagg.value_count.script_file = 'file1'; doTest(); - agg.scriptValuesUnique(false); - expected.myagg.value_count.script_values_unique = false; + agg.lang('mvel'); + expected.myagg.value_count.lang = 'mvel'; doTest(); agg.params({p1: 'v1'}); @@ -142,7 +155,7 @@ exports.aggregations = { test.done(); }, SumAggregation: function (test) { - test.expect(9); + test.expect(10); var agg = ejs.SumAggregation('myagg'), ta1 = ejs.TermsAggregation('ta1').field('f1'), @@ -167,12 +180,16 @@ exports.aggregations = { expected.myagg.sum.script = 's1'; doTest(); - agg.lang('mvel'); - expected.myagg.sum.lang = 'mvel'; + agg.scriptId('id1'); + expected.myagg.sum.script_id = 'id1'; + doTest(); + + agg.scriptFile('file1'); + expected.myagg.sum.script_file = 'file1'; doTest(); - agg.scriptValuesSorted(false); - expected.myagg.sum.script_values_sorted = false; + agg.lang('mvel'); + expected.myagg.sum.lang = 'mvel'; doTest(); agg.params({p1: 'v1'}); @@ -184,7 +201,7 @@ exports.aggregations = { test.done(); }, StatsAggregation: function (test) { - test.expect(9); + test.expect(10); var agg = ejs.StatsAggregation('myagg'), ta1 = ejs.TermsAggregation('ta1').field('f1'), @@ -209,12 +226,16 @@ exports.aggregations = { expected.myagg.stats.script = 's1'; doTest(); - agg.lang('mvel'); - expected.myagg.stats.lang = 'mvel'; + agg.scriptId('id1'); + expected.myagg.stats.script_id = 'id1'; doTest(); - agg.scriptValuesSorted(false); - expected.myagg.stats.script_values_sorted = false; + agg.scriptFile('file1'); + expected.myagg.stats.script_file = 'file1'; + doTest(); + + agg.lang('mvel'); + expected.myagg.stats.lang = 'mvel'; doTest(); agg.params({p1: 'v1'}); @@ -226,7 +247,7 @@ exports.aggregations = { test.done(); }, PercentilesAggregation: function (test) { - test.expect(15); + test.expect(16); var agg = ejs.PercentilesAggregation('myagg'), ta1 = ejs.TermsAggregation('ta1').field('f1'), @@ -251,12 +272,16 @@ exports.aggregations = { expected.myagg.percentiles.script = 's1'; doTest(); - agg.lang('mvel'); - expected.myagg.percentiles.lang = 'mvel'; + agg.scriptId('id1'); + expected.myagg.percentiles.script_id = 'id1'; + doTest(); + + agg.scriptFile('file1'); + expected.myagg.percentiles.script_file = 'file1'; doTest(); - agg.scriptValuesSorted(false); - expected.myagg.percentiles.script_values_sorted = false; + agg.lang('mvel'); + expected.myagg.percentiles.lang = 'mvel'; doTest(); agg.params({p1: 'v1'}); @@ -292,7 +317,7 @@ exports.aggregations = { test.done(); }, MinAggregation: function (test) { - test.expect(9); + test.expect(10); var agg = ejs.MinAggregation('myagg'), ta1 = ejs.TermsAggregation('ta1').field('f1'), @@ -317,12 +342,16 @@ exports.aggregations = { expected.myagg.min.script = 's1'; doTest(); - agg.lang('mvel'); - expected.myagg.min.lang = 'mvel'; + agg.scriptId('id1'); + expected.myagg.min.script_id = 'id1'; doTest(); - agg.scriptValuesSorted(false); - expected.myagg.min.script_values_sorted = false; + agg.scriptFile('file1'); + expected.myagg.min.script_file = 'file1'; + doTest(); + + agg.lang('mvel'); + expected.myagg.min.lang = 'mvel'; doTest(); agg.params({p1: 'v1'}); @@ -334,7 +363,7 @@ exports.aggregations = { test.done(); }, MaxAggregation: function (test) { - test.expect(9); + test.expect(10); var agg = ejs.MaxAggregation('myagg'), ta1 = ejs.TermsAggregation('ta1').field('f1'), @@ -359,12 +388,16 @@ exports.aggregations = { expected.myagg.max.script = 's1'; doTest(); - agg.lang('mvel'); - expected.myagg.max.lang = 'mvel'; + agg.scriptId('id1'); + expected.myagg.max.script_id = 'id1'; doTest(); - agg.scriptValuesSorted(false); - expected.myagg.max.script_values_sorted = false; + agg.scriptFile('file1'); + expected.myagg.max.script_file = 'file1'; + doTest(); + + agg.lang('mvel'); + expected.myagg.max.lang = 'mvel'; doTest(); agg.params({p1: 'v1'}); @@ -376,7 +409,7 @@ exports.aggregations = { test.done(); }, CardinalityAggregation: function (test) { - test.expect(10); + test.expect(12); var agg = ejs.CardinalityAggregation('myagg'), ta1 = ejs.TermsAggregation('ta1').field('f1'), @@ -401,6 +434,14 @@ exports.aggregations = { expected.myagg.cardinality.script = 's1'; doTest(); + agg.scriptId('id1'); + expected.myagg.cardinality.script_id = 'id1'; + doTest(); + + agg.scriptFile('file1'); + expected.myagg.cardinality.script_file = 'file1'; + doTest(); + agg.lang('mvel'); expected.myagg.cardinality.lang = 'mvel'; doTest(); @@ -422,7 +463,7 @@ exports.aggregations = { test.done(); }, AvgAggregation: function (test) { - test.expect(9); + test.expect(10); var agg = ejs.AvgAggregation('myagg'), ta1 = ejs.TermsAggregation('ta1').field('f1'), @@ -447,12 +488,16 @@ exports.aggregations = { expected.myagg.avg.script = 's1'; doTest(); - agg.lang('mvel'); - expected.myagg.avg.lang = 'mvel'; + agg.scriptId('id1'); + expected.myagg.avg.script_id = 'id1'; + doTest(); + + agg.scriptFile('file1'); + expected.myagg.avg.script_file = 'file1'; doTest(); - agg.scriptValuesSorted(false); - expected.myagg.avg.script_values_sorted = false; + agg.lang('mvel'); + expected.myagg.avg.lang = 'mvel'; doTest(); agg.params({p1: 'v1'}); @@ -668,7 +713,7 @@ exports.aggregations = { test.done(); }, IPv4RangeAggregation: function (test) { - test.expect(16); + test.expect(17); var agg = ejs.IPv4RangeAggregation('myagg'), ta1 = ejs.TermsAggregation('ta1').field('f1'), @@ -693,6 +738,14 @@ exports.aggregations = { expected.myagg.ip_range.script = 's1'; doTest(); + agg.scriptId('id1'); + expected.myagg.ip_range.script_id = 'id1'; + doTest(); + + agg.scriptFile('file1'); + expected.myagg.ip_range.script_file = 'file1'; + doTest(); + agg.lang('mvel'); expected.myagg.ip_range.lang = 'mvel'; doTest(); @@ -717,10 +770,6 @@ exports.aggregations = { expected.myagg.ip_range.keyed = true; doTest(); - agg.scriptValuesSorted(false); - expected.myagg.ip_range.script_values_sorted = false; - doTest(); - agg.params({p1: 'v1'}); expected.myagg.ip_range.params = {p1: 'v1'}; doTest(); @@ -738,7 +787,7 @@ exports.aggregations = { test.done(); }, DateRangeAggregation: function (test) { - test.expect(17); + test.expect(18); var agg = ejs.DateRangeAggregation('myagg'), ta1 = ejs.TermsAggregation('ta1').field('f1'), @@ -763,6 +812,14 @@ exports.aggregations = { expected.myagg.date_range.script = 's1'; doTest(); + agg.scriptId('id1'); + expected.myagg.date_range.script_id = 'id1'; + doTest(); + + agg.scriptFile('file1'); + expected.myagg.date_range.script_file = 'file1'; + doTest(); + agg.lang('mvel'); expected.myagg.date_range.lang = 'mvel'; doTest(); @@ -791,10 +848,6 @@ exports.aggregations = { expected.myagg.date_range.keyed = true; doTest(); - agg.scriptValuesSorted(false); - expected.myagg.date_range.script_values_sorted = false; - doTest(); - agg.params({p1: 'v1'}); expected.myagg.date_range.params = {p1: 'v1'}; doTest(); @@ -812,7 +865,7 @@ exports.aggregations = { test.done(); }, RangeAggregation: function (test) { - test.expect(16); + test.expect(17); var agg = ejs.RangeAggregation('myagg'), ta1 = ejs.TermsAggregation('ta1').field('f1'), @@ -837,6 +890,14 @@ exports.aggregations = { expected.myagg.range.script = 's1'; doTest(); + agg.scriptId('id1'); + expected.myagg.range.script_id = 'id1'; + doTest(); + + agg.scriptFile('file1'); + expected.myagg.range.script_file = 'file1'; + doTest(); + agg.lang('mvel'); expected.myagg.range.lang = 'mvel'; doTest(); @@ -861,10 +922,6 @@ exports.aggregations = { expected.myagg.range.keyed = true; doTest(); - agg.scriptValuesSorted(false); - expected.myagg.range.script_values_sorted = false; - doTest(); - agg.params({p1: 'v1'}); expected.myagg.range.params = {p1: 'v1'}; doTest(); @@ -915,6 +972,40 @@ exports.aggregations = { test.done(); }, + ChildrenAggregation: function (test) { + test.expect(7); + + var agg = ejs.ChildrenAggregation('myagg'), + ta1 = ejs.TermsAggregation('ta1').field('f1'), + expected, + doTest = function () { + test.deepEqual(agg.toJSON(), expected); + }; + + expected = { + myagg: {children: {}} + }; + + test.ok(agg, 'ChildrenAggregation exists'); + test.ok(agg.toJSON(), 'toJSON() works'); + doTest(); + + agg.children('f1'); + expected.myagg.children.type = 'f1'; + doTest(); + + agg.agg(ta1); + expected.myagg.aggs = ta1.toJSON(); + doTest(); + + test.strictEqual(agg._type(), 'aggregation'); + + test.throws(function () { + agg.agggregation('invalid'); + }, TypeError); + + test.done(); + }, MissingAggregation: function (test) { test.expect(7); @@ -950,7 +1041,7 @@ exports.aggregations = { test.done(); }, DateHistogramAggregation: function (test) { - test.expect(26); + test.expect(27); var agg = ejs.DateHistogramAggregation('myagg'), ta1 = ejs.TermsAggregation('ta1').field('f1'), @@ -975,6 +1066,14 @@ exports.aggregations = { expected.myagg.date_histogram.script = 's1'; doTest(); + agg.scriptId('id1'); + expected.myagg.date_histogram.script_id = 'id1'; + doTest(); + + agg.scriptFile('file1'); + expected.myagg.date_histogram.script_file = 'file1'; + doTest(); + agg.lang('mvel'); expected.myagg.date_histogram.lang = 'mvel'; doTest(); @@ -1027,10 +1126,6 @@ exports.aggregations = { expected.myagg.date_histogram.keyed = true; doTest(); - agg.scriptValuesSorted(false); - expected.myagg.date_histogram.script_values_sorted = false; - doTest(); - agg.preZoneAdjustLargeInterval(true); expected.myagg.date_histogram.pre_zone_adjust_large_interval = true; doTest(); @@ -1060,7 +1155,7 @@ exports.aggregations = { test.done(); }, HistogramAggregation: function (test) { - test.expect(20); + test.expect(21); var agg = ejs.HistogramAggregation('myagg'), ta1 = ejs.TermsAggregation('ta1').field('f1'), @@ -1085,6 +1180,14 @@ exports.aggregations = { expected.myagg.histogram.script = 's1'; doTest(); + agg.scriptId('id1'); + expected.myagg.histogram.script_id = 'id1'; + doTest(); + + agg.scriptFile('file1'); + expected.myagg.histogram.script_file = 'file1'; + doTest(); + agg.lang('mvel'); expected.myagg.histogram.lang = 'mvel'; doTest(); @@ -1117,10 +1220,6 @@ exports.aggregations = { expected.myagg.histogram.keyed = true; doTest(); - agg.scriptValuesSorted(false); - expected.myagg.histogram.script_values_sorted = false; - doTest(); - agg.params({p1: 'v1'}); expected.myagg.histogram.params = {p1: 'v1'}; doTest(); @@ -1192,7 +1291,7 @@ exports.aggregations = { test.done(); }, TermsAggregation: function (test) { - test.expect(32); + test.expect(25); var agg = ejs.TermsAggregation('myagg'), ta1 = ejs.TermsAggregation('ta1').field('f1'), @@ -1217,40 +1316,48 @@ exports.aggregations = { expected.myagg.terms.script = 's1'; doTest(); - agg.lang('mvel'); - expected.myagg.terms.lang = 'mvel'; + agg.scriptId('id1'); + expected.myagg.terms.script_id = 'id1'; doTest(); - agg.valueType('string'); - expected.myagg.terms.value_type = 'string'; + agg.scriptFile('file1'); + expected.myagg.terms.script_file = 'file1'; doTest(); - agg.valueType('invalid'); + agg.lang('mvel'); + expected.myagg.terms.lang = 'mvel'; doTest(); - agg.valueType('DOUBLE'); - expected.myagg.terms.value_type = 'double'; - doTest(); + // agg.valueType('string'); + // expected.myagg.terms.value_type = 'string'; + // doTest(); - agg.valueType('Float'); - expected.myagg.terms.value_type = 'float'; - doTest(); + // agg.valueType('invalid'); + // doTest(); - agg.valueType('long'); - expected.myagg.terms.value_type = 'long'; - doTest(); + // agg.valueType('DOUBLE'); + // expected.myagg.terms.value_type = 'double'; + // doTest(); - agg.valueType('integer'); - expected.myagg.terms.value_type = 'integer'; - doTest(); + // agg.valueType('Float'); + // expected.myagg.terms.value_type = 'float'; + // doTest(); - agg.valueType('short'); - expected.myagg.terms.value_type = 'short'; - doTest(); + // agg.valueType('long'); + // expected.myagg.terms.value_type = 'long'; + // doTest(); - agg.valueType('byte'); - expected.myagg.terms.value_type = 'byte'; - doTest(); + // agg.valueType('integer'); + // expected.myagg.terms.value_type = 'integer'; + // doTest(); + + // agg.valueType('short'); + // expected.myagg.terms.value_type = 'short'; + // doTest(); + + // agg.valueType('byte'); + // expected.myagg.terms.value_type = 'byte'; + // doTest(); agg.format('%Y-%m-%d'); expected.myagg.terms.format = '%Y-%m-%d'; @@ -1283,10 +1390,6 @@ exports.aggregations = { expected.myagg.terms.execution_hint = 'ordinals'; doTest(); - agg.scriptValuesUnique(false); - expected.myagg.terms.script_values_unique = false; - doTest(); - agg.size(10); expected.myagg.terms.size = 10; doTest(); @@ -1304,11 +1407,11 @@ exports.aggregations = { doTest(); agg.order('_count', 'asc'); - expected.myagg.terms.order = {'_count': 'asc'}; + expected.myagg.terms.order = [{'_count': 'asc'}]; doTest(); agg.order('_term', 'invalid'); - expected.myagg.terms.order = {'_term': 'desc'}; + expected.myagg.terms.order = [{'_count': 'asc'},{'_term': 'desc'}]; doTest(); agg.agg(ta1); @@ -1367,6 +1470,50 @@ exports.aggregations = { test.done(); }, + FiltersAggregation: function (test) { + test.expect(9); + + var agg = ejs.FiltersAggregation('myagg'), + tf1 = ejs.TermFilter('t1', 'v1'), + tf2 = ejs.TermFilter('t2', 'v2'), + ta1 = ejs.TermsAggregation('ta1'), + expected, + doTest = function () { + test.deepEqual(agg.toJSON(), expected); + }; + + expected = { + myagg: {filters:{filters:{}}} + }; + + test.ok(agg, 'FiltersAggregation exists'); + test.ok(agg.toJSON(), 'toJSON() works'); + doTest(); + + agg.filter(tf1, 'f1'); + expected.myagg.filters.filters.f1 = tf1.toJSON(); + doTest(); + + agg.filter(tf2, 'f2'); + expected.myagg.filters.filters.f2 = tf2.toJSON(); + doTest(); + + agg.agg(ta1); + expected.myagg.aggs = ta1.toJSON(); + doTest(); + + test.strictEqual(agg._type(), 'aggregation'); + + test.throws(function () { + agg.agggregation('invalid'); + }, TypeError); + + test.throws(function () { + agg.filter('invalid'); + }, TypeError); + + test.done(); + }, GlobalAggregation: function (test) { test.expect(8); @@ -1474,10 +1621,120 @@ exports.aggregations = { expected.myagg.top_hits._source = {includes: ['foo', 'bar']}; doTest(); - agg.source(['foo'], 'bar'); - expected.myagg.top_hits._source = 'bar'; + agg.source(['foo'], ['bar']); + expected.myagg.top_hits._source = {includes: ['foo'], excludes: ['bar']}; + doTest(); + + + test.done(); + }, + GeoBoundsAggregation: function (test) { + test.expect(6); + + var agg = ejs.GeoBoundsAggregation('myagg'), + expected, + doTest = function () { + test.deepEqual(agg.toJSON(), expected); + }; + + expected = { + myagg: {geo_bounds: {}} + }; + + test.ok(agg, 'GeoBoundsAggregation exists'); + test.ok(agg.toJSON(), 'toJSON() works'); + doTest(); + + agg.field('f1'); + expected.myagg.geo_bounds.field = 'f1'; + doTest(); + + agg.wrapLongitude(false); + expected.myagg.geo_bounds.wrap_longitude = false; + doTest(); + + test.strictEqual(agg._type(), 'aggregation'); + + test.done(); + }, + ScriptedMetricAggregation: function (test) { + test.expect(19); + + var agg = ejs.ScriptedMetricAggregation('myagg'), + expected, + doTest = function () { + test.deepEqual(agg.toJSON(), expected); + }; + + expected = { + myagg: {scripted_metric: {}} + }; + + test.ok(agg, 'ScriptedMetricAggregation exists'); + test.ok(agg.toJSON(), 'toJSON() works'); + doTest(); + + agg.initScript('s1'); + expected.myagg.scripted_metric.init_script = 's1'; doTest(); + agg.mapScript('m1'); + expected.myagg.scripted_metric.map_script = 'm1'; + doTest(); + + agg.combineScript('c1'); + expected.myagg.scripted_metric.combine_script = 'c1'; + doTest(); + + agg.reduceScript('r1'); + expected.myagg.scripted_metric.reduce_script = 'r1'; + doTest(); + + agg.initScriptFile('fs1'); + expected.myagg.scripted_metric.init_script_file = 'fs1'; + doTest(); + + agg.mapScriptFile('fm1'); + expected.myagg.scripted_metric.map_script_file = 'fm1'; + doTest(); + + agg.combineScriptFile('fc1'); + expected.myagg.scripted_metric.combine_script_file = 'fc1'; + doTest(); + + agg.reduceScriptFile('fr1'); + expected.myagg.scripted_metric.reduce_script_file = 'fr1'; + doTest(); + + agg.initScriptId('is1'); + expected.myagg.scripted_metric.init_script_id = 'is1'; + doTest(); + + agg.mapScriptId('im1'); + expected.myagg.scripted_metric.map_script_id = 'im1'; + doTest(); + + agg.combineScriptId('ic1'); + expected.myagg.scripted_metric.combine_script_id = 'ic1'; + doTest(); + + agg.reduceScriptId('ir1'); + expected.myagg.scripted_metric.reduce_script_id = 'ir1'; + doTest(); + + agg.params({p1: 'v1'}); + expected.myagg.scripted_metric.params = {p1: 'v1'}; + doTest(); + + agg.reduceParams({p2: 'v1'}); + expected.myagg.scripted_metric.reduce_params = {p2: 'v1'}; + doTest(); + + agg.lang('mvel'); + expected.myagg.scripted_metric.lang = 'mvel'; + doTest(); + + test.strictEqual(agg._type(), 'aggregation'); test.done(); } diff --git a/tests/filter_test.js b/tests/filter_test.js index 3617be0..46c9c05 100644 --- a/tests/filter_test.js +++ b/tests/filter_test.js @@ -334,10 +334,11 @@ exports.filters = { test.done(); }, NestedFilter: function (test) { - test.expect(14); + test.expect(15); var termQuery = ejs.TermQuery('tq1', 'v1'), termFilter = ejs.TermFilter('tf1', 'v1'), + innerHits = ejs.InnerHits(), nestedFilter = ejs.NestedFilter('root'), expected, doTest = function () { @@ -386,6 +387,10 @@ exports.filters = { expected.nested._cache_key = 'filter_cache_key'; doTest(); + nestedFilter.innerHits(innerHits); + expected.nested.inner_hits = innerHits.toJSON(); + doTest(); + test.strictEqual(nestedFilter._type(), 'filter'); @@ -598,11 +603,12 @@ exports.filters = { test.done(); }, HasParentFilter: function (test) { - test.expect(14); + test.expect(15); var termQuery = ejs.TermQuery('t1', 'v1'), termQuery2 = ejs.TermQuery('t2', 'v2'), termFilter = ejs.TermFilter('tf1', 'fv1'), + innerHits = ejs.InnerHits(), hasParentFilter = ejs.HasParentFilter(termQuery, 't1'), expected, doTest = function () { @@ -644,6 +650,10 @@ exports.filters = { expected.has_parent.filter = termFilter.toJSON(); doTest(); + hasParentFilter.innerHits(innerHits); + expected.has_parent.inner_hits = innerHits.toJSON(); + doTest(); + hasParentFilter = ejs.HasParentFilter(termFilter, 't1'); expected = { has_parent: { @@ -670,11 +680,13 @@ exports.filters = { test.done(); }, HasChildFilter: function (test) { - test.expect(15); + + test.expect(18); var termQuery = ejs.TermQuery('t1', 'v1'), termQuery2 = ejs.TermQuery('t2', 'v2'), termFilter = ejs.TermFilter('tf1', 'fv1'), + innerHits = ejs.InnerHits(), hasChildFilter = ejs.HasChildFilter(termQuery, 't1'), expected, doTest = function () { @@ -704,6 +716,14 @@ exports.filters = { expected.has_child.short_circuit_cutoff = 8192; doTest(); + hasChildFilter.minChildren(10); + expected.has_child.min_children = 10; + doTest(); + + hasChildFilter.maxChildren(10); + expected.has_child.max_children = 10; + doTest(); + hasChildFilter.name('haschild'); expected.has_child._name = 'haschild'; doTest(); @@ -720,6 +740,10 @@ exports.filters = { expected.has_child.filter = termFilter.toJSON(); doTest(); + hasChildFilter.innerHits(innerHits); + expected.has_child.inner_hits = innerHits.toJSON(); + doTest(); + hasChildFilter = ejs.HasChildFilter(termFilter, 't1'); expected = { has_child: { diff --git a/tests/query_test.js b/tests/query_test.js old mode 100644 new mode 100755 index 02efc16..a496084 --- a/tests/query_test.js +++ b/tests/query_test.js @@ -28,7 +28,7 @@ exports.queries = { done(); }, exists: function (test) { - test.expect(40); + test.expect(42); test.ok(ejs.CommonTermsQuery, 'CommonTermsQuery'); test.ok(ejs.RegexpQuery, 'RegexpQuery'); @@ -70,8 +70,10 @@ exports.queries = { // scoring functions for FunctionScoreQuery test.ok(ejs.BoostFactorScoreFunction, 'BoostFactorScoreFunction'); test.ok(ejs.DecayScoreFunction, 'DecayScoreFunction'); + test.ok(ejs.DecayScoreFunction, 'FieldValueFactorFunction'); test.ok(ejs.RandomScoreFunction, 'RandomScoreFunction'); test.ok(ejs.ScriptScoreFunction, 'ScriptScoreFunction'); + test.ok(ejs.ScoreFunction, 'ScoreFunction'); test.done(); }, @@ -149,6 +151,35 @@ exports.queries = { test.done(); }, + FieldValueFactorFunction: function (test) { + test.expect(6); + + var func = ejs.FieldValueFactorFunction('f'), + expected, + doTest = function () { + test.deepEqual(func.toJSON(), expected); + }; + + expected = { + field_value_factor: { field: 'f' } + }; + + test.ok(func, 'FieldValueFactorFunction exists'); + test.ok(func.toJSON(), 'toJSON() works'); + doTest(); + + func.factor(2); + expected.field_value_factor.factor = 2; + doTest(); + + func.modifier('sqrt'); + expected.field_value_factor.modifier = 'sqrt'; + doTest(); + + test.strictEqual(func._type(), 'score function'); + + test.done(); + }, ScriptScoreFunction: function (test) { test.expect(9); @@ -259,8 +290,36 @@ exports.queries = { test.done(); }, + ScoreFunction: function (test) { + test.expect(5); + + var scoreFunc = ejs.ScoreFunction(), + termFilter = ejs.TermFilter('tf1', 'vf1'), + expected, + doTest = function () { + test.deepEqual(scoreFunc.toJSON(), expected); + }; + + scoreFunc.weight(1.2); + + expected = { + weight: 1.2 + }; + + test.ok(scoreFunc, 'ScoreFunction exists'); + test.ok(scoreFunc.toJSON(), 'toJSON() works'); + doTest(); + + expected.filter = termFilter.toJSON(); + + scoreFunc.filter(termFilter); + doTest(); + + test.strictEqual(scoreFunc._type(), 'score function'); + test.done(); + }, FunctionScoreQuery: function (test) { - test.expect(30); + test.expect(31); var termQuery1 = ejs.TermQuery('t1', 'v1'), termFilter1 = ejs.TermFilter('tf1', 'fv1'), @@ -347,6 +406,10 @@ exports.queries = { expected.function_score.boost = 2; doTest(); + funcQuery.maxBoost(5); + expected.function_score.max_boost = 5; + doTest(); + funcQuery.function(randomScore); expected.function_score.functions = [randomScore.toJSON()]; doTest(); @@ -388,7 +451,7 @@ exports.queries = { test.done(); }, CommonTermsQuery: function (test) { - test.expect(21); + test.expect(22); var commonQuery = ejs.CommonTermsQuery(), expected, @@ -476,12 +539,16 @@ exports.queries = { expected.common.field2.analyzer = 'the analyzer'; doTest(); - commonQuery.minimumShouldMatch(10); - expected.common.field2.minimum_should_match = {low_freq: 10}; + commonQuery.minimumShouldMatch('10'); + expected.common.field2.minimum_should_match = '10'; + doTest(); + + commonQuery.minimumShouldMatch("3<90%"); + expected.common.field2.minimum_should_match = "3<90%"; doTest(); commonQuery.minimumShouldMatchLowFreq(5); - expected.common.field2.minimum_should_match.low_freq = 5; + expected.common.field2.minimum_should_match = { low_freq: 5 }; doTest(); commonQuery.minimumShouldMatchHighFreq(10); @@ -914,7 +981,7 @@ exports.queries = { test.done(); }, TermsQuery: function (test) { - test.expect(13); + test.expect(14); var termsQuery = ejs.TermsQuery('f1', ['t1', 't2']), expected, @@ -948,11 +1015,15 @@ exports.queries = { expected.terms.minimum_should_match = 2; doTest(); + termsQuery.minimumShouldMatch("3<90%"); + expected.terms.minimum_should_match = "3<90%"; + doTest(); + termsQuery.field('f2'); expected = { terms: { boost: 1.5, - minimum_should_match: 2, + minimum_should_match: "3<90%", f2: ['t3'] } }; @@ -1213,9 +1284,9 @@ exports.queries = { test.done(); }, MoreLikeThisQuery: function (test) { - test.expect(22); + test.expect(21); - var mltQuery = ejs.MoreLikeThisQuery(['f', 'f2'], 'like text'), + var mltQuery = ejs.MoreLikeThisQuery('like text'), expected, doTest = function () { test.deepEqual(mltQuery.toJSON(), expected); @@ -1224,7 +1295,6 @@ exports.queries = { expected = { mlt: { like_text: 'like text', - fields: ['f', 'f2'] } }; @@ -1232,16 +1302,16 @@ exports.queries = { test.ok(mltQuery.toJSON(), 'toJSON() works'); doTest(); - mltQuery = ejs.MoreLikeThisQuery('f', 'like text'); + mltQuery = ejs.MoreLikeThisQuery('like text'); expected = { mlt: { like_text: 'like text', - fields: ['f'] } }; doTest(); mltQuery.fields('f2'); + expected.mlt.fields = []; expected.mlt.fields.push('f2'); doTest(); @@ -1303,11 +1373,6 @@ exports.queries = { test.strictEqual(mltQuery._type(), 'query'); - - test.throws(function () { - ejs.MoreLikeThisQuery(9, 'like'); - }, TypeError); - test.throws(function () { mltQuery.fields(3); }, TypeError); @@ -1315,10 +1380,11 @@ exports.queries = { test.done(); }, HasParentQuery: function (test) { - test.expect(15); + test.expect(16); var termQuery = ejs.TermQuery('t1', 'v1'), termQuery2 = ejs.TermQuery('t2', 'v2'), + innerHits = ejs.InnerHits(), hasParentQuery = ejs.HasParentQuery(termQuery, 't1'), expected, doTest = function () { @@ -1370,6 +1436,10 @@ exports.queries = { expected.has_parent.boost = 1.2; doTest(); + hasParentQuery.innerHits(innerHits); + expected.has_parent.inner_hits = innerHits.toJSON(); + doTest(); + test.strictEqual(hasParentQuery._type(), 'query'); @@ -1384,10 +1454,12 @@ exports.queries = { test.done(); }, HasChildQuery: function (test) { - test.expect(20); + + test.expect(23); var termQuery = ejs.TermQuery('t1', 'v1'), termQuery2 = ejs.TermQuery('t2', 'v2'), + innerHits = ejs.InnerHits(), hasChildQuery = ejs.HasChildQuery(termQuery, 't1'), expected, doTest = function () { @@ -1455,10 +1527,22 @@ exports.queries = { expected.has_child.short_circuit_cutoff = 8192; doTest(); + hasChildQuery.minChildren(10); + expected.has_child.min_children = 10; + doTest(); + + hasChildQuery.maxChildren(10); + expected.has_child.max_children = 10; + doTest(); + hasChildQuery.boost(1.2); expected.has_child.boost = 1.2; doTest(); + hasChildQuery.innerHits(innerHits); + expected.has_child.inner_hits = innerHits.toJSON(); + doTest(); + test.strictEqual(hasChildQuery._type(), 'query'); @@ -1824,7 +1908,7 @@ exports.queries = { test.done(); }, MatchQuery: function (test) { - test.expect(39); + test.expect(40); var matchQuery = ejs.MatchQuery('t1', 'v1'), expected, @@ -1906,6 +1990,10 @@ exports.queries = { expected.match.t1.minimum_should_match = 10; doTest(); + matchQuery.minimumShouldMatch("3<90%"); + expected.match.t1.minimum_should_match = "3<90%"; + doTest(); + matchQuery.fuzzyRewrite('constant_score_auto'); expected.match.t1.fuzzy_rewrite = 'constant_score_auto'; doTest(); @@ -1985,7 +2073,7 @@ exports.queries = { test.done(); }, MultiMatchQuery: function (test) { - test.expect(45); + test.expect(48); var mmQuery = ejs.MultiMatchQuery('t', 'v1'), expected, @@ -2032,8 +2120,16 @@ exports.queries = { expected.multi_match.tie_breaker = 0.6; doTest(); - mmQuery.type('boolean'); - expected.multi_match.type = 'boolean'; + mmQuery.type('best_fields'); + expected.multi_match.type = 'best_fields'; + doTest(); + + mmQuery.type('cross_fields'); + expected.multi_match.type = 'cross_fields'; + doTest(); + + mmQuery.type('most_fields'); + expected.multi_match.type = 'most_fields'; doTest(); mmQuery.type('junk'); @@ -2086,6 +2182,10 @@ exports.queries = { expected.multi_match.minimum_should_match = 10; doTest(); + mmQuery.minimumShouldMatch("10%"); + expected.multi_match.minimum_should_match = "10%"; + doTest(); + mmQuery.fuzzyRewrite('constant_score_auto'); expected.multi_match.fuzzy_rewrite = 'constant_score_auto'; doTest(); @@ -2214,7 +2314,7 @@ exports.queries = { test.done(); }, BoolQuery: function (test) { - test.expect(21); + test.expect(22); var termQuery1 = ejs.TermQuery('t1', 'v1'), termQuery2 = ejs.TermQuery('t2', 'v2'), @@ -2278,6 +2378,10 @@ exports.queries = { expected.bool.minimum_number_should_match = 2; doTest(); + boolQuery.minimumNumberShouldMatch("2%"); + expected.bool.minimum_number_should_match = "2%"; + doTest(); + test.strictEqual(boolQuery._type(), 'query'); @@ -2361,7 +2465,7 @@ exports.queries = { test.done(); }, QueryStringQuery: function (test) { - test.expect(44); + test.expect(45); var queryString = ejs.QueryStringQuery('this AND that'), expected, @@ -2454,6 +2558,10 @@ exports.queries = { expected.query_string.minimum_should_match = 1; doTest(); + queryString.minimumShouldMatch("10%"); + expected.query_string.minimum_should_match = "10%"; + doTest(); + queryString.tieBreaker(1.1); expected.query_string.tie_breaker = 1.1; doTest(); @@ -2639,12 +2747,13 @@ exports.queries = { test.done(); }, NestedQuery: function (test) { - test.expect(18); + test.expect(19); var termQuery1 = ejs.TermQuery('t1', 'v1'), termQuery2 = ejs.TermQuery('t2', 'v2'), termFilter1 = ejs.TermFilter('tf1', 'v1'), termFilter2 = ejs.TermFilter('tf2', 'v2'), + innerHits = ejs.InnerHits(), nestedQuery = ejs.NestedQuery('root'), expected, doTest = function () { @@ -2708,6 +2817,10 @@ exports.queries = { expected.nested.boost = 3.2; doTest(); + nestedQuery.innerHits(innerHits); + expected.nested.inner_hits = innerHits.toJSON(); + doTest(); + test.strictEqual(nestedQuery._type(), 'query'); diff --git a/tests/search_test.js b/tests/search_test.js index 6133097..d20e735 100644 --- a/tests/search_test.js +++ b/tests/search_test.js @@ -28,10 +28,11 @@ exports.search = { done(); }, exists: function (test) { - test.expect(15); + test.expect(17); test.ok(ejs.Request, 'Request'); - test.ok(ejs.ScriptField, 'ScriptField'); + test.ok(ejs.PartialField, 'PartialField'); + test.ok(ejs.ScriptField, 'ScriptField'); test.ok(ejs.GeoPoint, 'GeoPoint'); test.ok(ejs.IndexedShape, 'IndexedShape'); test.ok(ejs.Shape, 'Shape'); @@ -45,6 +46,7 @@ exports.search = { test.ok(ejs.SuggestContextMixin, 'SuggestContextMixin'); test.ok(ejs.CompletionSuggester, 'CompletionSuggester'); test.ok(ejs.Rescore, 'Rescore'); + test.ok(ejs.InnerHits, 'InnerHits'); test.done(); }, @@ -1097,6 +1099,44 @@ exports.search = { test.strictEqual(geoPoint._type(), 'geo point'); + test.done(); + }, + PartialField: function (test) { + test.expect(8); + + var cp = ejs.PartialField('f'), + expected, + doTest = function () { + test.deepEqual(cp.toJSON(), expected); + }; + + expected = { + f: {} + }; + + test.ok(cp, 'PartialField exists'); + test.ok(cp.toJSON(), 'toJSON() works'); + doTest(); + + cp.include('f1'); + expected.f.include = 'f1'; + doTest(); + + cp.include(['f1','f2']); + expected.f.include = ['f1','f2']; + doTest(); + + cp.exclude('f1'); + expected.f.exclude = 'f1'; + doTest(); + + cp.exclude(['f1','f2']); + expected.f.exclude = ['f1','f2']; + doTest(); + + test.strictEqual(cp._type(), 'partial field'); + + test.done(); }, ScriptField: function (test) { @@ -1135,10 +1175,73 @@ exports.search = { test.strictEqual(cp._type(), 'script field'); + test.done(); + }, + InnerHits: function (test) { + test.expect(14); + + var ih = ejs.InnerHits(), + scriptField = ejs.ScriptField('my_script_field'), + expected, + doTest = function() { + test.deepEqual(ih.toJSON(), expected); + }; + + expected = {}; + + test.ok(ih, 'InnerHits exists'); + test.ok(ih.toJSON(), 'toJSON() works'); + + ih.name("foo"); + expected.name = "foo"; + doTest(); + + ih.from(5); + expected.from = 5; + doTest(); + + ih.size(10); + expected.size = 10; + doTest(); + + ih.sort('foo'); + expected.sort = 'foo'; + doTest(); + + ih.version(true); + expected.version = true; + doTest(); + + ih.explain(true); + expected.explain = true; + doTest(); + + ih.scriptField(scriptField); + expected.script_fields = scriptField.toJSON(); + doTest(); + + ih.fieldDataFields(['foo', 'bar']); + expected.fielddata_fields = ['foo', 'bar']; + doTest(); + + ih.source(true); + expected._source = true; + doTest(); + + ih.source(['foo', 'bar']); + expected._source = {includes: ['foo', 'bar']}; + doTest(); + + ih.source(['foo'], ['bar']); + expected._source = {includes: ['foo'], excludes: ['bar']}; + doTest(); + + test.strictEqual(ih._type(), 'inner hits'); + test.done(); }, Request: function (test) { - test.expect(56); + test.expect(58); var req = ejs.Request(), matchAll = ejs.MatchAllQuery(), @@ -1149,6 +1252,12 @@ exports.search = { globalAgg = ejs.GlobalAggregation('myglobal'), termsAgg = ejs.TermsAggregation('termsagg').field('afield'), filterAgg = ejs.FilterAggregation('filteragg').filter(termFilter), + partialField = ejs.PartialField('my_partial_field') + .include('f1') + .exclude('f2'), + partialField2 = ejs.PartialField('my_partial_field2') + .include('f1') + .exclude('f2'), scriptField = ejs.ScriptField('my_script_field') .script('doc["my_field_name"].value * 2'), scriptField2 = ejs.ScriptField('my_script_field2') @@ -1303,6 +1412,14 @@ exports.search = { expected.rescore = rescore.toJSON(); doTest(); + req.partialField(partialField); + expected.partial_fields = partialField.toJSON(); + doTest(); + + req.partialField(partialField2); + expected.partial_fields.my_partial_field2 = partialField2.toJSON().my_partial_field2; + doTest(); + req.scriptField(scriptField); expected.script_fields = scriptField.toJSON(); doTest();