From 06f9d7e7c17d7da9fbf316a93541fba70e812469 Mon Sep 17 00:00:00 2001 From: Philipp Jardas Date: Fri, 17 Oct 2014 12:40:11 +0200 Subject: [PATCH 01/56] added FieldValueFunction (issue #77) --- dist/elastic.js | 316 +++++++++++------- dist/elastic.min.js | 12 +- .../functions/FieldValueFactorFunction.js | 63 ++++ 3 files changed, 259 insertions(+), 132 deletions(-) create mode 100644 src/query/functions/FieldValueFactorFunction.js diff --git a/dist/elastic.js b/dist/elastic.js index 7aca7ed..0cbe2b0 100644 --- a/dist/elastic.js +++ b/dist/elastic.js @@ -1,7 +1,7 @@ -/*! elastic.js - v1.2.0 - 2014-10-13 - * https://github.com/fullscale/elastic.js - * Copyright (c) 2014 FullScale Labs, LLC; Licensed MIT */ - +/*! elastic.js - v1.2.0 - 2014-10-17 + * https://github.com/fullscale/elastic.js + * Copyright (c) 2014 FullScale Labs, LLC; Licensed MIT */ + /** @namespace @name ejs @@ -64,7 +64,7 @@ } else { ejs = root.ejs = {}; } - + /* Utility methods, most of which are pulled from underscore.js. */ // Shortcut function for checking if an object has a given property directly @@ -231,7 +231,7 @@ isScoreFunction = function (obj) { return (isEJSObject(obj) && obj._type() === 'score function'); }; - + /** @mixin

The AggregationMixin provides support for common options used across @@ -311,7 +311,7 @@ }; }; - + /** @mixin

The DirectSettingsMixin provides support for common options used across @@ -528,7 +528,7 @@ }; }; - + /** @mixin

The FacetMixin provides support for common options used across @@ -673,7 +673,7 @@ }; }; - + /** @mixin

The FilterMixin provides support for common options used across @@ -759,7 +759,7 @@ }; }; - + /** @mixin

The MetricsAggregationMixin provides support for common options used across @@ -871,7 +871,7 @@ }); }; - + /** @mixin

The QueryMixin provides support for common options used across @@ -926,7 +926,7 @@ }; }; - + /** @mixin

The ScoreFunctionMixin provides support for common options used across @@ -985,7 +985,7 @@ }; }; - + /** @mixin

The SuggestContextMixin provides support for suggest context settings @@ -1067,7 +1067,7 @@ }; }; - + /** @mixin

The SuggesterMixin provides support for the base setting of all suggesters. @@ -1124,7 +1124,7 @@ }; }; - + /** @class

The DateHistogram facet works with time-based values by building a histogram across time @@ -1463,7 +1463,7 @@ }); }; - + /** @class

The FilterFacet allows you to specify any valid Filter and @@ -1532,7 +1532,7 @@ }); }; - + /** @class

The geoDistanceFacet facet provides information over a range of distances from a @@ -1822,7 +1822,7 @@ }); }; - + /** @class

The histogram facet works with numeric data by building a histogram across intervals @@ -2088,7 +2088,7 @@ }); }; - + /** @class

The QueryFacet facet allows you to specify any valid Query and @@ -2157,7 +2157,7 @@ }); }; - + /** @class

A RangeFacet allows you to specify a set of ranges and get both the number of docs (count) that @@ -2386,7 +2386,7 @@ }); }; - + /** @class

A statistical facet allows you to compute statistical data over a numeric fields. Statistical data includes @@ -2523,7 +2523,7 @@ }); }; - + /** @class

A termsStatsFacet allows you to compute statistics over an aggregate key (term). Essentially this @@ -2746,7 +2746,7 @@ }); }; - + /** @class

A facet which returns the N most frequent terms within a collection @@ -3062,7 +3062,7 @@ }); }; - + /** @class

A single-value metrics aggregation that computes the average of numeric @@ -3095,7 +3095,7 @@ return _common; }; - + /** @class

A single-value metrics aggregation that calculates an approximate count of @@ -3169,7 +3169,7 @@ }); }; - + /** @class

A multi-bucket aggregation similar to the histogram except it can only be @@ -3509,7 +3509,7 @@ }); }; - + /** @class

A range aggregation that is dedicated for date values. The main difference @@ -3697,7 +3697,7 @@ }); }; - + /** @class

A multi-value metrics aggregation that computes stats over numeric values @@ -3734,7 +3734,7 @@ return _common; }; - + /** @class

Defines a single bucket of all the documents in the current document set @@ -3784,7 +3784,7 @@ }); }; - + /** @class

A multi-bucket aggregation that works on geo_point fields and conceptually @@ -3999,7 +3999,7 @@ }); }; - + /** @class

A multi-bucket aggregation that works on geo_point fields and groups points @@ -4100,7 +4100,7 @@ }); }; - + /** @class

Defines a single bucket of all the documents within the search execution @@ -4130,7 +4130,7 @@ return _common; }; - + /** @class

A multi-bucket values source based aggregation that can be applied on @@ -4368,7 +4368,7 @@ }); }; - + /** @class

A dedicated range aggregation for IPv4 typed fields.

@@ -4539,7 +4539,7 @@ }); }; - + /** @class

A single-value metrics aggregation that keeps track and returns the @@ -4572,7 +4572,7 @@ return _common; }; - + /** @class

A single-value metrics aggregation that keeps track and returns the @@ -4605,7 +4605,7 @@ return _common; }; - + /** @class

A field data based single bucket aggregation, that creates a bucket of all @@ -4653,7 +4653,7 @@ }); }; - + /** @class

A special single bucket aggregation that enables aggregating nested @@ -4701,7 +4701,7 @@ }); }; - + /** @class

A multi-value metrics aggregation that calculates one or more percentiles @@ -4815,7 +4815,7 @@ }); }; - + /** @class

A multi-bucket value source based aggregation that enables the user to @@ -4986,7 +4986,7 @@ }); }; - + /** @class

An aggregation that returns interesting or unusual occurrences of terms in @@ -5182,7 +5182,7 @@ }); }; - + /** @class

A multi-value metrics aggregation that computes stats over numeric values @@ -5217,7 +5217,7 @@ return _common; }; - + /** @class

A single-value metrics aggregation that sums up numeric values that are @@ -5250,7 +5250,7 @@ return _common; }; - + /** @class

A multi-bucket value source based aggregation where buckets are dynamically @@ -5560,7 +5560,7 @@ }); }; - + /** @class

A top_hits metric aggregator keeps track of the most relevant document being @@ -5787,7 +5787,7 @@ } }); }; - + /** @class

A single-value metrics aggregation that counts the number of values that @@ -5842,7 +5842,7 @@ }); }; - + /** @class A container Filter that allows Boolean AND composition of Filters. @@ -5924,7 +5924,7 @@ }); }; - + /** @class

A BoolFilter allows you to build Boolean filter constructs @@ -6075,7 +6075,7 @@ }); }; - + /** @class

An existsFilter matches documents where the specified field is present @@ -6122,7 +6122,7 @@ }); }; - + /** @class

A filter that restricts matched results/docs to a geographic bounding box described by @@ -6259,7 +6259,7 @@ }); }; - + /** @class

A filter that restricts matched results/docs to a given distance from the @@ -6442,7 +6442,7 @@ }); }; - + /** @class

A filter that restricts matched results/docs to a given distance range from the @@ -6760,7 +6760,7 @@ }); }; - + /** @class

A filter for locating documents that fall within a polygon of points. Simply provide a lon/lat @@ -6870,7 +6870,7 @@ }); }; - + /** @class

Efficient filtering of documents containing shapes indexed using the @@ -7024,7 +7024,7 @@ }); }; - + /** @class

The has_child filter results in parent documents that have child docs @@ -7150,7 +7150,7 @@ }); }; - + /** @class

The has_parent results in child documents that have parent docs matching @@ -7260,7 +7260,7 @@ }); }; - + /** @class

Filters documents that only have the provided ids. Note, this filter @@ -7353,7 +7353,7 @@ }); }; - + /** @class

The indices filter can be used when executed across multiple indices, @@ -7474,7 +7474,7 @@ }); }; - + /** @class

A limit filter limits the number of documents (per shard) to execute on.

@@ -7524,7 +7524,7 @@ }); }; - + /** @class

This filter can be used to match on all the documents @@ -7545,7 +7545,7 @@ ejs.MatchAllFilter = function () { return ejs.FilterMixin('match_all'); }; - + /** @class

An missingFilter matches documents where the specified field contains no legitimate value.

@@ -7624,7 +7624,7 @@ }); }; - + /** @class

Nested filters allow you to search against content within objects that are @@ -7763,7 +7763,7 @@ }); }; - + /** @class

A container Filter that excludes the documents matched by the @@ -7818,7 +7818,7 @@ }); }; - + /** @class

Filters documents with fields that have values within a certain numeric @@ -8038,7 +8038,7 @@ }); }; - + /** @class A container filter that allows Boolean OR composition of filters. @@ -8118,7 +8118,7 @@ }); }; - + /** @class

Filters documents that have fields containing terms with a specified prefix (not analyzed). Similar @@ -8188,7 +8188,7 @@ }); }; - + /** @class

Wraps any query to be used as a filter. Can be placed within queries @@ -8250,7 +8250,7 @@ }); }; - + /** @class

Matches documents with fields that have terms within a certain range.

@@ -8434,7 +8434,7 @@ }); }; - + /** @class

Filters documents that have a field value matching a regular expression. @@ -8551,7 +8551,7 @@ }); }; - + /** @class

A filter allowing to define scripts as filters

@@ -8631,7 +8631,7 @@ }); }; - + /** @class

Constructs a filter for docs matching any of the terms added to this @@ -8706,7 +8706,7 @@ }); }; - + /** @class

Filters documents that have fields that match any of the provided @@ -8939,7 +8939,7 @@ }); }; - + /** @class

A Filter that filters results by a specified index type.

@@ -8985,7 +8985,7 @@ }); }; - + /** @class

A boolQuery allows you to build Boolean query constructs @@ -9180,7 +9180,7 @@ }); }; - + /** @class

The boosting query can be used to effectively demote results that match @@ -9281,7 +9281,7 @@ }); }; - + /** @class

A query that executes high-frequency terms in a optional sub-query to @@ -9530,7 +9530,7 @@ }); }; - + /** @class

A constant score query wraps another Query or @@ -9636,7 +9636,7 @@ }); }; - + /** @class A query that generates the union of documents produced by its subqueries, and @@ -9727,7 +9727,7 @@ }); }; - + /** @class

Wrapper to allow SpanQuery objects participate in composite single-field @@ -9802,7 +9802,7 @@ }); }; - + /** @class

Filter queries allow you to restrict the results returned by a query. There are @@ -9958,7 +9958,7 @@ }); }; - + /** @class

The function_score allows you to modify the score of documents that are @@ -10141,7 +10141,7 @@ }); }; - + /** @class

The fuzzy_like_this_field query is the same as the fuzzy_like_this @@ -10343,7 +10343,7 @@ }); }; - + /** @class

Fuzzy like this query find documents that are “like” provided text by @@ -10532,7 +10532,7 @@ }); }; - + /** @class

A fuzzy search query based on the Damerau-Levenshtein (optimal string @@ -10739,7 +10739,7 @@ }); }; - + /** @class

Efficient querying of documents containing shapes indexed using the @@ -10906,7 +10906,7 @@ }); }; - + /** @class

The has_child query works the same as the has_child filter, @@ -11059,7 +11059,7 @@ }); }; - + /** @class

The has_parent query works the same as the has_parent filter, by @@ -11192,7 +11192,7 @@ }); }; - + /** @class

Filters documents that only have the provided ids. Note, this filter @@ -11283,7 +11283,7 @@ }); }; - + /** @class

The indices query can be used when executed across multiple indices, @@ -11401,7 +11401,7 @@ }); }; - + /** @class

This query can be used to match all the documents @@ -11420,7 +11420,7 @@ ejs.MatchAllQuery = function () { return ejs.QueryMixin('match_all'); }; - + /** @class A MatchQuery is a type of Query that accepts @@ -11792,7 +11792,7 @@ }); }; - + /** @class

The more_like_this_field query is the same as the more_like_this query, @@ -12068,7 +12068,7 @@ }); }; - + /** @class

More like this query find documents that are “like” provided text by @@ -12340,7 +12340,7 @@ }); }; - + /** @class A MultiMatchQuery query builds further on top of the @@ -12754,7 +12754,7 @@ }); }; - + /** @class

Nested queries allow you to search against content within objects that are @@ -12883,7 +12883,7 @@ }); }; - + /** @class

Matches documents that have fields containing terms with a specified @@ -13015,7 +13015,7 @@ }); }; - + /** @class

A query that is parsed using Lucene's default query parser. Although Lucene provides the @@ -13521,7 +13521,7 @@ }); }; - + /** @class

Matches documents with fields that have terms within a certain range. @@ -13721,7 +13721,7 @@ }); }; - + /** @class

Matches documents that have fields matching a regular expression. Based @@ -13899,7 +13899,7 @@ }); }; - + /** @class

Matches spans near the beginning of a field. The spanFirstQuery allows you to search @@ -13972,7 +13972,7 @@ }); }; - + /** @class

Wraps lucene MultiTermQueries as a SpanQuery so it can be used in the @@ -14030,7 +14030,7 @@ }); }; - + /** @class

A spanNearQuery will look to find a number of spanQuerys within a given @@ -14161,7 +14161,7 @@ }); }; - + /** @class

Removes matches which overlap with another span query. @@ -14237,7 +14237,7 @@ }); }; - + /** @class

The spanOrQuery takes an array of SpanQuerys and will match if any of the @@ -14317,7 +14317,7 @@ }); }; - + /** @class

A spanTermQuery is the basic unit of Lucene's Span Query which allows for nested, @@ -14402,7 +14402,7 @@ }); }; - + /** @class

A TermQuery can be used to return documents containing a given @@ -14489,7 +14489,7 @@ }); }; - + /** @class

A query that match on any (configurable) of the provided terms. This is @@ -14606,7 +14606,7 @@ }); }; - + /** @class

TThe top_children query runs the child query with an estimated hits size, @@ -14774,7 +14774,7 @@ }); }; - + /** @class

Matches documents that have fields matching a wildcard expression @@ -14912,7 +14912,7 @@ }); }; - + /** @class

The boost_factor score allows you to multiply the score by the provided @@ -14959,7 +14959,7 @@ }); }; - + /** @class

Decay functions score a document with a function that decays depending on @@ -15130,7 +15130,71 @@ }); }; - + + /** + @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_function'), + func = _common.toJSON(); + + func.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.factor; + } + + func.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.modifier; + } + + func.modifier = modifier; + return this; + } + + }); + }; + /** @class

The random_score generates scores via a pseudo random number algorithm @@ -15172,7 +15236,7 @@ }); }; - + /** @class

The script_score function allows you to wrap another query and customize @@ -15250,7 +15314,7 @@ }); }; - + /** @class

A GeoPoint object that can be used in queries and filters that @@ -15405,7 +15469,7 @@ } }; }; - + /** @class

Allows to highlight search results on one or more fields. In order to @@ -15852,7 +15916,7 @@ } }; }; - + /** @class

A shape which has already been indexed in another index and/or index @@ -15968,7 +16032,7 @@ } }; }; - + /** @class

The Request object provides methods generating an elasticsearch request body.

@@ -16520,7 +16584,7 @@ }; }; - + /** @class

A method that allows to rescore queries with a typically more expensive.

@@ -16687,7 +16751,7 @@ return rescore; } }; - }; + }; /** @class

ScriptField's allow you create dynamic fields on stored documents at query @@ -16800,7 +16864,7 @@ } }; }; - + /** @class

A Shape object that can be used in queries and filters that @@ -16918,7 +16982,7 @@ } }; }; - + /** @class

A Sort object that can be used in on the Request object to specify @@ -17361,7 +17425,7 @@ } }; }; - + /** @class @suggester @@ -17528,7 +17592,7 @@ }); }; - + /** @class

DirectGenerator is a candidate generator for PhraseSuggester. @@ -17653,7 +17717,7 @@ } }); }; - + /** @class

PhraseSuggester extends the PhraseSuggester and suggests @@ -17949,7 +18013,7 @@ }); }; - + /** @class

TermSuggester suggests terms based on edit distance. The provided suggest @@ -17999,7 +18063,7 @@ return extend(_common, _direct, _context); }; - + // run in noConflict mode ejs.noConflict = function () { root.ejs = _ejs; diff --git a/dist/elastic.min.js b/dist/elastic.min.js index e12d3d5..6d3faf7 100644 --- a/dist/elastic.min.js +++ b/dist/elastic.min.js @@ -1,8 +1,8 @@ -/*! elastic.js - v1.2.0 - 2014-10-13 - * https://github.com/fullscale/elastic.js - * Copyright (c) 2014 FullScale Labs, LLC; Licensed MIT */ - +/*! elastic.js - v1.2.0 - 2014-10-17 + * https://github.com/fullscale/elastic.js + * Copyright (c) 2014 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 +}})},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.FieldValueFactorFunction=function(a){var b=z.ScoreFunctionMixin("field_value_function"),d=b.toJSON();return d.field=a,c(b,{factor:function(a){return null==a?d.factor:(d.factor=a,this)},modifier:function(a){return null==a?d.modifier:(d.modifier=a,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 diff --git a/src/query/functions/FieldValueFactorFunction.js b/src/query/functions/FieldValueFactorFunction.js new file mode 100644 index 0000000..1921bf1 --- /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_function'), + func = _common.toJSON(); + + func.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.factor; + } + + func.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.modifier; + } + + func.modifier = modifier; + return this; + } + + }); + }; From 7f23a4c3e44c12dea8f09fe501d863ad02f74b2e Mon Sep 17 00:00:00 2001 From: Philipp Jardas Date: Fri, 17 Oct 2014 12:43:51 +0200 Subject: [PATCH 02/56] fixed function name from "field_value_function" for "field_value_factor" (issue #77) --- dist/elastic.js | 2 +- dist/elastic.min.js | 2 +- src/query/functions/FieldValueFactorFunction.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/elastic.js b/dist/elastic.js index 0cbe2b0..2f8dd85 100644 --- a/dist/elastic.js +++ b/dist/elastic.js @@ -15153,7 +15153,7 @@ ejs.FieldValueFactorFunction = function (field) { var - _common = ejs.ScoreFunctionMixin('field_value_function'), + _common = ejs.ScoreFunctionMixin('field_value_factor'), func = _common.toJSON(); func.field = field; diff --git a/dist/elastic.min.js b/dist/elastic.min.js index 6d3faf7..c63e730 100644 --- a/dist/elastic.min.js +++ b/dist/elastic.min.js @@ -4,5 +4,5 @@ (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.FieldValueFactorFunction=function(a){var b=z.ScoreFunctionMixin("field_value_function"),d=b.toJSON();return d.field=a,c(b,{factor:function(a){return null==a?d.factor:(d.factor=a,this)},modifier:function(a){return null==a?d.modifier:(d.modifier=a,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) +}})},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.FieldValueFactorFunction=function(a){var b=z.ScoreFunctionMixin("field_value_factor"),d=b.toJSON();return d.field=a,c(b,{factor:function(a){return null==a?d.factor:(d.factor=a,this)},modifier:function(a){return null==a?d.modifier:(d.modifier=a,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 diff --git a/src/query/functions/FieldValueFactorFunction.js b/src/query/functions/FieldValueFactorFunction.js index 1921bf1..4221ae4 100644 --- a/src/query/functions/FieldValueFactorFunction.js +++ b/src/query/functions/FieldValueFactorFunction.js @@ -20,7 +20,7 @@ ejs.FieldValueFactorFunction = function (field) { var - _common = ejs.ScoreFunctionMixin('field_value_function'), + _common = ejs.ScoreFunctionMixin('field_value_factor'), func = _common.toJSON(); func.field = field; From 3a43a10db6d2a03ca172990ac4f201b54bf5576a Mon Sep 17 00:00:00 2001 From: Philipp Jardas Date: Fri, 17 Oct 2014 12:48:40 +0200 Subject: [PATCH 03/56] fields have to be set using the function name as prefix (issue #77) --- src/query/functions/FieldValueFactorFunction.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/query/functions/FieldValueFactorFunction.js b/src/query/functions/FieldValueFactorFunction.js index 4221ae4..7afc359 100644 --- a/src/query/functions/FieldValueFactorFunction.js +++ b/src/query/functions/FieldValueFactorFunction.js @@ -23,7 +23,7 @@ _common = ejs.ScoreFunctionMixin('field_value_factor'), func = _common.toJSON(); - func.field = field; + func.field_value_factor.field = field; return extend(_common, { @@ -36,10 +36,10 @@ */ factor: function (factor) { if (factor == null) { - return func.factor; + return func.field_value_factor.factor; } - func.factor = factor; + func.field_value_factor.factor = factor; return this; }, @@ -52,10 +52,10 @@ */ modifier: function (modifier) { if (modifier == null) { - return func.modifier; + return func.field_value_factor.modifier; } - func.modifier = modifier; + func.field_value_factor.modifier = modifier; return this; } From 37011473567a898829c586bc972a884723da0379 Mon Sep 17 00:00:00 2001 From: Philipp Jardas Date: Fri, 17 Oct 2014 12:54:10 +0200 Subject: [PATCH 04/56] created dist (issue #77) --- dist/elastic.js | 10 +++++----- dist/elastic.min.js | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dist/elastic.js b/dist/elastic.js index 2f8dd85..34b0a31 100644 --- a/dist/elastic.js +++ b/dist/elastic.js @@ -15156,7 +15156,7 @@ _common = ejs.ScoreFunctionMixin('field_value_factor'), func = _common.toJSON(); - func.field = field; + func.field_value_factor.field = field; return extend(_common, { @@ -15169,10 +15169,10 @@ */ factor: function (factor) { if (factor == null) { - return func.factor; + return func.field_value_factor.factor; } - func.factor = factor; + func.field_value_factor.factor = factor; return this; }, @@ -15185,10 +15185,10 @@ */ modifier: function (modifier) { if (modifier == null) { - return func.modifier; + return func.field_value_factor.modifier; } - func.modifier = modifier; + func.field_value_factor.modifier = modifier; return this; } diff --git a/dist/elastic.min.js b/dist/elastic.min.js index c63e730..fd670ae 100644 --- a/dist/elastic.min.js +++ b/dist/elastic.min.js @@ -4,5 +4,5 @@ (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.FieldValueFactorFunction=function(a){var b=z.ScoreFunctionMixin("field_value_factor"),d=b.toJSON();return d.field=a,c(b,{factor:function(a){return null==a?d.factor:(d.factor=a,this)},modifier:function(a){return null==a?d.modifier:(d.modifier=a,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 +}})},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.FieldValueFactorFunction=function(a){var b=z.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)}})},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 From 388e8c438ab7d497f8e5bf24ccedadcca67e1982 Mon Sep 17 00:00:00 2001 From: Philipp Jardas Date: Fri, 17 Oct 2014 13:00:28 +0200 Subject: [PATCH 05/56] added unit tests (issue #77) --- tests/query_test.js | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/tests/query_test.js b/tests/query_test.js index 02efc16..05cadd7 100644 --- 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(41); test.ok(ejs.CommonTermsQuery, 'CommonTermsQuery'); test.ok(ejs.RegexpQuery, 'RegexpQuery'); @@ -70,6 +70,7 @@ 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'); @@ -149,6 +150,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); From 9f69918be44ea80bb558184eb7b1bdf80920e66d Mon Sep 17 00:00:00 2001 From: ErwanPigneul Date: Fri, 7 Nov 2014 21:56:22 +0100 Subject: [PATCH 06/56] Fix #79 : add support for geo bounds aggregations --- src/aggregations/GeoBoundsAggregation.js | 51 ++++++++++++++++++++++++ tests/aggregation_test.js | 32 ++++++++++++++- 2 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 src/aggregations/GeoBoundsAggregation.js diff --git a/src/aggregations/GeoBoundsAggregation.js b/src/aggregations/GeoBoundsAggregation.js new file mode 100644 index 0000000..becf7b4 --- /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.MetricsAggregationMixin.params as params + @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.scriptValuesSorted; + delete _common.script; + 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.wrapLongitude + @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/tests/aggregation_test.js b/tests/aggregation_test.js index 45e09de..4fc8bc8 100644 --- a/tests/aggregation_test.js +++ b/tests/aggregation_test.js @@ -28,7 +28,7 @@ exports.aggregations = { done(); }, exists: function (test) { - test.expect(23); + test.expect(24); test.ok(ejs.GlobalAggregation, 'GlobalAggregation'); test.ok(ejs.FilterAggregation, 'FilterAggregation'); @@ -53,6 +53,7 @@ exports.aggregations = { test.ok(ejs.GeoDistanceAggregation, 'GeoDistanceAggregation'); test.ok(ejs.IPv4RangeAggregation, 'IPv4RangeAggregation'); test.ok(ejs.TopHitsAggregation, 'TopHitsAggregation'); + test.ok(ejs.TopHitsAggregation, 'GeoBoundsAggregation'); test.done(); @@ -1479,6 +1480,35 @@ exports.aggregations = { 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(); } }; From fe999efaf4ba156df1e43457184686a42bee8406 Mon Sep 17 00:00:00 2001 From: ErwanPigneul Date: Fri, 7 Nov 2014 21:58:02 +0100 Subject: [PATCH 07/56] Remove a comment --- src/aggregations/GeoBoundsAggregation.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/aggregations/GeoBoundsAggregation.js b/src/aggregations/GeoBoundsAggregation.js index becf7b4..d33c7cd 100644 --- a/src/aggregations/GeoBoundsAggregation.js +++ b/src/aggregations/GeoBoundsAggregation.js @@ -5,7 +5,6 @@ @name ejs.GeoBoundsAggregation @ejs aggregation @borrows ejs.MetricsAggregationMixin.field as field - @borrows ejs.MetricsAggregationMixin.params as params @borrows ejs.AggregationMixin._type as _type @borrows ejs.AggregationMixin.toJSON as toJSON From 472718c2c2470c89767915b3c3c9728ce605243c Mon Sep 17 00:00:00 2001 From: ErwanPigneul Date: Fri, 7 Nov 2014 21:59:39 +0100 Subject: [PATCH 08/56] Set the right test --- tests/aggregation_test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/aggregation_test.js b/tests/aggregation_test.js index 4fc8bc8..4d45919 100644 --- a/tests/aggregation_test.js +++ b/tests/aggregation_test.js @@ -53,7 +53,7 @@ exports.aggregations = { test.ok(ejs.GeoDistanceAggregation, 'GeoDistanceAggregation'); test.ok(ejs.IPv4RangeAggregation, 'IPv4RangeAggregation'); test.ok(ejs.TopHitsAggregation, 'TopHitsAggregation'); - test.ok(ejs.TopHitsAggregation, 'GeoBoundsAggregation'); + test.ok(ejs.GeoBoundsAggregation, 'GeoBoundsAggregation'); test.done(); From d57b64d9009e173f7fdd36051fb200b0746c351c Mon Sep 17 00:00:00 2001 From: Philipp Jardas Date: Wed, 19 Nov 2014 12:54:35 +0100 Subject: [PATCH 09/56] Added max_boost to FunctionScoreQuery --- dist/elastic.js | 268 +++++++++++++++++--------------- dist/elastic.min.js | 14 +- src/query/FunctionScoreQuery.js | 16 ++ tests/query_test.js | 6 +- 4 files changed, 170 insertions(+), 134 deletions(-) diff --git a/dist/elastic.js b/dist/elastic.js index 7aca7ed..c6ebff7 100644 --- a/dist/elastic.js +++ b/dist/elastic.js @@ -1,7 +1,7 @@ -/*! elastic.js - v1.2.0 - 2014-10-13 - * https://github.com/fullscale/elastic.js - * Copyright (c) 2014 FullScale Labs, LLC; Licensed MIT */ - +/*! elastic.js - v1.2.0 - 2014-11-19 + * https://github.com/fullscale/elastic.js + * Copyright (c) 2014 FullScale Labs, LLC; Licensed MIT */ + /** @namespace @name ejs @@ -64,7 +64,7 @@ } else { ejs = root.ejs = {}; } - + /* Utility methods, most of which are pulled from underscore.js. */ // Shortcut function for checking if an object has a given property directly @@ -231,7 +231,7 @@ isScoreFunction = function (obj) { return (isEJSObject(obj) && obj._type() === 'score function'); }; - + /** @mixin

The AggregationMixin provides support for common options used across @@ -311,7 +311,7 @@ }; }; - + /** @mixin

The DirectSettingsMixin provides support for common options used across @@ -528,7 +528,7 @@ }; }; - + /** @mixin

The FacetMixin provides support for common options used across @@ -673,7 +673,7 @@ }; }; - + /** @mixin

The FilterMixin provides support for common options used across @@ -759,7 +759,7 @@ }; }; - + /** @mixin

The MetricsAggregationMixin provides support for common options used across @@ -871,7 +871,7 @@ }); }; - + /** @mixin

The QueryMixin provides support for common options used across @@ -926,7 +926,7 @@ }; }; - + /** @mixin

The ScoreFunctionMixin provides support for common options used across @@ -985,7 +985,7 @@ }; }; - + /** @mixin

The SuggestContextMixin provides support for suggest context settings @@ -1067,7 +1067,7 @@ }; }; - + /** @mixin

The SuggesterMixin provides support for the base setting of all suggesters. @@ -1124,7 +1124,7 @@ }; }; - + /** @class

The DateHistogram facet works with time-based values by building a histogram across time @@ -1463,7 +1463,7 @@ }); }; - + /** @class

The FilterFacet allows you to specify any valid Filter and @@ -1532,7 +1532,7 @@ }); }; - + /** @class

The geoDistanceFacet facet provides information over a range of distances from a @@ -1822,7 +1822,7 @@ }); }; - + /** @class

The histogram facet works with numeric data by building a histogram across intervals @@ -2088,7 +2088,7 @@ }); }; - + /** @class

The QueryFacet facet allows you to specify any valid Query and @@ -2157,7 +2157,7 @@ }); }; - + /** @class

A RangeFacet allows you to specify a set of ranges and get both the number of docs (count) that @@ -2386,7 +2386,7 @@ }); }; - + /** @class

A statistical facet allows you to compute statistical data over a numeric fields. Statistical data includes @@ -2523,7 +2523,7 @@ }); }; - + /** @class

A termsStatsFacet allows you to compute statistics over an aggregate key (term). Essentially this @@ -2746,7 +2746,7 @@ }); }; - + /** @class

A facet which returns the N most frequent terms within a collection @@ -3062,7 +3062,7 @@ }); }; - + /** @class

A single-value metrics aggregation that computes the average of numeric @@ -3095,7 +3095,7 @@ return _common; }; - + /** @class

A single-value metrics aggregation that calculates an approximate count of @@ -3169,7 +3169,7 @@ }); }; - + /** @class

A multi-bucket aggregation similar to the histogram except it can only be @@ -3509,7 +3509,7 @@ }); }; - + /** @class

A range aggregation that is dedicated for date values. The main difference @@ -3697,7 +3697,7 @@ }); }; - + /** @class

A multi-value metrics aggregation that computes stats over numeric values @@ -3734,7 +3734,7 @@ return _common; }; - + /** @class

Defines a single bucket of all the documents in the current document set @@ -3784,7 +3784,7 @@ }); }; - + /** @class

A multi-bucket aggregation that works on geo_point fields and conceptually @@ -3999,7 +3999,7 @@ }); }; - + /** @class

A multi-bucket aggregation that works on geo_point fields and groups points @@ -4100,7 +4100,7 @@ }); }; - + /** @class

Defines a single bucket of all the documents within the search execution @@ -4130,7 +4130,7 @@ return _common; }; - + /** @class

A multi-bucket values source based aggregation that can be applied on @@ -4368,7 +4368,7 @@ }); }; - + /** @class

A dedicated range aggregation for IPv4 typed fields.

@@ -4539,7 +4539,7 @@ }); }; - + /** @class

A single-value metrics aggregation that keeps track and returns the @@ -4572,7 +4572,7 @@ return _common; }; - + /** @class

A single-value metrics aggregation that keeps track and returns the @@ -4605,7 +4605,7 @@ return _common; }; - + /** @class

A field data based single bucket aggregation, that creates a bucket of all @@ -4653,7 +4653,7 @@ }); }; - + /** @class

A special single bucket aggregation that enables aggregating nested @@ -4701,7 +4701,7 @@ }); }; - + /** @class

A multi-value metrics aggregation that calculates one or more percentiles @@ -4815,7 +4815,7 @@ }); }; - + /** @class

A multi-bucket value source based aggregation that enables the user to @@ -4986,7 +4986,7 @@ }); }; - + /** @class

An aggregation that returns interesting or unusual occurrences of terms in @@ -5182,7 +5182,7 @@ }); }; - + /** @class

A multi-value metrics aggregation that computes stats over numeric values @@ -5217,7 +5217,7 @@ return _common; }; - + /** @class

A single-value metrics aggregation that sums up numeric values that are @@ -5250,7 +5250,7 @@ return _common; }; - + /** @class

A multi-bucket value source based aggregation where buckets are dynamically @@ -5560,7 +5560,7 @@ }); }; - + /** @class

A top_hits metric aggregator keeps track of the most relevant document being @@ -5787,7 +5787,7 @@ } }); }; - + /** @class

A single-value metrics aggregation that counts the number of values that @@ -5842,7 +5842,7 @@ }); }; - + /** @class A container Filter that allows Boolean AND composition of Filters. @@ -5924,7 +5924,7 @@ }); }; - + /** @class

A BoolFilter allows you to build Boolean filter constructs @@ -6075,7 +6075,7 @@ }); }; - + /** @class

An existsFilter matches documents where the specified field is present @@ -6122,7 +6122,7 @@ }); }; - + /** @class

A filter that restricts matched results/docs to a geographic bounding box described by @@ -6259,7 +6259,7 @@ }); }; - + /** @class

A filter that restricts matched results/docs to a given distance from the @@ -6442,7 +6442,7 @@ }); }; - + /** @class

A filter that restricts matched results/docs to a given distance range from the @@ -6760,7 +6760,7 @@ }); }; - + /** @class

A filter for locating documents that fall within a polygon of points. Simply provide a lon/lat @@ -6870,7 +6870,7 @@ }); }; - + /** @class

Efficient filtering of documents containing shapes indexed using the @@ -7024,7 +7024,7 @@ }); }; - + /** @class

The has_child filter results in parent documents that have child docs @@ -7150,7 +7150,7 @@ }); }; - + /** @class

The has_parent results in child documents that have parent docs matching @@ -7260,7 +7260,7 @@ }); }; - + /** @class

Filters documents that only have the provided ids. Note, this filter @@ -7353,7 +7353,7 @@ }); }; - + /** @class

The indices filter can be used when executed across multiple indices, @@ -7474,7 +7474,7 @@ }); }; - + /** @class

A limit filter limits the number of documents (per shard) to execute on.

@@ -7524,7 +7524,7 @@ }); }; - + /** @class

This filter can be used to match on all the documents @@ -7545,7 +7545,7 @@ ejs.MatchAllFilter = function () { return ejs.FilterMixin('match_all'); }; - + /** @class

An missingFilter matches documents where the specified field contains no legitimate value.

@@ -7624,7 +7624,7 @@ }); }; - + /** @class

Nested filters allow you to search against content within objects that are @@ -7763,7 +7763,7 @@ }); }; - + /** @class

A container Filter that excludes the documents matched by the @@ -7818,7 +7818,7 @@ }); }; - + /** @class

Filters documents with fields that have values within a certain numeric @@ -8038,7 +8038,7 @@ }); }; - + /** @class A container filter that allows Boolean OR composition of filters. @@ -8118,7 +8118,7 @@ }); }; - + /** @class

Filters documents that have fields containing terms with a specified prefix (not analyzed). Similar @@ -8188,7 +8188,7 @@ }); }; - + /** @class

Wraps any query to be used as a filter. Can be placed within queries @@ -8250,7 +8250,7 @@ }); }; - + /** @class

Matches documents with fields that have terms within a certain range.

@@ -8434,7 +8434,7 @@ }); }; - + /** @class

Filters documents that have a field value matching a regular expression. @@ -8551,7 +8551,7 @@ }); }; - + /** @class

A filter allowing to define scripts as filters

@@ -8631,7 +8631,7 @@ }); }; - + /** @class

Constructs a filter for docs matching any of the terms added to this @@ -8706,7 +8706,7 @@ }); }; - + /** @class

Filters documents that have fields that match any of the provided @@ -8939,7 +8939,7 @@ }); }; - + /** @class

A Filter that filters results by a specified index type.

@@ -8985,7 +8985,7 @@ }); }; - + /** @class

A boolQuery allows you to build Boolean query constructs @@ -9180,7 +9180,7 @@ }); }; - + /** @class

The boosting query can be used to effectively demote results that match @@ -9281,7 +9281,7 @@ }); }; - + /** @class

A query that executes high-frequency terms in a optional sub-query to @@ -9530,7 +9530,7 @@ }); }; - + /** @class

A constant score query wraps another Query or @@ -9636,7 +9636,7 @@ }); }; - + /** @class A query that generates the union of documents produced by its subqueries, and @@ -9727,7 +9727,7 @@ }); }; - + /** @class

Wrapper to allow SpanQuery objects participate in composite single-field @@ -9802,7 +9802,7 @@ }); }; - + /** @class

Filter queries allow you to restrict the results returned by a query. There are @@ -9958,7 +9958,7 @@ }); }; - + /** @class

The function_score allows you to modify the score of documents that are @@ -10085,6 +10085,22 @@ 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; + }, + /** Add a single score function to the list of existing functions. @@ -10141,7 +10157,7 @@ }); }; - + /** @class

The fuzzy_like_this_field query is the same as the fuzzy_like_this @@ -10343,7 +10359,7 @@ }); }; - + /** @class

Fuzzy like this query find documents that are “like” provided text by @@ -10532,7 +10548,7 @@ }); }; - + /** @class

A fuzzy search query based on the Damerau-Levenshtein (optimal string @@ -10739,7 +10755,7 @@ }); }; - + /** @class

Efficient querying of documents containing shapes indexed using the @@ -10906,7 +10922,7 @@ }); }; - + /** @class

The has_child query works the same as the has_child filter, @@ -11059,7 +11075,7 @@ }); }; - + /** @class

The has_parent query works the same as the has_parent filter, by @@ -11192,7 +11208,7 @@ }); }; - + /** @class

Filters documents that only have the provided ids. Note, this filter @@ -11283,7 +11299,7 @@ }); }; - + /** @class

The indices query can be used when executed across multiple indices, @@ -11401,7 +11417,7 @@ }); }; - + /** @class

This query can be used to match all the documents @@ -11420,7 +11436,7 @@ ejs.MatchAllQuery = function () { return ejs.QueryMixin('match_all'); }; - + /** @class A MatchQuery is a type of Query that accepts @@ -11792,7 +11808,7 @@ }); }; - + /** @class

The more_like_this_field query is the same as the more_like_this query, @@ -12068,7 +12084,7 @@ }); }; - + /** @class

More like this query find documents that are “like” provided text by @@ -12340,7 +12356,7 @@ }); }; - + /** @class A MultiMatchQuery query builds further on top of the @@ -12754,7 +12770,7 @@ }); }; - + /** @class

Nested queries allow you to search against content within objects that are @@ -12883,7 +12899,7 @@ }); }; - + /** @class

Matches documents that have fields containing terms with a specified @@ -13015,7 +13031,7 @@ }); }; - + /** @class

A query that is parsed using Lucene's default query parser. Although Lucene provides the @@ -13521,7 +13537,7 @@ }); }; - + /** @class

Matches documents with fields that have terms within a certain range. @@ -13721,7 +13737,7 @@ }); }; - + /** @class

Matches documents that have fields matching a regular expression. Based @@ -13899,7 +13915,7 @@ }); }; - + /** @class

Matches spans near the beginning of a field. The spanFirstQuery allows you to search @@ -13972,7 +13988,7 @@ }); }; - + /** @class

Wraps lucene MultiTermQueries as a SpanQuery so it can be used in the @@ -14030,7 +14046,7 @@ }); }; - + /** @class

A spanNearQuery will look to find a number of spanQuerys within a given @@ -14161,7 +14177,7 @@ }); }; - + /** @class

Removes matches which overlap with another span query. @@ -14237,7 +14253,7 @@ }); }; - + /** @class

The spanOrQuery takes an array of SpanQuerys and will match if any of the @@ -14317,7 +14333,7 @@ }); }; - + /** @class

A spanTermQuery is the basic unit of Lucene's Span Query which allows for nested, @@ -14402,7 +14418,7 @@ }); }; - + /** @class

A TermQuery can be used to return documents containing a given @@ -14489,7 +14505,7 @@ }); }; - + /** @class

A query that match on any (configurable) of the provided terms. This is @@ -14606,7 +14622,7 @@ }); }; - + /** @class

TThe top_children query runs the child query with an estimated hits size, @@ -14774,7 +14790,7 @@ }); }; - + /** @class

Matches documents that have fields matching a wildcard expression @@ -14912,7 +14928,7 @@ }); }; - + /** @class

The boost_factor score allows you to multiply the score by the provided @@ -14959,7 +14975,7 @@ }); }; - + /** @class

Decay functions score a document with a function that decays depending on @@ -15130,7 +15146,7 @@ }); }; - + /** @class

The random_score generates scores via a pseudo random number algorithm @@ -15172,7 +15188,7 @@ }); }; - + /** @class

The script_score function allows you to wrap another query and customize @@ -15250,7 +15266,7 @@ }); }; - + /** @class

A GeoPoint object that can be used in queries and filters that @@ -15405,7 +15421,7 @@ } }; }; - + /** @class

Allows to highlight search results on one or more fields. In order to @@ -15852,7 +15868,7 @@ } }; }; - + /** @class

A shape which has already been indexed in another index and/or index @@ -15968,7 +15984,7 @@ } }; }; - + /** @class

The Request object provides methods generating an elasticsearch request body.

@@ -16520,7 +16536,7 @@ }; }; - + /** @class

A method that allows to rescore queries with a typically more expensive.

@@ -16687,7 +16703,7 @@ return rescore; } }; - }; + }; /** @class

ScriptField's allow you create dynamic fields on stored documents at query @@ -16800,7 +16816,7 @@ } }; }; - + /** @class

A Shape object that can be used in queries and filters that @@ -16918,7 +16934,7 @@ } }; }; - + /** @class

A Sort object that can be used in on the Request object to specify @@ -17361,7 +17377,7 @@ } }; }; - + /** @class @suggester @@ -17528,7 +17544,7 @@ }); }; - + /** @class

DirectGenerator is a candidate generator for PhraseSuggester. @@ -17653,7 +17669,7 @@ } }); }; - + /** @class

PhraseSuggester extends the PhraseSuggester and suggests @@ -17949,7 +17965,7 @@ }); }; - + /** @class

TermSuggester suggests terms based on edit distance. The provided suggest @@ -17999,7 +18015,7 @@ return extend(_common, _direct, _context); }; - + // run in noConflict mode ejs.noConflict = function () { root.ejs = _ejs; diff --git a/dist/elastic.min.js b/dist/elastic.min.js index e12d3d5..b0e8b84 100644 --- a/dist/elastic.min.js +++ b/dist/elastic.min.js @@ -1,8 +1,8 @@ -/*! elastic.js - v1.2.0 - 2014-10-13 - * https://github.com/fullscale/elastic.js - * Copyright (c) 2014 FullScale Labs, LLC; Licensed MIT */ - +/*! elastic.js - v1.2.0 - 2014-11-19 + * https://github.com/fullscale/elastic.js + * Copyright (c) 2014 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 +}}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)},maxBoost:function(a){return null==a?b.function_score.max_boost:(b.function_score.max_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 diff --git a/src/query/FunctionScoreQuery.js b/src/query/FunctionScoreQuery.js index b2ce5ea..ba39010 100644 --- a/src/query/FunctionScoreQuery.js +++ b/src/query/FunctionScoreQuery.js @@ -124,6 +124,22 @@ 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; + }, + /** Add a single score function to the list of existing functions. diff --git a/tests/query_test.js b/tests/query_test.js index 02efc16..5fc4f97 100644 --- a/tests/query_test.js +++ b/tests/query_test.js @@ -260,7 +260,7 @@ exports.queries = { test.done(); }, FunctionScoreQuery: function (test) { - test.expect(30); + test.expect(31); var termQuery1 = ejs.TermQuery('t1', 'v1'), termFilter1 = ejs.TermFilter('tf1', 'fv1'), @@ -347,6 +347,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(); From dea46e2935ef3c862d33161e4e3e770c38c4050d Mon Sep 17 00:00:00 2001 From: Bruce Chu Date: Sun, 4 Jan 2015 16:36:28 -0800 Subject: [PATCH 10/56] fix for multi_match query to support type in ['best_fields', 'cross_fields', 'most_fields'] --- dist/elastic.js | 6 +++--- src/query/MultiMatchQuery.js | 2 +- tests/query_test.js | 14 +++++++++++--- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/dist/elastic.js b/dist/elastic.js index 7aca7ed..f327384 100644 --- a/dist/elastic.js +++ b/dist/elastic.js @@ -1,6 +1,6 @@ -/*! elastic.js - v1.2.0 - 2014-10-13 +/*! elastic.js - v1.2.0 - 2015-01-04 * https://github.com/fullscale/elastic.js - * Copyright (c) 2014 FullScale Labs, LLC; Licensed MIT */ + * Copyright (c) 2015 FullScale Labs, LLC; Licensed MIT */ /** @namespace @@ -12623,7 +12623,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/MultiMatchQuery.js b/src/query/MultiMatchQuery.js index 26a10e4..4bccb95 100644 --- a/src/query/MultiMatchQuery.js +++ b/src/query/MultiMatchQuery.js @@ -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/tests/query_test.js b/tests/query_test.js index 02efc16..1fc2166 100644 --- a/tests/query_test.js +++ b/tests/query_test.js @@ -1985,7 +1985,7 @@ exports.queries = { test.done(); }, MultiMatchQuery: function (test) { - test.expect(45); + test.expect(47); var mmQuery = ejs.MultiMatchQuery('t', 'v1'), expected, @@ -2032,8 +2032,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'); From 3be9d821fb795a9981ebc67044002914110d23d0 Mon Sep 17 00:00:00 2001 From: vaishaks Date: Fri, 17 Apr 2015 03:53:13 +0530 Subject: [PATCH 11/56] Fixed the exclude param error in TopHitsAggreagation. --- dist/elastic.js | 8 ++++---- dist/elastic.min.js | 14 ++++++++------ src/aggregations/TopHitsAggregation.js | 4 ++-- tests/aggregation_test.js | 4 ++-- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/dist/elastic.js b/dist/elastic.js index 7aca7ed..9c52bf6 100644 --- a/dist/elastic.js +++ b/dist/elastic.js @@ -1,6 +1,6 @@ -/*! elastic.js - v1.2.0 - 2014-10-13 +/*! elastic.js - v1.2.0 - 2015-04-17 * https://github.com/fullscale/elastic.js - * Copyright (c) 2014 FullScale Labs, LLC; Licensed MIT */ + * Copyright (c) 2015 FullScale Labs, LLC; Licensed MIT */ /** @namespace @@ -5778,8 +5778,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/dist/elastic.min.js b/dist/elastic.min.js index e12d3d5..c47eddc 100644 --- a/dist/elastic.min.js +++ b/dist/elastic.min.js @@ -1,8 +1,10 @@ -/*! elastic.js - v1.2.0 - 2014-10-13 +/*! elastic.js - v1.2.0 - 2015-04-17 * https://github.com/fullscale/elastic.js - * Copyright (c) 2014 FullScale Labs, LLC; Licensed MIT */ + * Copyright (c) 2015 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=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(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}}},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},null!=c&&(d[a].top_hits._source.excludes=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(a){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(a){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(a){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 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)}})},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(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)}})},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(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)}})},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(a){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(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)}})},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 diff --git a/src/aggregations/TopHitsAggregation.js b/src/aggregations/TopHitsAggregation.js index 309bbeb..8390825 100644 --- a/src/aggregations/TopHitsAggregation.js +++ b/src/aggregations/TopHitsAggregation.js @@ -215,8 +215,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/tests/aggregation_test.js b/tests/aggregation_test.js index 45e09de..eaa08ad 100644 --- a/tests/aggregation_test.js +++ b/tests/aggregation_test.js @@ -1474,8 +1474,8 @@ 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(); From 5ba1c21df24c42e301c4621437ce2a9c11a92ab1 Mon Sep 17 00:00:00 2001 From: Fredrik Bondza Date: Wed, 6 May 2015 16:31:40 +0200 Subject: [PATCH 12/56] Allow to set weight for Score Functions --- src/mixins/ScoreFunctionMixin.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/mixins/ScoreFunctionMixin.js b/src/mixins/ScoreFunctionMixin.js index b3f03de..dcb8fd8 100644 --- a/src/mixins/ScoreFunctionMixin.js +++ b/src/mixins/ScoreFunctionMixin.js @@ -33,6 +33,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. From 537271c99bec479988bb72d486336ac61915b823 Mon Sep 17 00:00:00 2001 From: Fredrik Bondza Date: Wed, 6 May 2015 16:39:31 +0200 Subject: [PATCH 13/56] Added min_score to FunctionScoreQuery --- src/query/FunctionScoreQuery.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/query/FunctionScoreQuery.js b/src/query/FunctionScoreQuery.js index 11183c2..cbb23d8 100755 --- a/src/query/FunctionScoreQuery.js +++ b/src/query/FunctionScoreQuery.js @@ -140,6 +140,22 @@ 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. From 8dff3a96043755073244a69c9196d04f44c6e19d Mon Sep 17 00:00:00 2001 From: Fredrik Bondza Date: Wed, 6 May 2015 17:06:04 +0200 Subject: [PATCH 14/56] Source files should not be executable --- src/query/functions/FieldValueFactorFunction.js | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 src/query/functions/FieldValueFactorFunction.js diff --git a/src/query/functions/FieldValueFactorFunction.js b/src/query/functions/FieldValueFactorFunction.js old mode 100755 new mode 100644 From 6ed3324169a6d6bda3d4ac0e9577c6abb41dada2 Mon Sep 17 00:00:00 2001 From: Fredrik Bondza Date: Wed, 6 May 2015 17:16:39 +0200 Subject: [PATCH 15/56] Allow if name is missing do not set it to an object Allows to create a minimal score function that contains only a filter and weight. See documentation: http://www.elastic.co/guide/en/elasticsearch/reference/1.x/query-dsl-function-score-query.html --- src/mixins/ScoreFunctionMixin.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mixins/ScoreFunctionMixin.js b/src/mixins/ScoreFunctionMixin.js index dcb8fd8..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 { From 582b413987406083015a7f55c44c132abf1a4a78 Mon Sep 17 00:00:00 2001 From: Fredrik Bondza Date: Wed, 6 May 2015 17:18:59 +0200 Subject: [PATCH 16/56] Added a minimal filter score function --- src/query/functions/FilterScoreFunction.js | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/query/functions/FilterScoreFunction.js diff --git a/src/query/functions/FilterScoreFunction.js b/src/query/functions/FilterScoreFunction.js new file mode 100644 index 0000000..af405cb --- /dev/null +++ b/src/query/functions/FilterScoreFunction.js @@ -0,0 +1,24 @@ + /** + @class +

A basic filter score function, which mathces a filter and applies a + weight.

+ + @name ejs.FilterScoreFunction + @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.FilterScoreFunction = function () { + + var + _common = ejs.ScoreFunctionMixin(), + func = _common.toJSON(); + + return extend(_common, {}); + }; From aad686bccb4c17f4bfb4ec8c35efeb7400a4dbf0 Mon Sep 17 00:00:00 2001 From: Fredrik Bondza Date: Wed, 6 May 2015 17:33:12 +0200 Subject: [PATCH 17/56] Update dist --- dist/elastic.js | 320 ++++++++++++++++++++++++++------------------ dist/elastic.min.js | 16 +-- 2 files changed, 200 insertions(+), 136 deletions(-) diff --git a/dist/elastic.js b/dist/elastic.js index 2cd6895..d7fea08 100755 --- a/dist/elastic.js +++ b/dist/elastic.js @@ -1,7 +1,7 @@ -/*! elastic.js - v1.2.0 - 2014-11-19 - * https://github.com/fullscale/elastic.js - * Copyright (c) 2014 FullScale Labs, LLC; Licensed MIT */ - +/*! elastic.js - v1.2.0 - 2015-05-06 + * https://github.com/fullscale/elastic.js + * Copyright (c) 2015 FullScale Labs, LLC; Licensed MIT */ + /** @namespace @name ejs @@ -64,7 +64,7 @@ } else { ejs = root.ejs = {}; } - + /* Utility methods, most of which are pulled from underscore.js. */ // Shortcut function for checking if an object has a given property directly @@ -231,7 +231,7 @@ isScoreFunction = function (obj) { return (isEJSObject(obj) && obj._type() === 'score function'); }; - + /** @mixin

The AggregationMixin provides support for common options used across @@ -311,7 +311,7 @@ }; }; - + /** @mixin

The DirectSettingsMixin provides support for common options used across @@ -528,7 +528,7 @@ }; }; - + /** @mixin

The FacetMixin provides support for common options used across @@ -673,7 +673,7 @@ }; }; - + /** @mixin

The FilterMixin provides support for common options used across @@ -759,7 +759,7 @@ }; }; - + /** @mixin

The MetricsAggregationMixin provides support for common options used across @@ -871,7 +871,7 @@ }); }; - + /** @mixin

The QueryMixin provides support for common options used across @@ -926,7 +926,7 @@ }; }; - + /** @mixin

The ScoreFunctionMixin provides support for common options used across @@ -938,7 +938,10 @@ ejs.ScoreFunctionMixin = function (name) { var func = {}; - func[name] = {}; + + if (name != null) { + func[name] = {}; + } return { @@ -962,6 +965,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. @@ -985,7 +1008,7 @@ }; }; - + /** @mixin

The SuggestContextMixin provides support for suggest context settings @@ -1067,7 +1090,7 @@ }; }; - + /** @mixin

The SuggesterMixin provides support for the base setting of all suggesters. @@ -1124,7 +1147,7 @@ }; }; - + /** @class

The DateHistogram facet works with time-based values by building a histogram across time @@ -1463,7 +1486,7 @@ }); }; - + /** @class

The FilterFacet allows you to specify any valid Filter and @@ -1532,7 +1555,7 @@ }); }; - + /** @class

The geoDistanceFacet facet provides information over a range of distances from a @@ -1822,7 +1845,7 @@ }); }; - + /** @class

The histogram facet works with numeric data by building a histogram across intervals @@ -2088,7 +2111,7 @@ }); }; - + /** @class

The QueryFacet facet allows you to specify any valid Query and @@ -2157,7 +2180,7 @@ }); }; - + /** @class

A RangeFacet allows you to specify a set of ranges and get both the number of docs (count) that @@ -2386,7 +2409,7 @@ }); }; - + /** @class

A statistical facet allows you to compute statistical data over a numeric fields. Statistical data includes @@ -2523,7 +2546,7 @@ }); }; - + /** @class

A termsStatsFacet allows you to compute statistics over an aggregate key (term). Essentially this @@ -2746,7 +2769,7 @@ }); }; - + /** @class

A facet which returns the N most frequent terms within a collection @@ -3062,7 +3085,7 @@ }); }; - + /** @class

A single-value metrics aggregation that computes the average of numeric @@ -3095,7 +3118,7 @@ return _common; }; - + /** @class

A single-value metrics aggregation that calculates an approximate count of @@ -3169,7 +3192,7 @@ }); }; - + /** @class

A multi-bucket aggregation similar to the histogram except it can only be @@ -3509,7 +3532,7 @@ }); }; - + /** @class

A range aggregation that is dedicated for date values. The main difference @@ -3697,7 +3720,7 @@ }); }; - + /** @class

A multi-value metrics aggregation that computes stats over numeric values @@ -3734,7 +3757,7 @@ return _common; }; - + /** @class

Defines a single bucket of all the documents in the current document set @@ -3784,7 +3807,7 @@ }); }; - + /** @class

A multi-bucket aggregation that works on geo_point fields and conceptually @@ -3999,7 +4022,7 @@ }); }; - + /** @class

A multi-bucket aggregation that works on geo_point fields and groups points @@ -4100,7 +4123,7 @@ }); }; - + /** @class

Defines a single bucket of all the documents within the search execution @@ -4130,7 +4153,7 @@ return _common; }; - + /** @class

A multi-bucket values source based aggregation that can be applied on @@ -4368,7 +4391,7 @@ }); }; - + /** @class

A dedicated range aggregation for IPv4 typed fields.

@@ -4539,7 +4562,7 @@ }); }; - + /** @class

A single-value metrics aggregation that keeps track and returns the @@ -4572,7 +4595,7 @@ return _common; }; - + /** @class

A single-value metrics aggregation that keeps track and returns the @@ -4605,7 +4628,7 @@ return _common; }; - + /** @class

A field data based single bucket aggregation, that creates a bucket of all @@ -4653,7 +4676,7 @@ }); }; - + /** @class

A special single bucket aggregation that enables aggregating nested @@ -4701,7 +4724,7 @@ }); }; - + /** @class

A multi-value metrics aggregation that calculates one or more percentiles @@ -4815,7 +4838,7 @@ }); }; - + /** @class

A multi-bucket value source based aggregation that enables the user to @@ -4986,7 +5009,7 @@ }); }; - + /** @class

An aggregation that returns interesting or unusual occurrences of terms in @@ -5182,7 +5205,7 @@ }); }; - + /** @class

A multi-value metrics aggregation that computes stats over numeric values @@ -5217,7 +5240,7 @@ return _common; }; - + /** @class

A single-value metrics aggregation that sums up numeric values that are @@ -5250,7 +5273,7 @@ return _common; }; - + /** @class

A multi-bucket value source based aggregation where buckets are dynamically @@ -5560,7 +5583,7 @@ }); }; - + /** @class

A top_hits metric aggregator keeps track of the most relevant document being @@ -5787,7 +5810,7 @@ } }); }; - + /** @class

A single-value metrics aggregation that counts the number of values that @@ -5842,7 +5865,7 @@ }); }; - + /** @class A container Filter that allows Boolean AND composition of Filters. @@ -5924,7 +5947,7 @@ }); }; - + /** @class

A BoolFilter allows you to build Boolean filter constructs @@ -6075,7 +6098,7 @@ }); }; - + /** @class

An existsFilter matches documents where the specified field is present @@ -6122,7 +6145,7 @@ }); }; - + /** @class

A filter that restricts matched results/docs to a geographic bounding box described by @@ -6259,7 +6282,7 @@ }); }; - + /** @class

A filter that restricts matched results/docs to a given distance from the @@ -6442,7 +6465,7 @@ }); }; - + /** @class

A filter that restricts matched results/docs to a given distance range from the @@ -6760,7 +6783,7 @@ }); }; - + /** @class

A filter for locating documents that fall within a polygon of points. Simply provide a lon/lat @@ -6870,7 +6893,7 @@ }); }; - + /** @class

Efficient filtering of documents containing shapes indexed using the @@ -7024,7 +7047,7 @@ }); }; - + /** @class

The has_child filter results in parent documents that have child docs @@ -7150,7 +7173,7 @@ }); }; - + /** @class

The has_parent results in child documents that have parent docs matching @@ -7260,7 +7283,7 @@ }); }; - + /** @class

Filters documents that only have the provided ids. Note, this filter @@ -7353,7 +7376,7 @@ }); }; - + /** @class

The indices filter can be used when executed across multiple indices, @@ -7474,7 +7497,7 @@ }); }; - + /** @class

A limit filter limits the number of documents (per shard) to execute on.

@@ -7524,7 +7547,7 @@ }); }; - + /** @class

This filter can be used to match on all the documents @@ -7545,7 +7568,7 @@ ejs.MatchAllFilter = function () { return ejs.FilterMixin('match_all'); }; - + /** @class

An missingFilter matches documents where the specified field contains no legitimate value.

@@ -7624,7 +7647,7 @@ }); }; - + /** @class

Nested filters allow you to search against content within objects that are @@ -7763,7 +7786,7 @@ }); }; - + /** @class

A container Filter that excludes the documents matched by the @@ -7818,7 +7841,7 @@ }); }; - + /** @class

Filters documents with fields that have values within a certain numeric @@ -8038,7 +8061,7 @@ }); }; - + /** @class A container filter that allows Boolean OR composition of filters. @@ -8118,7 +8141,7 @@ }); }; - + /** @class

Filters documents that have fields containing terms with a specified prefix (not analyzed). Similar @@ -8188,7 +8211,7 @@ }); }; - + /** @class

Wraps any query to be used as a filter. Can be placed within queries @@ -8250,7 +8273,7 @@ }); }; - + /** @class

Matches documents with fields that have terms within a certain range.

@@ -8434,7 +8457,7 @@ }); }; - + /** @class

Filters documents that have a field value matching a regular expression. @@ -8551,7 +8574,7 @@ }); }; - + /** @class

A filter allowing to define scripts as filters

@@ -8631,7 +8654,7 @@ }); }; - + /** @class

Constructs a filter for docs matching any of the terms added to this @@ -8706,7 +8729,7 @@ }); }; - + /** @class

Filters documents that have fields that match any of the provided @@ -8939,7 +8962,7 @@ }); }; - + /** @class

A Filter that filters results by a specified index type.

@@ -8985,7 +9008,7 @@ }); }; - + /** @class

A boolQuery allows you to build Boolean query constructs @@ -9180,7 +9203,7 @@ }); }; - + /** @class

The boosting query can be used to effectively demote results that match @@ -9281,7 +9304,7 @@ }); }; - + /** @class

A query that executes high-frequency terms in a optional sub-query to @@ -9530,7 +9553,7 @@ }); }; - + /** @class

A constant score query wraps another Query or @@ -9636,7 +9659,7 @@ }); }; - + /** @class A query that generates the union of documents produced by its subqueries, and @@ -9727,7 +9750,7 @@ }); }; - + /** @class

Wrapper to allow SpanQuery objects participate in composite single-field @@ -9802,7 +9825,7 @@ }); }; - + /** @class

Filter queries allow you to restrict the results returned by a query. There are @@ -9958,7 +9981,7 @@ }); }; - + /** @class

The function_score allows you to modify the score of documents that are @@ -10101,6 +10124,22 @@ 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. @@ -10157,7 +10196,7 @@ }); }; - + /** @class

The fuzzy_like_this_field query is the same as the fuzzy_like_this @@ -10359,7 +10398,7 @@ }); }; - + /** @class

Fuzzy like this query find documents that are “like” provided text by @@ -10548,7 +10587,7 @@ }); }; - + /** @class

A fuzzy search query based on the Damerau-Levenshtein (optimal string @@ -10755,7 +10794,7 @@ }); }; - + /** @class

Efficient querying of documents containing shapes indexed using the @@ -10922,7 +10961,7 @@ }); }; - + /** @class

The has_child query works the same as the has_child filter, @@ -11075,7 +11114,7 @@ }); }; - + /** @class

The has_parent query works the same as the has_parent filter, by @@ -11208,7 +11247,7 @@ }); }; - + /** @class

Filters documents that only have the provided ids. Note, this filter @@ -11299,7 +11338,7 @@ }); }; - + /** @class

The indices query can be used when executed across multiple indices, @@ -11417,7 +11456,7 @@ }); }; - + /** @class

This query can be used to match all the documents @@ -11436,7 +11475,7 @@ ejs.MatchAllQuery = function () { return ejs.QueryMixin('match_all'); }; - + /** @class A MatchQuery is a type of Query that accepts @@ -11808,7 +11847,7 @@ }); }; - + /** @class

The more_like_this_field query is the same as the more_like_this query, @@ -12084,7 +12123,7 @@ }); }; - + /** @class

More like this query find documents that are “like” provided text by @@ -12356,7 +12395,7 @@ }); }; - + /** @class A MultiMatchQuery query builds further on top of the @@ -12770,7 +12809,7 @@ }); }; - + /** @class

Nested queries allow you to search against content within objects that are @@ -12899,7 +12938,7 @@ }); }; - + /** @class

Matches documents that have fields containing terms with a specified @@ -13031,7 +13070,7 @@ }); }; - + /** @class

A query that is parsed using Lucene's default query parser. Although Lucene provides the @@ -13537,7 +13576,7 @@ }); }; - + /** @class

Matches documents with fields that have terms within a certain range. @@ -13737,7 +13776,7 @@ }); }; - + /** @class

Matches documents that have fields matching a regular expression. Based @@ -13915,7 +13954,7 @@ }); }; - + /** @class

Matches spans near the beginning of a field. The spanFirstQuery allows you to search @@ -13988,7 +14027,7 @@ }); }; - + /** @class

Wraps lucene MultiTermQueries as a SpanQuery so it can be used in the @@ -14046,7 +14085,7 @@ }); }; - + /** @class

A spanNearQuery will look to find a number of spanQuerys within a given @@ -14177,7 +14216,7 @@ }); }; - + /** @class

Removes matches which overlap with another span query. @@ -14253,7 +14292,7 @@ }); }; - + /** @class

The spanOrQuery takes an array of SpanQuerys and will match if any of the @@ -14333,7 +14372,7 @@ }); }; - + /** @class

A spanTermQuery is the basic unit of Lucene's Span Query which allows for nested, @@ -14418,7 +14457,7 @@ }); }; - + /** @class

A TermQuery can be used to return documents containing a given @@ -14505,7 +14544,7 @@ }); }; - + /** @class

A query that match on any (configurable) of the provided terms. This is @@ -14622,7 +14661,7 @@ }); }; - + /** @class

TThe top_children query runs the child query with an estimated hits size, @@ -14790,7 +14829,7 @@ }); }; - + /** @class

Matches documents that have fields matching a wildcard expression @@ -14928,7 +14967,7 @@ }); }; - + /** @class

The boost_factor score allows you to multiply the score by the provided @@ -14975,7 +15014,7 @@ }); }; - + /** @class

Decay functions score a document with a function that decays depending on @@ -15146,7 +15185,7 @@ }); }; - + /** @class

The field_value_factor function allows you to use a field from a document to @@ -15210,7 +15249,32 @@ }); }; - + + /** + @class +

A basic filter score function, which mathces a filter and applies a + weight.

+ + @name ejs.FilterScoreFunction + @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.FilterScoreFunction = function () { + + var + _common = ejs.ScoreFunctionMixin(), + func = _common.toJSON(); + + return extend(_common, {}); + }; + /** @class

The random_score generates scores via a pseudo random number algorithm @@ -15252,7 +15316,7 @@ }); }; - + /** @class

The script_score function allows you to wrap another query and customize @@ -15330,7 +15394,7 @@ }); }; - + /** @class

A GeoPoint object that can be used in queries and filters that @@ -15485,7 +15549,7 @@ } }; }; - + /** @class

Allows to highlight search results on one or more fields. In order to @@ -15932,7 +15996,7 @@ } }; }; - + /** @class

A shape which has already been indexed in another index and/or index @@ -16048,7 +16112,7 @@ } }; }; - + /** @class

The Request object provides methods generating an elasticsearch request body.

@@ -16600,7 +16664,7 @@ }; }; - + /** @class

A method that allows to rescore queries with a typically more expensive.

@@ -16767,7 +16831,7 @@ return rescore; } }; - }; + }; /** @class

ScriptField's allow you create dynamic fields on stored documents at query @@ -16880,7 +16944,7 @@ } }; }; - + /** @class

A Shape object that can be used in queries and filters that @@ -16998,7 +17062,7 @@ } }; }; - + /** @class

A Sort object that can be used in on the Request object to specify @@ -17441,7 +17505,7 @@ } }; }; - + /** @class @suggester @@ -17608,7 +17672,7 @@ }); }; - + /** @class

DirectGenerator is a candidate generator for PhraseSuggester. @@ -17733,7 +17797,7 @@ } }); }; - + /** @class

PhraseSuggester extends the PhraseSuggester and suggests @@ -18029,7 +18093,7 @@ }); }; - + /** @class

TermSuggester suggests terms based on edit distance. The provided suggest @@ -18079,7 +18143,7 @@ return extend(_common, _direct, _context); }; - + // run in noConflict mode ejs.noConflict = function () { root.ejs = _ejs; diff --git a/dist/elastic.min.js b/dist/elastic.min.js index 61a121b..db0a49a 100755 --- a/dist/elastic.min.js +++ b/dist/elastic.min.js @@ -1,8 +1,8 @@ -/*! elastic.js - v1.2.0 - 2014-11-19 - * https://github.com/fullscale/elastic.js - * Copyright (c) 2014 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)},maxBoost:function(a){return null==a?b.function_score.max_boost:(b.function_score.max_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.FieldValueFactorFunction=function(a){var b=z.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)}})},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 +/*! elastic.js - v1.2.0 - 2015-05-06 + * https://github.com/fullscale/elastic.js + * Copyright (c) 2015 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(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}}},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 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}}},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(a){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(a){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(a){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 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)}})},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)},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(!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(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)}})},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(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)}})},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(a){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(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)}})},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.FieldValueFactorFunction=function(a){var b=z.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)}})},z.FilterScoreFunction=function(){var a=z.ScoreFunctionMixin();a.toJSON();return c(a,{})},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 From c0108fa89dab8162cc95cb8f0a630c972506c754 Mon Sep 17 00:00:00 2001 From: Fredrik Bondza Date: Wed, 6 May 2015 18:08:15 +0200 Subject: [PATCH 18/56] Filter and weight are mandatory Otherwise Elasticsearch will return an exception --- src/query/functions/FilterScoreFunction.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/query/functions/FilterScoreFunction.js b/src/query/functions/FilterScoreFunction.js index af405cb..5c508a7 100644 --- a/src/query/functions/FilterScoreFunction.js +++ b/src/query/functions/FilterScoreFunction.js @@ -14,11 +14,18 @@

Randomly score documents.

*/ - ejs.FilterScoreFunction = function () { + ejs.FilterScoreFunction = function (filter, weight) { var _common = ejs.ScoreFunctionMixin(), func = _common.toJSON(); + if ((filter == null || !isFilter(filter)) || weight == null) { + throw new Error("filter must be a Filter and weight must be a Number"); + } + + func.filter = filter; + func.weight = weight; + return extend(_common, {}); }; From f386dca01e48fb596183256945d55d9a69ea05c0 Mon Sep 17 00:00:00 2001 From: Fredrik Bondza Date: Wed, 6 May 2015 20:47:04 +0200 Subject: [PATCH 19/56] Use the basic mixin object directly --- src/query/functions/FilterScoreFunction.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/query/functions/FilterScoreFunction.js b/src/query/functions/FilterScoreFunction.js index 5c508a7..b576d2e 100644 --- a/src/query/functions/FilterScoreFunction.js +++ b/src/query/functions/FilterScoreFunction.js @@ -17,15 +17,14 @@ ejs.FilterScoreFunction = function (filter, weight) { var - _common = ejs.ScoreFunctionMixin(), - func = _common.toJSON(); + _common = ejs.ScoreFunctionMixin(); - if ((filter == null || !isFilter(filter)) || weight == null) { - throw new Error("filter must be a Filter and weight must be a Number"); + if (filter == null || weight == null) { + throw new Error("Filter and weight is required"); } - func.filter = filter; - func.weight = weight; + _common.filter(filter); + _common.weight(weight); - return extend(_common, {}); + return _common; }; From 4ebe0767087cec8040882fb7a4b64dacb307765c Mon Sep 17 00:00:00 2001 From: Fredrik Bondza Date: Wed, 6 May 2015 20:47:36 +0200 Subject: [PATCH 20/56] Update dist --- dist/elastic.js | 14 ++++++++++---- dist/elastic.min.js | 4 ++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/dist/elastic.js b/dist/elastic.js index d7fea08..4412d4b 100755 --- a/dist/elastic.js +++ b/dist/elastic.js @@ -15266,13 +15266,19 @@

Randomly score documents.

*/ - ejs.FilterScoreFunction = function () { + ejs.FilterScoreFunction = function (filter, weight) { var - _common = ejs.ScoreFunctionMixin(), - func = _common.toJSON(); + _common = ejs.ScoreFunctionMixin(); + + if (filter == null || weight == null) { + throw new Error("Filter and weight is required"); + } - return extend(_common, {}); + _common.filter(filter); + _common.weight(weight); + + return _common; }; /** diff --git a/dist/elastic.min.js b/dist/elastic.min.js index db0a49a..a395228 100755 --- a/dist/elastic.min.js +++ b/dist/elastic.min.js @@ -4,5 +4,5 @@ (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(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}}},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 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}}},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(a){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(a){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(a){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 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)}})},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)},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(!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(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)}})},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(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)}})},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(a){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(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)}})},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.FieldValueFactorFunction=function(a){var b=z.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)}})},z.FilterScoreFunction=function(){var a=z.ScoreFunctionMixin();a.toJSON();return c(a,{})},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 +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(a){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(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)}})},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.FieldValueFactorFunction=function(a){var b=z.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)}})},z.FilterScoreFunction=function(a,b){var c=z.ScoreFunctionMixin();if(null==a||null==b)throw new Error("Filter and weight is required");return c.filter(a),c.weight(b),c},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 From 9a815d668cecaa5df2f7a0afad1e996304dfd668 Mon Sep 17 00:00:00 2001 From: Fredrik Bondza Date: Mon, 11 May 2015 09:36:10 +0200 Subject: [PATCH 21/56] Rename FilterScoreFunction to ScoreFunction --- dist/elastic.js | 57 ++++++++----------- dist/elastic.min.js | 6 +- ...ilterScoreFunction.js => ScoreFunction.js} | 11 +--- 3 files changed, 30 insertions(+), 44 deletions(-) mode change 100755 => 100644 dist/elastic.js mode change 100755 => 100644 dist/elastic.min.js rename src/query/functions/{FilterScoreFunction.js => ScoreFunction.js} (65%) diff --git a/dist/elastic.js b/dist/elastic.js old mode 100755 new mode 100644 index 4412d4b..a3c8001 --- a/dist/elastic.js +++ b/dist/elastic.js @@ -1,4 +1,4 @@ -/*! elastic.js - v1.2.0 - 2015-05-06 +/*! elastic.js - v1.2.0 - 2015-05-11 * https://github.com/fullscale/elastic.js * Copyright (c) 2015 FullScale Labs, LLC; Licensed MIT */ @@ -15250,37 +15250,6 @@ }); }; - /** - @class -

A basic filter score function, which mathces a filter and applies a - weight.

- - @name ejs.FilterScoreFunction - @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.FilterScoreFunction = function (filter, weight) { - - var - _common = ejs.ScoreFunctionMixin(); - - if (filter == null || weight == null) { - throw new Error("Filter and weight is required"); - } - - _common.filter(filter); - _common.weight(weight); - - return _common; - }; - /** @class

The random_score generates scores via a pseudo random number algorithm @@ -15323,6 +15292,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 diff --git a/dist/elastic.min.js b/dist/elastic.min.js old mode 100755 new mode 100644 index a395228..5c4127b --- a/dist/elastic.min.js +++ b/dist/elastic.min.js @@ -1,8 +1,8 @@ -/*! elastic.js - v1.2.0 - 2015-05-06 +/*! elastic.js - v1.2.0 - 2015-05-11 * https://github.com/fullscale/elastic.js * Copyright (c) 2015 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(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}}},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 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}}},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(a){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(a){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(a){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 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)}})},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)},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(!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(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)}})},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(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)}})},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(a){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(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)}})},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.FieldValueFactorFunction=function(a){var b=z.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)}})},z.FilterScoreFunction=function(a,b){var c=z.ScoreFunctionMixin();if(null==a||null==b)throw new Error("Filter and weight is required");return c.filter(a),c.weight(b),c},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 +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(a){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(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)}})},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.FieldValueFactorFunction=function(a){var b=z.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)}})},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.ScoreFunction=function(){var a=z.ScoreFunctionMixin();return a},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 diff --git a/src/query/functions/FilterScoreFunction.js b/src/query/functions/ScoreFunction.js similarity index 65% rename from src/query/functions/FilterScoreFunction.js rename to src/query/functions/ScoreFunction.js index b576d2e..811100c 100644 --- a/src/query/functions/FilterScoreFunction.js +++ b/src/query/functions/ScoreFunction.js @@ -3,7 +3,7 @@

A basic filter score function, which mathces a filter and applies a weight.

- @name ejs.FilterScoreFunction + @name ejs.ScoreFunction @ejs scorefunction @borrows ejs.ScoreFunctionMixin.filter as filter @borrows ejs.ScoreFunctionMixin.weight as weight @@ -14,17 +14,10 @@

Randomly score documents.

*/ - ejs.FilterScoreFunction = function (filter, weight) { + ejs.ScoreFunction = function () { var _common = ejs.ScoreFunctionMixin(); - if (filter == null || weight == null) { - throw new Error("Filter and weight is required"); - } - - _common.filter(filter); - _common.weight(weight); - return _common; }; From dc05fbb94cd35484072f1cb755f243a040b2aff1 Mon Sep 17 00:00:00 2001 From: Fredrik Bondza Date: Mon, 11 May 2015 09:47:34 +0200 Subject: [PATCH 22/56] Added test for ScoreFunction --- tests/query_test.js | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/tests/query_test.js b/tests/query_test.js index ac53274..4f53190 100755 --- a/tests/query_test.js +++ b/tests/query_test.js @@ -28,7 +28,7 @@ exports.queries = { done(); }, exists: function (test) { - test.expect(41); + test.expect(42); test.ok(ejs.CommonTermsQuery, 'CommonTermsQuery'); test.ok(ejs.RegexpQuery, 'RegexpQuery'); @@ -73,6 +73,7 @@ exports.queries = { test.ok(ejs.DecayScoreFunction, 'FieldValueFactorFunction'); test.ok(ejs.RandomScoreFunction, 'RandomScoreFunction'); test.ok(ejs.ScriptScoreFunction, 'ScriptScoreFunction'); + test.ok(ejs.ScoreFunction, 'ScoreFunction'); test.done(); }, @@ -289,6 +290,39 @@ exports.queries = { test.done(); }, + ScoreFunction: function (test) { + test.expect(6); + + 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.throws(function () { + scoreFunc.filter('invalid'); + }, TypeError); + + test.done(); + }, FunctionScoreQuery: function (test) { test.expect(31); From 1a9901d997c9e784a2c2e452aef394a07d9ee0e4 Mon Sep 17 00:00:00 2001 From: Thomas Cashman Date: Thu, 21 May 2015 15:17:53 +0100 Subject: [PATCH 23/56] Added ScriptedMetricAggregation --- .gitignore | 1 + dist/elastic.js | 103 +++++++++++++++++- dist/elastic.min.js | 12 +- src/aggregations/ScriptedMetricAggregation.js | 98 +++++++++++++++++ 4 files changed, 206 insertions(+), 8 deletions(-) create mode 100644 src/aggregations/ScriptedMetricAggregation.js diff --git a/.gitignore b/.gitignore index f8a0a25..629f3bf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ dist/docs node_modules/ +/npm-debug.log diff --git a/dist/elastic.js b/dist/elastic.js index 7aca7ed..dd2cfc7 100644 --- a/dist/elastic.js +++ b/dist/elastic.js @@ -1,6 +1,6 @@ -/*! elastic.js - v1.2.0 - 2014-10-13 +/*! elastic.js - v1.2.0 - 2015-05-21 * https://github.com/fullscale/elastic.js - * Copyright (c) 2014 FullScale Labs, LLC; Licensed MIT */ + * Copyright (c) 2015 FullScale Labs, LLC; Licensed MIT */ /** @namespace @@ -4987,6 +4987,105 @@ }); }; + /** + @class +

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.

+ + @name ejs.MinAggregation + @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 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; + + return extend(_common, { + /** +

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. + */ + init_script_file: 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 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. + */ + map_script_file : 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 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. + */ + combine_script_file: 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 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. + */ + reduce_script_file: 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; + } + }); + }; + /** @class

An aggregation that returns interesting or unusual occurrences of terms in diff --git a/dist/elastic.min.js b/dist/elastic.min.js index e12d3d5..8dfea89 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.2.0 - 2015-05-21 * https://github.com/fullscale/elastic.js - * Copyright (c) 2014 FullScale Labs, LLC; Licensed MIT */ + * Copyright (c) 2015 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=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(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}}},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.ScriptedMetricAggregation=function(a){var b=z.MetricsAggregationMixin(a,"scripted_metric"),d=b.toJSON();return delete b.field,c(b,{init_script_file:function(b){return null==b?d[a].scripted_metric.init_script_file:(d[a].scripted_metric.init_script_file=b,this)},map_script_file:function(b){return null==b?d[a].scripted_metric.map_script_file:(d[a].scripted_metric.map_script_file=b,this)},combine_script_file:function(b){return null==b?d[a].scripted_metric.combine_script_file:(d[a].scripted_metric.combine_script_file=b,this)},reduce_script_file:function(b){return null==b?d[a].scripted_metric.reduce_script_file:(d[a].scripted_metric.reduce_script_file=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(a){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(a){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(a){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 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)}})},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(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)}})},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(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)}})},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(a){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(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)}})},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 diff --git a/src/aggregations/ScriptedMetricAggregation.js b/src/aggregations/ScriptedMetricAggregation.js new file mode 100644 index 0000000..0b52843 --- /dev/null +++ b/src/aggregations/ScriptedMetricAggregation.js @@ -0,0 +1,98 @@ + /** + @class +

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.

+ + @name ejs.MinAggregation + @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 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; + + return extend(_common, { + /** +

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. + */ + init_script_file: 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 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. + */ + map_script_file : 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 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. + */ + combine_script_file: 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 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. + */ + reduce_script_file: 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; + } + }); + }; From d5004e3eb114316b2fcba1acd029681e7e3fe27a Mon Sep 17 00:00:00 2001 From: Thomas Cashman Date: Thu, 21 May 2015 15:26:51 +0100 Subject: [PATCH 24/56] Standardised scripted metric agg function names --- dist/elastic.js | 8 ++++---- dist/elastic.min.js | 2 +- src/aggregations/ScriptedMetricAggregation.js | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dist/elastic.js b/dist/elastic.js index dd2cfc7..98b3acf 100644 --- a/dist/elastic.js +++ b/dist/elastic.js @@ -5027,7 +5027,7 @@ @param {String} init_script_file A valid script file name. @returns {Object} returns this so that calls can be chained. */ - init_script_file: function (init_script_file) { + initScriptFile: function (init_script_file) { if (init_script_file == null) { return agg[name].scripted_metric.init_script_file; } @@ -5043,7 +5043,7 @@ @param {String} map_script_file A valid script file name. @returns {Object} returns this so that calls can be chained. */ - map_script_file : function (map_script_file) { + mapScriptFile : function (map_script_file) { if (map_script_file == null) { return agg[name].scripted_metric.map_script_file; } @@ -5059,7 +5059,7 @@ @param {String} combine_script_file A valid script file name. @returns {Object} returns this so that calls can be chained. */ - combine_script_file: function (combine_script_file) { + combineScriptFile: function (combine_script_file) { if (combine_script_file == null) { return agg[name].scripted_metric.combine_script_file; } @@ -5075,7 +5075,7 @@ @param {String} reduce_script_file A valid script file name. @returns {Object} returns this so that calls can be chained. */ - reduce_script_file: function (reduce_script_file) { + reduceScriptFile: function (reduce_script_file) { if (reduce_script_file == null) { return agg[name].scripted_metric.reduce_script_file; } diff --git a/dist/elastic.min.js b/dist/elastic.min.js index 8dfea89..b32a562 100644 --- a/dist/elastic.min.js +++ b/dist/elastic.min.js @@ -2,7 +2,7 @@ * https://github.com/fullscale/elastic.js * Copyright (c) 2015 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(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}}},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.ScriptedMetricAggregation=function(a){var b=z.MetricsAggregationMixin(a,"scripted_metric"),d=b.toJSON();return delete b.field,c(b,{init_script_file:function(b){return null==b?d[a].scripted_metric.init_script_file:(d[a].scripted_metric.init_script_file=b,this)},map_script_file:function(b){return null==b?d[a].scripted_metric.map_script_file:(d[a].scripted_metric.map_script_file=b,this)},combine_script_file:function(b){return null==b?d[a].scripted_metric.combine_script_file:(d[a].scripted_metric.combine_script_file=b,this)},reduce_script_file:function(b){return null==b?d[a].scripted_metric.reduce_script_file:(d[a].scripted_metric.reduce_script_file=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; +(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(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}}},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.ScriptedMetricAggregation=function(a){var b=z.MetricsAggregationMixin(a,"scripted_metric"),d=b.toJSON();return delete b.field,c(b,{initScriptFile:function(b){return null==b?d[a].scripted_metric.init_script_file:(d[a].scripted_metric.init_script_file=b,this)},mapScriptFile:function(b){return null==b?d[a].scripted_metric.map_script_file:(d[a].scripted_metric.map_script_file=b,this)},combineScriptFile:function(b){return null==b?d[a].scripted_metric.combine_script_file:(d[a].scripted_metric.combine_script_file=b,this)},reduceScriptFile:function(b){return null==b?d[a].scripted_metric.reduce_script_file:(d[a].scripted_metric.reduce_script_file=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(a){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(a){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(a){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 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)}})},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(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)}})},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(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)}})},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(a){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(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)}})},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 diff --git a/src/aggregations/ScriptedMetricAggregation.js b/src/aggregations/ScriptedMetricAggregation.js index 0b52843..0239b47 100644 --- a/src/aggregations/ScriptedMetricAggregation.js +++ b/src/aggregations/ScriptedMetricAggregation.js @@ -38,7 +38,7 @@ @param {String} init_script_file A valid script file name. @returns {Object} returns this so that calls can be chained. */ - init_script_file: function (init_script_file) { + initScriptFile: function (init_script_file) { if (init_script_file == null) { return agg[name].scripted_metric.init_script_file; } @@ -54,7 +54,7 @@ @param {String} map_script_file A valid script file name. @returns {Object} returns this so that calls can be chained. */ - map_script_file : function (map_script_file) { + mapScriptFile : function (map_script_file) { if (map_script_file == null) { return agg[name].scripted_metric.map_script_file; } @@ -70,7 +70,7 @@ @param {String} combine_script_file A valid script file name. @returns {Object} returns this so that calls can be chained. */ - combine_script_file: function (combine_script_file) { + combineScriptFile: function (combine_script_file) { if (combine_script_file == null) { return agg[name].scripted_metric.combine_script_file; } @@ -86,7 +86,7 @@ @param {String} reduce_script_file A valid script file name. @returns {Object} returns this so that calls can be chained. */ - reduce_script_file: function (reduce_script_file) { + reduceScriptFile: function (reduce_script_file) { if (reduce_script_file == null) { return agg[name].scripted_metric.reduce_script_file; } From 3b339684877fa0cec9d5c6ed7963c15648553d91 Mon Sep 17 00:00:00 2001 From: Fredrik Bondza Date: Mon, 29 Jun 2015 10:17:49 +0200 Subject: [PATCH 25/56] Added the possibility to set script id --- src/query/functions/ScriptScoreFunction.js | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/query/functions/ScriptScoreFunction.js b/src/query/functions/ScriptScoreFunction.js index a128cc0..ca6caf9 100644 --- a/src/query/functions/ScriptScoreFunction.js +++ b/src/query/functions/ScriptScoreFunction.js @@ -35,9 +35,35 @@ } 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; + } + /** The script language being used. From aba9502e2c76986dadd15bfd7758821a69ab53ef Mon Sep 17 00:00:00 2001 From: Fredrik Bondza Date: Mon, 29 Jun 2015 10:42:33 +0200 Subject: [PATCH 26/56] Allow to set search_type for requests --- src/search/Request.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/search/Request.js b/src/search/Request.js index e51026f..bebcb8e 100644 --- a/src/search/Request.js +++ b/src/search/Request.js @@ -104,6 +104,30 @@ return this; }, + /** + Allows to set the search type for request. + + @member ejs.Request + @param {String} searchType Search type to set for this query. + @returns {Object} returns this so that calls can be chained. + */ + searchType: function (searchType) { + if (searchType == null) { + return query.search_type; + } + + if (searchType === "query_then_fetch" || + searchType === "dfs_query_then_fetch" || + searchType === "query_and_fetch" || + searchType === "dfs_query_and_fetch" || + searchType === "count" || + searchType === "scan") { + query.search_type = searchType; + } + + return this; + } + /** Enables score computation and tracking during sorting. Be default, when sorting scores are not computed. From 7648d7866ba36c032a9f84edae56ba062fb8b75d Mon Sep 17 00:00:00 2001 From: Fredrik Bondza Date: Mon, 29 Jun 2015 10:43:34 +0200 Subject: [PATCH 27/56] Update package version to 1.2.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 92c8260..e04413c 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.2.1", "homepage": "https://github.com/fullscale/elastic.js", "keywords": [ "elasticsearch", From 6022195f9c948d80b09c8e39a29cdbec947146b5 Mon Sep 17 00:00:00 2001 From: Fredrik Bondza Date: Mon, 29 Jun 2015 10:49:41 +0200 Subject: [PATCH 28/56] Added missing colons --- src/query/functions/ScriptScoreFunction.js | 2 +- src/search/Request.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/query/functions/ScriptScoreFunction.js b/src/query/functions/ScriptScoreFunction.js index ca6caf9..8e33dc0 100644 --- a/src/query/functions/ScriptScoreFunction.js +++ b/src/query/functions/ScriptScoreFunction.js @@ -62,7 +62,7 @@ } return this; - } + }, /** The script language being used. diff --git a/src/search/Request.js b/src/search/Request.js index bebcb8e..7bdb165 100644 --- a/src/search/Request.js +++ b/src/search/Request.js @@ -126,7 +126,7 @@ } return this; - } + }, /** Enables score computation and tracking during sorting. Be default, From d809ea6a2897ad503386e585bcdbdc961844b3d1 Mon Sep 17 00:00:00 2001 From: Fredrik Bondza Date: Mon, 29 Jun 2015 10:49:59 +0200 Subject: [PATCH 29/56] Rebuild dist --- dist/elastic.js | 52 ++++++++++++++++++++++++++++++++++++++++++++- dist/elastic.min.js | 6 +++--- 2 files changed, 54 insertions(+), 4 deletions(-) diff --git a/dist/elastic.js b/dist/elastic.js index a3c8001..c92fd4a 100644 --- a/dist/elastic.js +++ b/dist/elastic.js @@ -1,4 +1,4 @@ -/*! elastic.js - v1.2.0 - 2015-05-11 +/*! elastic.js - v1.2.1 - 2015-06-29 * https://github.com/fullscale/elastic.js * Copyright (c) 2015 FullScale Labs, LLC; Licensed MIT */ @@ -15353,6 +15353,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; }, @@ -16218,6 +16244,30 @@ return this; }, + /** + Allows to set the search type for request. + + @member ejs.Request + @param {String} searchType Search type to set for this query. + @returns {Object} returns this so that calls can be chained. + */ + searchType: function (searchType) { + if (searchType == null) { + return query.search_type; + } + + if (searchType === "query_then_fetch" || + searchType === "dfs_query_then_fetch" || + searchType === "query_and_fetch" || + searchType === "dfs_query_and_fetch" || + searchType === "count" || + searchType === "scan") { + query.search_type = searchType; + } + + return this; + }, + /** Enables score computation and tracking during sorting. Be default, when sorting scores are not computed. diff --git a/dist/elastic.min.js b/dist/elastic.min.js index 5c4127b..dc23d0c 100644 --- a/dist/elastic.min.js +++ b/dist/elastic.min.js @@ -1,8 +1,8 @@ -/*! elastic.js - v1.2.0 - 2015-05-11 +/*! elastic.js - v1.2.1 - 2015-06-29 * https://github.com/fullscale/elastic.js * Copyright (c) 2015 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(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}}},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 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}}},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(a){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(a){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(a){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 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)}})},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)},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(!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(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)}})},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(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)}})},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(a){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(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)}})},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.FieldValueFactorFunction=function(a){var b=z.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)}})},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.ScoreFunction=function(){var a=z.ScoreFunctionMixin();return a},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 +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(a){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(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)}})},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.FieldValueFactorFunction=function(a){var b=z.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)}})},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.ScoreFunction=function(){var a=z.ScoreFunctionMixin();return a},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,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)}})},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},searchType:function(a){return null==a?b.search_type:(("query_then_fetch"===a||"dfs_query_then_fetch"===a||"query_and_fetch"===a||"dfs_query_and_fetch"===a||"count"===a||"scan"===a)&&(b.search_type=a),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 From 9d7a126cf6f0664a971ce3ef962bf14181253c6f Mon Sep 17 00:00:00 2001 From: Fredrik Bondza Date: Mon, 29 Jun 2015 11:00:54 +0200 Subject: [PATCH 30/56] Search type is not a request property --- src/search/Request.js | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/src/search/Request.js b/src/search/Request.js index 7bdb165..e51026f 100644 --- a/src/search/Request.js +++ b/src/search/Request.js @@ -104,30 +104,6 @@ return this; }, - /** - Allows to set the search type for request. - - @member ejs.Request - @param {String} searchType Search type to set for this query. - @returns {Object} returns this so that calls can be chained. - */ - searchType: function (searchType) { - if (searchType == null) { - return query.search_type; - } - - if (searchType === "query_then_fetch" || - searchType === "dfs_query_then_fetch" || - searchType === "query_and_fetch" || - searchType === "dfs_query_and_fetch" || - searchType === "count" || - searchType === "scan") { - query.search_type = searchType; - } - - return this; - }, - /** Enables score computation and tracking during sorting. Be default, when sorting scores are not computed. From 449d9be960b7483433a76baeea2feefc69e13dea Mon Sep 17 00:00:00 2001 From: Fredrik Bondza Date: Mon, 29 Jun 2015 11:01:41 +0200 Subject: [PATCH 31/56] Update package version --- bower.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bower.json b/bower.json index 19dceeb..47ccb4e 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "elastic.js", - "version": "1.2.0", + "version": "1.2.2", "description": "Javascript API for ElasticSearch DSL", "license": "MIT", "keywords": [ diff --git a/package.json b/package.json index e04413c..a45d6fd 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "elastic.js", "description": "Javascript API for ElasticSearch DSL", - "version": "1.2.1", + "version": "1.2.2", "homepage": "https://github.com/fullscale/elastic.js", "keywords": [ "elasticsearch", From f9548311838fecd9b7f8cb89088f2596918ce08f Mon Sep 17 00:00:00 2001 From: Fredrik Bondza Date: Mon, 29 Jun 2015 11:02:57 +0200 Subject: [PATCH 32/56] Update dist --- dist/elastic.js | 24 ------------------------ dist/elastic.min.js | 4 ++-- 2 files changed, 2 insertions(+), 26 deletions(-) diff --git a/dist/elastic.js b/dist/elastic.js index c92fd4a..03ade5c 100644 --- a/dist/elastic.js +++ b/dist/elastic.js @@ -16244,30 +16244,6 @@ return this; }, - /** - Allows to set the search type for request. - - @member ejs.Request - @param {String} searchType Search type to set for this query. - @returns {Object} returns this so that calls can be chained. - */ - searchType: function (searchType) { - if (searchType == null) { - return query.search_type; - } - - if (searchType === "query_then_fetch" || - searchType === "dfs_query_then_fetch" || - searchType === "query_and_fetch" || - searchType === "dfs_query_and_fetch" || - searchType === "count" || - searchType === "scan") { - query.search_type = searchType; - } - - return this; - }, - /** Enables score computation and tracking during sorting. Be default, when sorting scores are not computed. diff --git a/dist/elastic.min.js b/dist/elastic.min.js index dc23d0c..ed953ec 100644 --- a/dist/elastic.min.js +++ b/dist/elastic.min.js @@ -4,5 +4,5 @@ (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(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}}},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 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}}},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(a){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(a){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(a){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 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)}})},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)},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(!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(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)}})},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(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)}})},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(a){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(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)}})},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.FieldValueFactorFunction=function(a){var b=z.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)}})},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.ScoreFunction=function(){var a=z.ScoreFunctionMixin();return a},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,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)}})},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},searchType:function(a){return null==a?b.search_type:(("query_then_fetch"===a||"dfs_query_then_fetch"===a||"query_and_fetch"===a||"dfs_query_and_fetch"===a||"count"===a||"scan"===a)&&(b.search_type=a),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 +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(a){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(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)}})},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.FieldValueFactorFunction=function(a){var b=z.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)}})},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.ScoreFunction=function(){var a=z.ScoreFunctionMixin();return a},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,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)}})},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 From 9aec09169455e8d6a032fd0b20443300340b9db4 Mon Sep 17 00:00:00 2001 From: Fredrik Bondza Date: Mon, 29 Jun 2015 14:55:40 +0200 Subject: [PATCH 33/56] Added scripted metric aggregation --- src/aggregations/ScriptedMetricAggregation.js | 123 ++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 src/aggregations/ScriptedMetricAggregation.js diff --git a/src/aggregations/ScriptedMetricAggregation.js b/src/aggregations/ScriptedMetricAggregation.js new file mode 100644 index 0000000..a9eceed --- /dev/null +++ b/src/aggregations/ScriptedMetricAggregation.js @@ -0,0 +1,123 @@ + /** + @class +

A scripted metric aggregation.

+ + @name ejs.ScriptedMetricAggregation + @ejs aggregation + @borrows ejs.AggregationMixin._type as _type + @borrows ejs.AggregationMixin.toJSON as toJSON + + */ + ejs.ScriptedMetricAggregation = function (name) { + var + _common = ejs.MetricsAggregationMixin(name, 'scripted_metric'), + agg = _common.toJSON(); + + 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; + }, + + /** +

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; + } + }); + }; From 2ac8fb01766653958e8be65ae74a9d3da5442d9c Mon Sep 17 00:00:00 2001 From: Fredrik Bondza Date: Mon, 29 Jun 2015 14:56:13 +0200 Subject: [PATCH 34/56] Update dist --- dist/elastic.js | 126 +++++++++++++++++++++++++++++++++++++++++++- dist/elastic.min.js | 10 ++-- 2 files changed, 130 insertions(+), 6 deletions(-) diff --git a/dist/elastic.js b/dist/elastic.js index 03ade5c..08c7867 100644 --- a/dist/elastic.js +++ b/dist/elastic.js @@ -1,4 +1,4 @@ -/*! elastic.js - v1.2.1 - 2015-06-29 +/*! elastic.js - v1.2.2 - 2015-06-29 * https://github.com/fullscale/elastic.js * Copyright (c) 2015 FullScale Labs, LLC; Licensed MIT */ @@ -5010,6 +5010,130 @@ }); }; + /** + @class +

A scripted metric aggregation.

+ + @name ejs.ScriptedMetricAggregation + @ejs aggregation + @borrows ejs.AggregationMixin._type as _type + @borrows ejs.AggregationMixin.toJSON as toJSON + + */ + ejs.ScriptedMetricAggregation = function (name) { + var + _common = ejs.MetricsAggregationMixin(name, 'scripted_metric'), + agg = _common.toJSON(); + + 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; + }, + + /** +

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; + } + }); + }; + /** @class

An aggregation that returns interesting or unusual occurrences of terms in diff --git a/dist/elastic.min.js b/dist/elastic.min.js index ed953ec..62a5a59 100644 --- a/dist/elastic.min.js +++ b/dist/elastic.min.js @@ -1,8 +1,8 @@ -/*! elastic.js - v1.2.1 - 2015-06-29 +/*! elastic.js - v1.2.2 - 2015-06-29 * https://github.com/fullscale/elastic.js * Copyright (c) 2015 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(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}}},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 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}}},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(a){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(a){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(a){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 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)}})},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)},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(!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(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)}})},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(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)}})},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(a){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(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)}})},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.FieldValueFactorFunction=function(a){var b=z.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)}})},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.ScoreFunction=function(){var a=z.ScoreFunctionMixin();return a},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,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)}})},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=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(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}}},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 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}}},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.ScriptedMetricAggregation=function(a){var b=z.MetricsAggregationMixin(a,"scripted_metric"),d=b.toJSON();return 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)},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)}})},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(a){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(a){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(a){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 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)}})},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)},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(!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(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)}})},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(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)}})},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(a){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(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)}})},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.FieldValueFactorFunction=function(a){var b=z.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)}})},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.ScoreFunction=function(){var a=z.ScoreFunctionMixin();return a},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,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)}})},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 From ed5451488e498ec07e8bee81ab4cbce9c9d2b616 Mon Sep 17 00:00:00 2001 From: Fredrik Bondza Date: Mon, 29 Jun 2015 14:56:22 +0200 Subject: [PATCH 35/56] Update package version --- bower.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bower.json b/bower.json index 47ccb4e..41f97e5 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "elastic.js", - "version": "1.2.2", + "version": "1.2.3", "description": "Javascript API for ElasticSearch DSL", "license": "MIT", "keywords": [ diff --git a/package.json b/package.json index a45d6fd..bf2b603 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "elastic.js", "description": "Javascript API for ElasticSearch DSL", - "version": "1.2.2", + "version": "1.2.3", "homepage": "https://github.com/fullscale/elastic.js", "keywords": [ "elasticsearch", From 62e3dc0b4d5c9bd0505d98c4bb5240e0059e729e Mon Sep 17 00:00:00 2001 From: ErwanPigneul Date: Thu, 16 Jul 2015 05:24:49 +0200 Subject: [PATCH 36/56] build js --- dist/elastic.js | 55 +++++++++++++++++++++++++++++++++++++++++++-- dist/elastic.min.js | 12 +++++----- 2 files changed, 59 insertions(+), 8 deletions(-) diff --git a/dist/elastic.js b/dist/elastic.js index 7aca7ed..4b5489a 100644 --- a/dist/elastic.js +++ b/dist/elastic.js @@ -1,6 +1,6 @@ -/*! elastic.js - v1.2.0 - 2014-10-13 +/*! elastic.js - v1.2.0 - 2015-07-16 * https://github.com/fullscale/elastic.js - * Copyright (c) 2014 FullScale Labs, LLC; Licensed MIT */ + * Copyright (c) 2015 FullScale Labs, LLC; Licensed MIT */ /** @namespace @@ -3785,6 +3785,57 @@ }); }; +/** + @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.scriptValuesSorted; + delete _common.script; + 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.wrapLongitude + @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 diff --git a/dist/elastic.min.js b/dist/elastic.min.js index e12d3d5..c3476b5 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.2.0 - 2015-07-16 * https://github.com/fullscale/elastic.js - * Copyright (c) 2014 FullScale Labs, LLC; Licensed MIT */ + * Copyright (c) 2015 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=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(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}}},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.GeoBoundsAggregation=function(a){var b=z.MetricsAggregationMixin(a,"geo_bounds"),d=b.toJSON();return delete b.scriptValuesSorted,delete b.script,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)}})},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(a){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(a){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(a){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 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)}})},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(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)}})},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(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)}})},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(a){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(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)}})},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 From 28e2d3db55fbeb0181104c8d8b17b40698bfa6bf Mon Sep 17 00:00:00 2001 From: ErwanPigneul Date: Sun, 2 Aug 2015 00:26:25 +0200 Subject: [PATCH 37/56] 1.3.0 : build with new aggregations --- bower.json | 2 +- dist/elastic.js | 2 +- dist/elastic.min.js | 2 +- package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bower.json b/bower.json index 19dceeb..c01fab9 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "elastic.js", - "version": "1.2.0", + "version": "1.3.0", "description": "Javascript API for ElasticSearch DSL", "license": "MIT", "keywords": [ diff --git a/dist/elastic.js b/dist/elastic.js index 4b5489a..b64f7e3 100644 --- a/dist/elastic.js +++ b/dist/elastic.js @@ -1,4 +1,4 @@ -/*! elastic.js - v1.2.0 - 2015-07-16 +/*! elastic.js - v1.2.0 - 2015-08-02 * https://github.com/fullscale/elastic.js * Copyright (c) 2015 FullScale Labs, LLC; Licensed MIT */ diff --git a/dist/elastic.min.js b/dist/elastic.min.js index c3476b5..ad37313 100644 --- a/dist/elastic.min.js +++ b/dist/elastic.min.js @@ -1,4 +1,4 @@ -/*! elastic.js - v1.2.0 - 2015-07-16 +/*! elastic.js - v1.2.0 - 2015-08-02 * https://github.com/fullscale/elastic.js * Copyright (c) 2015 FullScale Labs, LLC; Licensed MIT */ diff --git a/package.json b/package.json index 92c8260..c8eb96e 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.0", "homepage": "https://github.com/fullscale/elastic.js", "keywords": [ "elasticsearch", From 9c17db35265c3abb6e8618cbe27e6b515a891cb6 Mon Sep 17 00:00:00 2001 From: ErwanPigneul Date: Sun, 2 Aug 2015 22:49:31 +0200 Subject: [PATCH 38/56] mfyang pr #1 --- dist/elastic.js | 50 ++++++++++++++++++++++++---------- dist/elastic.min.js | 6 ++-- src/query/MoreLikeThisQuery.js | 28 +++++++++---------- src/search/Request.js | 20 ++++++++++++++ tests/query_test.js | 14 +++------- 5 files changed, 76 insertions(+), 42 deletions(-) diff --git a/dist/elastic.js b/dist/elastic.js index b64f7e3..34e8ca3 100644 --- a/dist/elastic.js +++ b/dist/elastic.js @@ -1,4 +1,4 @@ -/*! elastic.js - v1.2.0 - 2015-08-02 +/*! elastic.js - v1.3.0 - 2015-08-02 * https://github.com/fullscale/elastic.js * Copyright (c) 2015 FullScale Labs, LLC; Licensed MIT */ @@ -12138,23 +12138,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, { /** @@ -12168,20 +12159,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 @@ -16401,6 +16401,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 ad37313..c8b0011 100644 --- a/dist/elastic.min.js +++ b/dist/elastic.min.js @@ -1,8 +1,8 @@ -/*! elastic.js - v1.2.0 - 2015-08-02 +/*! elastic.js - v1.3.0 - 2015-08-02 * https://github.com/fullscale/elastic.js * Copyright (c) 2015 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(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}}},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.GeoBoundsAggregation=function(a){var b=z.MetricsAggregationMixin(a,"geo_bounds"),d=b.toJSON();return delete b.scriptValuesSorted,delete b.script,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)}})},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(a){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(a){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(a){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 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)}})},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(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)}})},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(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)}})},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(a){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(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)}})},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 +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){var b=z.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)}})},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(a){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(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)}})},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},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(!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 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/search/Request.js b/src/search/Request.js index e51026f..5b9a363 100644 --- a/src/search/Request.js +++ b/src/search/Request.js @@ -379,6 +379,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/tests/query_test.js b/tests/query_test.js index 02efc16..20bbcdc 100644 --- a/tests/query_test.js +++ b/tests/query_test.js @@ -1213,9 +1213,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 +1224,6 @@ exports.queries = { expected = { mlt: { like_text: 'like text', - fields: ['f', 'f2'] } }; @@ -1232,16 +1231,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 +1302,6 @@ exports.queries = { test.strictEqual(mltQuery._type(), 'query'); - - test.throws(function () { - ejs.MoreLikeThisQuery(9, 'like'); - }, TypeError); - test.throws(function () { mltQuery.fields(3); }, TypeError); From 369a012704d711eca6ffff8ed2e06ca1c78ab054 Mon Sep 17 00:00:00 2001 From: ErwanPigneul Date: Mon, 3 Aug 2015 22:04:32 +0200 Subject: [PATCH 39/56] 1.3.2 : grab contribs from net --- bower.json | 3 +-- dist/elastic.js | 2 +- dist/elastic.min.js | 2 +- package.json | 3 +-- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/bower.json b/bower.json index 530a07b..840af9f 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,6 @@ { "name": "elastic.js", - "version": "1.3.0", - "version": "1.2.3", + "version": "1.3.2", "description": "Javascript API for ElasticSearch DSL", "license": "MIT", "keywords": [ diff --git a/dist/elastic.js b/dist/elastic.js index 455f256..3e1e853 100644 --- a/dist/elastic.js +++ b/dist/elastic.js @@ -1,4 +1,4 @@ -/*! elastic.js - v1.2.3 - 2015-08-03 +/*! elastic.js - v1.3.2 - 2015-08-03 * https://github.com/fullscale/elastic.js * Copyright (c) 2015 FullScale Labs, LLC; Licensed MIT */ diff --git a/dist/elastic.min.js b/dist/elastic.min.js index bedef13..9d0028e 100644 --- a/dist/elastic.min.js +++ b/dist/elastic.min.js @@ -1,4 +1,4 @@ -/*! elastic.js - v1.2.3 - 2015-08-03 +/*! elastic.js - v1.3.2 - 2015-08-03 * https://github.com/fullscale/elastic.js * Copyright (c) 2015 FullScale Labs, LLC; Licensed MIT */ diff --git a/package.json b/package.json index 4a45604..76bc314 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,7 @@ { "name": "elastic.js", "description": "Javascript API for ElasticSearch DSL", - "version": "1.3.0", - "version": "1.2.3", + "version": "1.3.2", "homepage": "https://github.com/fullscale/elastic.js", "keywords": [ "elasticsearch", From 1247400ba0ab780d4c3e8b31cc71fa96fe183e02 Mon Sep 17 00:00:00 2001 From: ErwanPigneul Date: Mon, 3 Aug 2015 22:06:02 +0200 Subject: [PATCH 40/56] 1.3.2 : grab contribs from net --- bower.json | 2 +- dist/elastic.js | 2 +- dist/elastic.min.js | 2 +- package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bower.json b/bower.json index 840af9f..91e7b84 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "elastic.js", - "version": "1.3.2", + "version": "1.3.3", "description": "Javascript API for ElasticSearch DSL", "license": "MIT", "keywords": [ diff --git a/dist/elastic.js b/dist/elastic.js index 3e1e853..894ebed 100644 --- a/dist/elastic.js +++ b/dist/elastic.js @@ -1,4 +1,4 @@ -/*! elastic.js - v1.3.2 - 2015-08-03 +/*! elastic.js - v1.3.3 - 2015-08-03 * https://github.com/fullscale/elastic.js * Copyright (c) 2015 FullScale Labs, LLC; Licensed MIT */ diff --git a/dist/elastic.min.js b/dist/elastic.min.js index 9d0028e..9cbdfc7 100644 --- a/dist/elastic.min.js +++ b/dist/elastic.min.js @@ -1,4 +1,4 @@ -/*! elastic.js - v1.3.2 - 2015-08-03 +/*! elastic.js - v1.3.3 - 2015-08-03 * https://github.com/fullscale/elastic.js * Copyright (c) 2015 FullScale Labs, LLC; Licensed MIT */ diff --git a/package.json b/package.json index 76bc314..bf9a5bf 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "elastic.js", "description": "Javascript API for ElasticSearch DSL", - "version": "1.3.2", + "version": "1.3.3", "homepage": "https://github.com/fullscale/elastic.js", "keywords": [ "elasticsearch", From 391fe8310464e03f610f64ff3f3ebab785fc0968 Mon Sep 17 00:00:00 2001 From: ErwanPigneul Date: Tue, 4 Aug 2015 01:18:30 +0200 Subject: [PATCH 41/56] add script_id and script_file in aggs. refactor aggs --- dist/elastic.js | 737 ++++-------------- dist/elastic.min.js | 10 +- src/aggregations/DateHistogramAggregation.js | 86 +- src/aggregations/DateRangeAggregation.js | 88 +-- src/aggregations/GeoBoundsAggregation.js | 2 + src/aggregations/HistogramAggregation.js | 86 +- src/aggregations/IPv4RangeAggregation.js | 86 +- src/aggregations/RangeAggregation.js | 86 +- src/aggregations/ScriptedMetricAggregation.js | 6 +- src/aggregations/TermsAggregation.js | 106 +-- src/aggregations/ValueCountAggregation.js | 25 +- src/mixins/BucketsAggregationMixin.js | 123 +++ src/mixins/MetricsAggregationMixin.js | 40 +- tests/aggregation_test.js | 253 +++--- 14 files changed, 500 insertions(+), 1234 deletions(-) create mode 100644 src/mixins/BucketsAggregationMixin.js diff --git a/dist/elastic.js b/dist/elastic.js index 894ebed..ba20e77 100644 --- a/dist/elastic.js +++ b/dist/elastic.js @@ -1,4 +1,4 @@ -/*! elastic.js - v1.3.3 - 2015-08-03 +/*! elastic.js - v1.3.3 - 2015-08-04 * https://github.com/fullscale/elastic.js * Copyright (c) 2015 FullScale Labs, LLC; Licensed MIT */ @@ -312,6 +312,130 @@ }; }; + /** + @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._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.MetricsAggregationMixin + @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.MetricsAggregationMixin + @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.MetricsAggregationMixin + @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.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; + }, + + /** + 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].lang = language; + return this; + }, + + /** + Sets parameters that will be applied to the script. Overwrites + any existing params. + + @member ejs.MetricsAggregationMixin + @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 +944,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; }, @@ -3222,61 +3362,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. @@ -3437,22 +3527,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. @@ -3485,24 +3559,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. @@ -3561,61 +3617,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. @@ -3682,42 +3688,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; } - + }); }; @@ -3833,6 +3805,8 @@ // not supported in geo bounds aggregation delete _common.scriptValuesSorted; delete _common.script; + delete _common.scriptId; + delete _common.scriptFile; delete _common.lang; delete _common.params; @@ -4228,61 +4202,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 @@ -4379,40 +4303,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. @@ -4466,61 +4356,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. @@ -4575,40 +4415,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; } }); @@ -4917,61 +4723,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. @@ -5024,40 +4780,6 @@ 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; - } - }); }; @@ -5086,7 +4808,11 @@ agg = _common.toJSON(); delete _common.field; - + delete _common.script; + delete _common.scriptId; + delete _common.scriptFile; + delete _common.scriptValuesSorted; + return extend(_common, { /** @@ -5610,83 +5336,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 @@ -5785,22 +5441,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. @@ -5851,24 +5491,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. @@ -6138,7 +5760,7 @@ @ejs aggregation @borrows ejs.MetricsAggregationMixin.field as field @borrows ejs.MetricsAggregationMixin.script as script - @borrows ejs.MetricsAggregationMixin.lang as lang + @borrows ejs.MetricsAggregationMixin.lang asr lang @borrows ejs.MetricsAggregationMixin.params as params @borrows ejs.AggregationMixin._type as _type @borrows ejs.AggregationMixin.toJSON as toJSON @@ -6156,28 +5778,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; }; diff --git a/dist/elastic.min.js b/dist/elastic.min.js index 9cbdfc7..c60a317 100644 --- a/dist/elastic.min.js +++ b/dist/elastic.min.js @@ -1,8 +1,8 @@ -/*! elastic.js - v1.3.3 - 2015-08-03 +/*! elastic.js - v1.3.3 - 2015-08-04 * https://github.com/fullscale/elastic.js * Copyright (c) 2015 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(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}}},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 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}}},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.GeoBoundsAggregation=function(a){var b=z.MetricsAggregationMixin(a,"geo_bounds"),d=b.toJSON();return delete b.scriptValuesSorted,delete b.script,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)}})},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.ScriptedMetricAggregation=function(a){var b=z.MetricsAggregationMixin(a,"scripted_metric"),d=b.toJSON();return delete b.field,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)}})},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},null!=c&&(d[a].top_hits._source.excludes=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(a){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(a){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(a){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 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)}})},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)},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(!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(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)}})},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(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)}})},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){var b=z.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)}})},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(),("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)}})},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(a){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(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)}})},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.FieldValueFactorFunction=function(a){var b=z.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)}})},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.ScoreFunction=function(){var a=z.ScoreFunctionMixin();return a},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,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)}})},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},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(!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=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.BucketsAggregationMixin=function(a,b){var d=z.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)}})},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(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}}},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)},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)}})},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 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}}},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.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)}})},z.DateRangeAggregation=function(a){var b=z.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)}})},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.GeoBoundsAggregation=function(a){var b=z.MetricsAggregationMixin(a,"geo_bounds"),d=b.toJSON();return delete b.scriptValuesSorted,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)}})},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.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)}})},z.IPv4RangeAggregation=function(a){var b=z.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)}})},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.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)}})},z.ScriptedMetricAggregation=function(a){var b=z.MetricsAggregationMixin(a,"scripted_metric"),d=b.toJSON();return delete b.field,delete b.script,delete b.scriptId,delete b.scriptFile,delete b.scriptValuesSorted,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)}})},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.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){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},null!=c&&(d[a].top_hits._source.excludes=c)),this}})},z.ValueCountAggregation=function(a){var b=z.MetricsAggregationMixin(a,"value_count");b.toJSON();return b},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(a){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(a){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(a){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 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)}})},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)},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(!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(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)}})},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(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)}})},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){var b=z.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)}})},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(),("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)}})},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(a){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(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)}})},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.FieldValueFactorFunction=function(a){var b=z.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)}})},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.ScoreFunction=function(){var a=z.ScoreFunctionMixin();return a},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,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)}})},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},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(!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 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..6f0936c 100644 --- a/src/aggregations/DateRangeAggregation.js +++ b/src/aggregations/DateRangeAggregation.js @@ -26,61 +26,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 +97,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/GeoBoundsAggregation.js b/src/aggregations/GeoBoundsAggregation.js index d33c7cd..fc40e3a 100644 --- a/src/aggregations/GeoBoundsAggregation.js +++ b/src/aggregations/GeoBoundsAggregation.js @@ -23,6 +23,8 @@ // not supported in geo bounds aggregation delete _common.scriptValuesSorted; delete _common.script; + delete _common.scriptId; + delete _common.scriptFile; delete _common.lang; delete _common.params; diff --git a/src/aggregations/HistogramAggregation.js b/src/aggregations/HistogramAggregation.js index f77b2d8..03398fb 100644 --- a/src/aggregations/HistogramAggregation.js +++ b/src/aggregations/HistogramAggregation.js @@ -21,61 +21,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 +122,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..f8f334a 100644 --- a/src/aggregations/IPv4RangeAggregation.js +++ b/src/aggregations/IPv4RangeAggregation.js @@ -21,61 +21,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 +80,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/RangeAggregation.js b/src/aggregations/RangeAggregation.js index 249ce82..fcaa4f2 100644 --- a/src/aggregations/RangeAggregation.js +++ b/src/aggregations/RangeAggregation.js @@ -25,61 +25,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 +82,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 index 6ffab8d..3a68cbb 100644 --- a/src/aggregations/ScriptedMetricAggregation.js +++ b/src/aggregations/ScriptedMetricAggregation.js @@ -23,7 +23,11 @@ agg = _common.toJSON(); delete _common.field; - + delete _common.script; + delete _common.scriptId; + delete _common.scriptFile; + delete _common.scriptValuesSorted; + return extend(_common, { /** diff --git a/src/aggregations/TermsAggregation.js b/src/aggregations/TermsAggregation.js index 5446eac..76ea03a 100644 --- a/src/aggregations/TermsAggregation.js +++ b/src/aggregations/TermsAggregation.js @@ -19,83 +19,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 +124,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 +174,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. diff --git a/src/aggregations/ValueCountAggregation.js b/src/aggregations/ValueCountAggregation.js index 903c58e..bcca310 100644 --- a/src/aggregations/ValueCountAggregation.js +++ b/src/aggregations/ValueCountAggregation.js @@ -10,7 +10,7 @@ @ejs aggregation @borrows ejs.MetricsAggregationMixin.field as field @borrows ejs.MetricsAggregationMixin.script as script - @borrows ejs.MetricsAggregationMixin.lang as lang + @borrows ejs.MetricsAggregationMixin.lang asr lang @borrows ejs.MetricsAggregationMixin.params as params @borrows ejs.AggregationMixin._type as _type @borrows ejs.AggregationMixin.toJSON as toJSON @@ -28,27 +28,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/mixins/BucketsAggregationMixin.js b/src/mixins/BucketsAggregationMixin.js new file mode 100644 index 0000000..15ec2e2 --- /dev/null +++ b/src/mixins/BucketsAggregationMixin.js @@ -0,0 +1,123 @@ + /** + @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._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.MetricsAggregationMixin + @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.MetricsAggregationMixin + @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.MetricsAggregationMixin + @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.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; + }, + + /** + 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].lang = language; + return this; + }, + + /** + Sets parameters that will be applied to the script. Overwrites + any existing params. + + @member ejs.MetricsAggregationMixin + @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/tests/aggregation_test.js b/tests/aggregation_test.js index 6eebd04..31df6c6 100644 --- a/tests/aggregation_test.js +++ b/tests/aggregation_test.js @@ -60,7 +60,7 @@ exports.aggregations = { test.done(); }, ExtendedStatsAggregation: function (test) { - test.expect(9); + test.expect(10); var agg = ejs.ExtendedStatsAggregation('myagg'), ta1 = ejs.TermsAggregation('ta1').field('f1'), @@ -85,12 +85,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'}); @@ -102,7 +106,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'), @@ -123,16 +127,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.scriptValuesUnique(false); - expected.myagg.value_count.script_values_unique = false; + agg.scriptFile('file1'); + expected.myagg.value_count.script_file = 'file1'; + doTest(); + + agg.lang('mvel'); + expected.myagg.value_count.lang = 'mvel'; doTest(); agg.params({p1: 'v1'}); @@ -144,7 +153,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'), @@ -169,12 +178,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.scriptValuesSorted(false); - expected.myagg.sum.script_values_sorted = false; + agg.scriptFile('file1'); + expected.myagg.sum.script_file = 'file1'; + doTest(); + + agg.lang('mvel'); + expected.myagg.sum.lang = 'mvel'; doTest(); agg.params({p1: 'v1'}); @@ -186,7 +199,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'), @@ -211,12 +224,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'}); @@ -228,7 +245,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'), @@ -253,12 +270,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.scriptValuesSorted(false); - expected.myagg.percentiles.script_values_sorted = false; + agg.scriptFile('file1'); + expected.myagg.percentiles.script_file = 'file1'; + doTest(); + + agg.lang('mvel'); + expected.myagg.percentiles.lang = 'mvel'; doTest(); agg.params({p1: 'v1'}); @@ -294,7 +315,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'), @@ -319,12 +340,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.scriptFile('file1'); + expected.myagg.min.script_file = 'file1'; doTest(); - agg.scriptValuesSorted(false); - expected.myagg.min.script_values_sorted = false; + agg.lang('mvel'); + expected.myagg.min.lang = 'mvel'; doTest(); agg.params({p1: 'v1'}); @@ -336,7 +361,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'), @@ -361,12 +386,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'}); @@ -378,7 +407,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'), @@ -403,6 +432,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(); @@ -424,7 +461,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'), @@ -449,12 +486,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.scriptValuesSorted(false); - expected.myagg.avg.script_values_sorted = false; + agg.scriptFile('file1'); + expected.myagg.avg.script_file = 'file1'; + doTest(); + + agg.lang('mvel'); + expected.myagg.avg.lang = 'mvel'; doTest(); agg.params({p1: 'v1'}); @@ -670,7 +711,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'), @@ -695,6 +736,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(); @@ -719,10 +768,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(); @@ -740,7 +785,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'), @@ -765,6 +810,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(); @@ -793,10 +846,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(); @@ -814,7 +863,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'), @@ -839,6 +888,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(); @@ -863,10 +920,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(); @@ -952,7 +1005,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'), @@ -977,6 +1030,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(); @@ -1029,10 +1090,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(); @@ -1062,7 +1119,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'), @@ -1087,6 +1144,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(); @@ -1119,10 +1184,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(); @@ -1194,7 +1255,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'), @@ -1219,40 +1280,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'; @@ -1285,10 +1354,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(); From c17e1a3f8e62f27aac96780fdbda60d825331fe0 Mon Sep 17 00:00:00 2001 From: ErwanPigneul Date: Thu, 6 Aug 2015 00:35:26 +0200 Subject: [PATCH 42/56] add doc in git. remove a criteria scriptValuesSorted. and some other changes... --- .gitignore | 1 - dist/docs/ejs.AggregationMixin.html | 504 + dist/docs/ejs.AndFilter.html | 705 + dist/docs/ejs.AvgAggregation.html | 869 + dist/docs/ejs.BoolFilter.html | 868 + dist/docs/ejs.BoolQuery.html | 950 + dist/docs/ejs.BoostFactorScoreFunction.html | 544 + dist/docs/ejs.BoostingQuery.html | 742 + dist/docs/ejs.BucketsAggregationMixin.html | 987 + dist/docs/ejs.CardinalityAggregation.html | 1039 + dist/docs/ejs.CommonTermsQuery.html | 1302 ++ dist/docs/ejs.CompletionSuggester.html | 1285 ++ dist/docs/ejs.ConstantScoreQuery.html | 775 + dist/docs/ejs.DateHistogramAggregation.html | 1561 ++ dist/docs/ejs.DateHistogramFacet.html | 2179 ++ dist/docs/ejs.DateRangeAggregation.html | 1315 ++ dist/docs/ejs.DecayScoreFunction.html | 1065 + dist/docs/ejs.DirectGenerator.html | 1468 ++ dist/docs/ejs.DirectSettingsMixin.html | 1060 + dist/docs/ejs.DisMaxQuery.html | 627 + dist/docs/ejs.ExistsFilter.html | 701 + dist/docs/ejs.ExtendedStatsAggregation.html | 873 + dist/docs/ejs.FacetMixin.html | 829 + dist/docs/ejs.FieldMaskingSpanQuery.html | 641 + dist/docs/ejs.FieldValueFactorFunction.html | 625 + dist/docs/ejs.FilterAggregation.html | 634 + dist/docs/ejs.FilterFacet.html | 974 + dist/docs/ejs.FilterMixin.html | 572 + dist/docs/ejs.FilteredQuery.html | 910 + dist/docs/ejs.FiltersAggregation.html | 651 + dist/docs/ejs.FunctionScoreQuery.html | 1174 + dist/docs/ejs.FuzzyLikeThisFieldQuery.html | 1143 + dist/docs/ejs.FuzzyLikeThisQuery.html | 1129 + dist/docs/ejs.FuzzyQuery.html | 1098 + dist/docs/ejs.GeoBboxFilter.html | 1033 + dist/docs/ejs.GeoBoundsAggregation.html | 542 + dist/docs/ejs.GeoDistanceAggregation.html | 1239 ++ dist/docs/ejs.GeoDistanceFacet.html | 1893 ++ dist/docs/ejs.GeoDistanceFilter.html | 1205 + dist/docs/ejs.GeoDistanceRangeFilter.html | 1771 ++ dist/docs/ejs.GeoHashGridAggregation.html | 880 + dist/docs/ejs.GeoPoint.html | 753 + dist/docs/ejs.GeoPolygonFilter.html | 877 + dist/docs/ejs.GeoShapeFilter.html | 1045 + dist/docs/ejs.GeoShapeQuery.html | 887 + dist/docs/ejs.GlobalAggregation.html | 554 + dist/docs/ejs.HasChildFilter.html | 1044 + dist/docs/ejs.HasChildQuery.html | 987 + dist/docs/ejs.HasParentFilter.html | 964 + dist/docs/ejs.HasParentQuery.html | 899 + dist/docs/ejs.Highlight.html | 1873 ++ dist/docs/ejs.HistogramAggregation.html | 1558 ++ dist/docs/ejs.HistogramFacet.html | 1889 ++ dist/docs/ejs.IPv4RangeAggregation.html | 1230 ++ dist/docs/ejs.IdsFilter.html | 792 + dist/docs/ejs.IdsQuery.html | 634 + dist/docs/ejs.IndexedShape.html | 725 + dist/docs/ejs.IndicesFilter.html | 889 + dist/docs/ejs.IndicesQuery.html | 729 + dist/docs/ejs.LimitFilter.html | 700 + dist/docs/ejs.MatchAllFilter.html | 604 + dist/docs/ejs.MatchAllQuery.html | 446 + dist/docs/ejs.MatchQuery.html | 1790 ++ dist/docs/ejs.MaxAggregation.html | 869 + dist/docs/ejs.MetricsAggregationMixin.html | 817 + dist/docs/ejs.MinAggregation.html | 869 + dist/docs/ejs.MissingAggregation.html | 634 + dist/docs/ejs.MissingFilter.html | 860 + dist/docs/ejs.MoreLikeThisFieldQuery.html | 1548 ++ dist/docs/ejs.MoreLikeThisQuery.html | 1552 ++ dist/docs/ejs.MultiMatchQuery.html | 1968 ++ dist/docs/ejs.NestedAggregation.html | 634 + dist/docs/ejs.NestedFilter.html | 1115 + dist/docs/ejs.NestedQuery.html | 875 + dist/docs/ejs.NotFilter.html | 701 + dist/docs/ejs.NumericRangeFilter.html | 1362 ++ dist/docs/ejs.OrFilter.html | 704 + dist/docs/ejs.PercentilesAggregation.html | 1203 + dist/docs/ejs.PhraseSuggester.html | 1837 ++ dist/docs/ejs.PrefixFilter.html | 797 + dist/docs/ejs.PrefixQuery.html | 766 + dist/docs/ejs.QueryFacet.html | 974 + dist/docs/ejs.QueryFilter.html | 708 + dist/docs/ejs.QueryMixin.html | 414 + dist/docs/ejs.QueryStringQuery.html | 2453 +++ dist/docs/ejs.RandomScoreFunction.html | 526 + dist/docs/ejs.RangeAggregation.html | 1234 ++ dist/docs/ejs.RangeFacet.html | 1718 ++ dist/docs/ejs.RangeFilter.html | 1350 ++ dist/docs/ejs.RangeQuery.html | 1195 + dist/docs/ejs.RegexpFilter.html | 983 + dist/docs/ejs.RegexpQuery.html | 953 + dist/docs/ejs.Request.html | 2215 ++ dist/docs/ejs.Rescore.html | 809 + dist/docs/ejs.ScoreFunction.html | 526 + dist/docs/ejs.ScoreFunctionMixin.html | 494 + dist/docs/ejs.ScriptField.html | 710 + dist/docs/ejs.ScriptFilter.html | 863 + dist/docs/ejs.ScriptScoreFunction.html | 770 + dist/docs/ejs.ScriptedMetricAggregation.html | 1746 ++ dist/docs/ejs.Shape.html | 646 + .../docs/ejs.SignificantTermsAggregation.html | 1250 ++ dist/docs/ejs.Sort.html | 1920 ++ dist/docs/ejs.SpanFirstQuery.html | 639 + dist/docs/ejs.SpanMultiTermQuery.html | 544 + dist/docs/ejs.SpanNearQuery.html | 804 + dist/docs/ejs.SpanNotQuery.html | 638 + dist/docs/ejs.SpanOrQuery.html | 547 + dist/docs/ejs.SpanTermQuery.html | 639 + dist/docs/ejs.StatisticalFacet.html | 1298 ++ dist/docs/ejs.StatsAggregation.html | 871 + dist/docs/ejs.SuggestContextMixin.html | 528 + dist/docs/ejs.SuggesterMixin.html | 416 + dist/docs/ejs.SumAggregation.html | 869 + dist/docs/ejs.TermFilter.html | 788 + dist/docs/ejs.TermQuery.html | 641 + dist/docs/ejs.TermStatsFacet.html | 1654 ++ dist/docs/ejs.TermSuggester.html | 1565 ++ dist/docs/ejs.TermsAggregation.html | 1747 ++ dist/docs/ejs.TermsFacet.html | 2053 ++ dist/docs/ejs.TermsFilter.html | 1393 ++ dist/docs/ejs.TermsQuery.html | 807 + dist/docs/ejs.TopChildrenQuery.html | 1061 + dist/docs/ejs.TopHitsAggregation.html | 1381 ++ dist/docs/ejs.TypeFilter.html | 700 + dist/docs/ejs.ValueCountAggregation.html | 870 + dist/docs/ejs.WildcardQuery.html | 772 + dist/docs/ejs.html | 807 + dist/docs/ejs.html#.AggregationMixin | 132 + dist/docs/ejs.html#.AndFilter | 223 + dist/docs/ejs.html#.BoolFilter | 174 + dist/docs/ejs.html#.BoolQuery | 173 + dist/docs/ejs.html#.BoostFactorScoreFunction | 221 + dist/docs/ejs.html#.BoostingQuery | 269 + dist/docs/ejs.html#.CardinalityAggregation | 221 + dist/docs/ejs.html#.CommonTermsQuery | 253 + dist/docs/ejs.html#.CompletionSuggester | 218 + dist/docs/ejs.html#.ConstantScoreQuery | 180 + dist/docs/ejs.html#.DateHistogramAggregation | 228 + dist/docs/ejs.html#.DateHistogramFacet | 238 + dist/docs/ejs.html#.DateRangeAggregation | 227 + dist/docs/ejs.html#.DecayScoreFunction | 225 + dist/docs/ejs.html#.DirectGenerator | 175 + dist/docs/ejs.html#.DirectSettingsMixin | 132 + dist/docs/ejs.html#.DisMaxQuery | 174 + dist/docs/ejs.html#.ExistsFilter | 220 + dist/docs/ejs.html#.FacetMixin | 132 + dist/docs/ejs.html#.FieldMaskingSpanQuery | 246 + dist/docs/ejs.html#.FieldValueFactorFunction | 222 + dist/docs/ejs.html#.FilterAggregation | 221 + dist/docs/ejs.html#.FilterFacet | 236 + dist/docs/ejs.html#.FilterMixin | 132 + dist/docs/ejs.html#.FilteredQuery | 247 + dist/docs/ejs.html#.FunctionScoreQuery | 173 + dist/docs/ejs.html#.FuzzyLikeThisFieldQuery | 262 + dist/docs/ejs.html#.FuzzyLikeThisQuery | 236 + dist/docs/ejs.html#.FuzzyQuery | 249 + dist/docs/ejs.html#.GeoBboxFilter | 220 + dist/docs/ejs.html#.GeoDistanceAggregation | 226 + dist/docs/ejs.html#.GeoDistanceFacet | 237 + dist/docs/ejs.html#.GeoDistanceFilter | 220 + dist/docs/ejs.html#.GeoDistanceRangeFilter | 220 + dist/docs/ejs.html#.GeoHashGridAggregation | 223 + dist/docs/ejs.html#.GeoPoint | 222 + dist/docs/ejs.html#.GeoPolygonFilter | 220 + dist/docs/ejs.html#.GeoShapeFilter | 177 + dist/docs/ejs.html#.GeoShapeQuery | 177 + dist/docs/ejs.html#.HasChildFilter | 243 + dist/docs/ejs.html#.HasChildQuery | 244 + dist/docs/ejs.html#.HasParentFilter | 243 + dist/docs/ejs.html#.HasParentQuery | 244 + dist/docs/ejs.html#.Highlight | 234 + dist/docs/ejs.html#.HistogramAggregation | 222 + dist/docs/ejs.html#.HistogramFacet | 238 + dist/docs/ejs.html#.IPv4RangeAggregation | 222 + dist/docs/ejs.html#.IdsFilter | 224 + dist/docs/ejs.html#.IdsQuery | 224 + dist/docs/ejs.html#.IndexedShape | 246 + dist/docs/ejs.html#.IndicesFilter | 249 + dist/docs/ejs.html#.IndicesQuery | 249 + dist/docs/ejs.html#.LimitFilter | 219 + dist/docs/ejs.html#.MatchQuery | 245 + dist/docs/ejs.html#.MetricsAggregationMixin | 132 + dist/docs/ejs.html#.MissingAggregation | 221 + dist/docs/ejs.html#.MissingFilter | 219 + dist/docs/ejs.html#.MoreLikeThisFieldQuery | 243 + dist/docs/ejs.html#.MoreLikeThisQuery | 246 + dist/docs/ejs.html#.MultiMatchQuery | 250 + dist/docs/ejs.html#.NestedAggregation | 221 + dist/docs/ejs.html#.NestedFilter | 227 + dist/docs/ejs.html#.NestedQuery | 226 + dist/docs/ejs.html#.NotFilter | 220 + dist/docs/ejs.html#.NumericRangeFilter | 230 + dist/docs/ejs.html#.OrFilter | 222 + dist/docs/ejs.html#.PercentilesAggregation | 223 + dist/docs/ejs.html#.PhraseSuggester | 226 + dist/docs/ejs.html#.PrefixFilter | 243 + dist/docs/ejs.html#.PrefixQuery | 243 + dist/docs/ejs.html#.QueryFacet | 236 + dist/docs/ejs.html#.QueryFilter | 227 + dist/docs/ejs.html#.QueryMixin | 132 + dist/docs/ejs.html#.QueryStringQuery | 224 + dist/docs/ejs.html#.RandomScoreFunction | 171 + dist/docs/ejs.html#.RangeAggregation | 226 + dist/docs/ejs.html#.RangeFacet | 236 + dist/docs/ejs.html#.RangeFilter | 219 + dist/docs/ejs.html#.RangeQuery | 222 + dist/docs/ejs.html#.RegexpFilter | 244 + dist/docs/ejs.html#.RegexpQuery | 244 + dist/docs/ejs.html#.Request | 223 + dist/docs/ejs.html#.Rescore | 242 + dist/docs/ejs.html#.ScoreFunctionMixin | 132 + dist/docs/ejs.html#.ScriptField | 223 + dist/docs/ejs.html#.ScriptFilter | 219 + dist/docs/ejs.html#.ScriptScoreFunction | 172 + dist/docs/ejs.html#.ScriptedMetricAggregation | 220 + dist/docs/ejs.html#.Shape | 245 + .../ejs.html#.SignificantTermsAggregation | 221 + dist/docs/ejs.html#.Sort | 223 + dist/docs/ejs.html#.SpanFirstQuery | 244 + dist/docs/ejs.html#.SpanMultiTermQuery | 221 + dist/docs/ejs.html#.SpanNearQuery | 246 + dist/docs/ejs.html#.SpanNotQuery | 243 + dist/docs/ejs.html#.SpanOrQuery | 220 + dist/docs/ejs.html#.SpanTermQuery | 244 + dist/docs/ejs.html#.StatisticalFacet | 236 + dist/docs/ejs.html#.SuggestContextMixin | 132 + dist/docs/ejs.html#.SuggesterMixin | 132 + dist/docs/ejs.html#.TermFilter | 244 + dist/docs/ejs.html#.TermQuery | 246 + dist/docs/ejs.html#.TermStatsFacet | 236 + dist/docs/ejs.html#.TermsAggregation | 220 + dist/docs/ejs.html#.TermsFacet | 233 + dist/docs/ejs.html#.TermsFilter | 246 + dist/docs/ejs.html#.TermsQuery | 247 + dist/docs/ejs.html#.TopChildrenQuery | 248 + dist/docs/ejs.html#.TopHitsAggregation | 222 + dist/docs/ejs.html#.TypeFilter | 219 + dist/docs/ejs.html#.WildcardQuery | 249 + dist/docs/elastic.js.html | 18220 ++++++++++++++++ dist/docs/fonts/OpenSans-Bold-webfont.eot | Bin 0 -> 19544 bytes dist/docs/fonts/OpenSans-Bold-webfont.svg | 1830 ++ dist/docs/fonts/OpenSans-Bold-webfont.woff | Bin 0 -> 22432 bytes .../fonts/OpenSans-BoldItalic-webfont.eot | Bin 0 -> 20133 bytes .../fonts/OpenSans-BoldItalic-webfont.svg | 1830 ++ .../fonts/OpenSans-BoldItalic-webfont.woff | Bin 0 -> 23048 bytes dist/docs/fonts/OpenSans-Italic-webfont.eot | Bin 0 -> 20265 bytes dist/docs/fonts/OpenSans-Italic-webfont.svg | 1830 ++ dist/docs/fonts/OpenSans-Italic-webfont.woff | Bin 0 -> 23188 bytes dist/docs/fonts/OpenSans-Light-webfont.eot | Bin 0 -> 19514 bytes dist/docs/fonts/OpenSans-Light-webfont.svg | 1831 ++ dist/docs/fonts/OpenSans-Light-webfont.woff | Bin 0 -> 22248 bytes .../fonts/OpenSans-LightItalic-webfont.eot | Bin 0 -> 20535 bytes .../fonts/OpenSans-LightItalic-webfont.svg | 1835 ++ .../fonts/OpenSans-LightItalic-webfont.woff | Bin 0 -> 23400 bytes dist/docs/fonts/OpenSans-Regular-webfont.eot | Bin 0 -> 19836 bytes dist/docs/fonts/OpenSans-Regular-webfont.svg | 1831 ++ dist/docs/fonts/OpenSans-Regular-webfont.woff | Bin 0 -> 22660 bytes dist/docs/img/glyphicons-halflings-white.png | Bin 0 -> 8777 bytes dist/docs/img/glyphicons-halflings.png | Bin 0 -> 12799 bytes dist/docs/index.html | 65 + dist/docs/scripts/lang-apollo.js | 2 + dist/docs/scripts/lang-clj.js | 18 + dist/docs/scripts/lang-css.js | 2 + dist/docs/scripts/lang-go.js | 1 + dist/docs/scripts/lang-hs.js | 2 + dist/docs/scripts/lang-lisp.js | 3 + dist/docs/scripts/lang-lua.js | 2 + dist/docs/scripts/lang-ml.js | 2 + dist/docs/scripts/lang-n.js | 4 + dist/docs/scripts/lang-proto.js | 1 + dist/docs/scripts/lang-scala.js | 2 + dist/docs/scripts/lang-sql.js | 2 + dist/docs/scripts/lang-tex.js | 1 + dist/docs/scripts/lang-vb.js | 2 + dist/docs/scripts/lang-vhdl.js | 3 + dist/docs/scripts/lang-wiki.js | 2 + dist/docs/scripts/lang-xq.js | 3 + dist/docs/scripts/lang-yaml.js | 2 + dist/docs/scripts/linenumber.js | 25 + dist/docs/scripts/prettify.js | 28 + .../scripts/prettify/Apache-License-2.0.txt | 202 + dist/docs/scripts/prettify/lang-css.js | 2 + dist/docs/scripts/prettify/prettify.js | 28 + dist/docs/styles/bootstrap.min.css | 9 + dist/docs/styles/jsdoc-default.css | 353 + dist/docs/styles/prettify-jsdoc.css | 111 + dist/docs/styles/prettify-tomorrow.css | 132 + dist/docs/styles/prettify.css | 1 + dist/docs/styles/style.css | 16 + dist/elastic.js | 146 +- dist/elastic.min.js | 10 +- src/aggregations/AvgAggregation.js | 3 +- src/aggregations/CardinalityAggregation.js | 5 +- src/aggregations/DateRangeAggregation.js | 6 + src/aggregations/ExtendedStatsAggregation.js | 3 +- src/aggregations/FiltersAggregation.js | 59 + src/aggregations/GeoBoundsAggregation.js | 3 +- src/aggregations/HistogramAggregation.js | 6 + src/aggregations/IPv4RangeAggregation.js | 6 + src/aggregations/MaxAggregation.js | 3 +- src/aggregations/MinAggregation.js | 3 +- src/aggregations/PercentilesAggregation.js | 3 +- src/aggregations/RangeAggregation.js | 6 + src/aggregations/ScriptedMetricAggregation.js | 1 - src/aggregations/StatsAggregation.js | 3 +- src/aggregations/SumAggregation.js | 3 +- src/aggregations/TermsAggregation.js | 6 + src/aggregations/TopHitsAggregation.js | 6 +- src/aggregations/ValueCountAggregation.js | 4 +- src/mixins/BucketsAggregationMixin.js | 14 +- 311 files changed, 184661 insertions(+), 51 deletions(-) create mode 100644 dist/docs/ejs.AggregationMixin.html create mode 100644 dist/docs/ejs.AndFilter.html create mode 100644 dist/docs/ejs.AvgAggregation.html create mode 100644 dist/docs/ejs.BoolFilter.html create mode 100644 dist/docs/ejs.BoolQuery.html create mode 100644 dist/docs/ejs.BoostFactorScoreFunction.html create mode 100644 dist/docs/ejs.BoostingQuery.html create mode 100644 dist/docs/ejs.BucketsAggregationMixin.html create mode 100644 dist/docs/ejs.CardinalityAggregation.html create mode 100644 dist/docs/ejs.CommonTermsQuery.html create mode 100644 dist/docs/ejs.CompletionSuggester.html create mode 100644 dist/docs/ejs.ConstantScoreQuery.html create mode 100644 dist/docs/ejs.DateHistogramAggregation.html create mode 100644 dist/docs/ejs.DateHistogramFacet.html create mode 100644 dist/docs/ejs.DateRangeAggregation.html create mode 100644 dist/docs/ejs.DecayScoreFunction.html create mode 100644 dist/docs/ejs.DirectGenerator.html create mode 100644 dist/docs/ejs.DirectSettingsMixin.html create mode 100644 dist/docs/ejs.DisMaxQuery.html create mode 100644 dist/docs/ejs.ExistsFilter.html create mode 100644 dist/docs/ejs.ExtendedStatsAggregation.html create mode 100644 dist/docs/ejs.FacetMixin.html create mode 100644 dist/docs/ejs.FieldMaskingSpanQuery.html create mode 100644 dist/docs/ejs.FieldValueFactorFunction.html create mode 100644 dist/docs/ejs.FilterAggregation.html create mode 100644 dist/docs/ejs.FilterFacet.html create mode 100644 dist/docs/ejs.FilterMixin.html create mode 100644 dist/docs/ejs.FilteredQuery.html create mode 100644 dist/docs/ejs.FiltersAggregation.html create mode 100644 dist/docs/ejs.FunctionScoreQuery.html create mode 100644 dist/docs/ejs.FuzzyLikeThisFieldQuery.html create mode 100644 dist/docs/ejs.FuzzyLikeThisQuery.html create mode 100644 dist/docs/ejs.FuzzyQuery.html create mode 100644 dist/docs/ejs.GeoBboxFilter.html create mode 100644 dist/docs/ejs.GeoBoundsAggregation.html create mode 100644 dist/docs/ejs.GeoDistanceAggregation.html create mode 100644 dist/docs/ejs.GeoDistanceFacet.html create mode 100644 dist/docs/ejs.GeoDistanceFilter.html create mode 100644 dist/docs/ejs.GeoDistanceRangeFilter.html create mode 100644 dist/docs/ejs.GeoHashGridAggregation.html create mode 100644 dist/docs/ejs.GeoPoint.html create mode 100644 dist/docs/ejs.GeoPolygonFilter.html create mode 100644 dist/docs/ejs.GeoShapeFilter.html create mode 100644 dist/docs/ejs.GeoShapeQuery.html create mode 100644 dist/docs/ejs.GlobalAggregation.html create mode 100644 dist/docs/ejs.HasChildFilter.html create mode 100644 dist/docs/ejs.HasChildQuery.html create mode 100644 dist/docs/ejs.HasParentFilter.html create mode 100644 dist/docs/ejs.HasParentQuery.html create mode 100644 dist/docs/ejs.Highlight.html create mode 100644 dist/docs/ejs.HistogramAggregation.html create mode 100644 dist/docs/ejs.HistogramFacet.html create mode 100644 dist/docs/ejs.IPv4RangeAggregation.html create mode 100644 dist/docs/ejs.IdsFilter.html create mode 100644 dist/docs/ejs.IdsQuery.html create mode 100644 dist/docs/ejs.IndexedShape.html create mode 100644 dist/docs/ejs.IndicesFilter.html create mode 100644 dist/docs/ejs.IndicesQuery.html create mode 100644 dist/docs/ejs.LimitFilter.html create mode 100644 dist/docs/ejs.MatchAllFilter.html create mode 100644 dist/docs/ejs.MatchAllQuery.html create mode 100644 dist/docs/ejs.MatchQuery.html create mode 100644 dist/docs/ejs.MaxAggregation.html create mode 100644 dist/docs/ejs.MetricsAggregationMixin.html create mode 100644 dist/docs/ejs.MinAggregation.html create mode 100644 dist/docs/ejs.MissingAggregation.html create mode 100644 dist/docs/ejs.MissingFilter.html create mode 100644 dist/docs/ejs.MoreLikeThisFieldQuery.html create mode 100644 dist/docs/ejs.MoreLikeThisQuery.html create mode 100644 dist/docs/ejs.MultiMatchQuery.html create mode 100644 dist/docs/ejs.NestedAggregation.html create mode 100644 dist/docs/ejs.NestedFilter.html create mode 100644 dist/docs/ejs.NestedQuery.html create mode 100644 dist/docs/ejs.NotFilter.html create mode 100644 dist/docs/ejs.NumericRangeFilter.html create mode 100644 dist/docs/ejs.OrFilter.html create mode 100644 dist/docs/ejs.PercentilesAggregation.html create mode 100644 dist/docs/ejs.PhraseSuggester.html create mode 100644 dist/docs/ejs.PrefixFilter.html create mode 100644 dist/docs/ejs.PrefixQuery.html create mode 100644 dist/docs/ejs.QueryFacet.html create mode 100644 dist/docs/ejs.QueryFilter.html create mode 100644 dist/docs/ejs.QueryMixin.html create mode 100644 dist/docs/ejs.QueryStringQuery.html create mode 100644 dist/docs/ejs.RandomScoreFunction.html create mode 100644 dist/docs/ejs.RangeAggregation.html create mode 100644 dist/docs/ejs.RangeFacet.html create mode 100644 dist/docs/ejs.RangeFilter.html create mode 100644 dist/docs/ejs.RangeQuery.html create mode 100644 dist/docs/ejs.RegexpFilter.html create mode 100644 dist/docs/ejs.RegexpQuery.html create mode 100644 dist/docs/ejs.Request.html create mode 100644 dist/docs/ejs.Rescore.html create mode 100644 dist/docs/ejs.ScoreFunction.html create mode 100644 dist/docs/ejs.ScoreFunctionMixin.html create mode 100644 dist/docs/ejs.ScriptField.html create mode 100644 dist/docs/ejs.ScriptFilter.html create mode 100644 dist/docs/ejs.ScriptScoreFunction.html create mode 100644 dist/docs/ejs.ScriptedMetricAggregation.html create mode 100644 dist/docs/ejs.Shape.html create mode 100644 dist/docs/ejs.SignificantTermsAggregation.html create mode 100644 dist/docs/ejs.Sort.html create mode 100644 dist/docs/ejs.SpanFirstQuery.html create mode 100644 dist/docs/ejs.SpanMultiTermQuery.html create mode 100644 dist/docs/ejs.SpanNearQuery.html create mode 100644 dist/docs/ejs.SpanNotQuery.html create mode 100644 dist/docs/ejs.SpanOrQuery.html create mode 100644 dist/docs/ejs.SpanTermQuery.html create mode 100644 dist/docs/ejs.StatisticalFacet.html create mode 100644 dist/docs/ejs.StatsAggregation.html create mode 100644 dist/docs/ejs.SuggestContextMixin.html create mode 100644 dist/docs/ejs.SuggesterMixin.html create mode 100644 dist/docs/ejs.SumAggregation.html create mode 100644 dist/docs/ejs.TermFilter.html create mode 100644 dist/docs/ejs.TermQuery.html create mode 100644 dist/docs/ejs.TermStatsFacet.html create mode 100644 dist/docs/ejs.TermSuggester.html create mode 100644 dist/docs/ejs.TermsAggregation.html create mode 100644 dist/docs/ejs.TermsFacet.html create mode 100644 dist/docs/ejs.TermsFilter.html create mode 100644 dist/docs/ejs.TermsQuery.html create mode 100644 dist/docs/ejs.TopChildrenQuery.html create mode 100644 dist/docs/ejs.TopHitsAggregation.html create mode 100644 dist/docs/ejs.TypeFilter.html create mode 100644 dist/docs/ejs.ValueCountAggregation.html create mode 100644 dist/docs/ejs.WildcardQuery.html create mode 100644 dist/docs/ejs.html create mode 100644 dist/docs/ejs.html#.AggregationMixin create mode 100644 dist/docs/ejs.html#.AndFilter create mode 100644 dist/docs/ejs.html#.BoolFilter create mode 100644 dist/docs/ejs.html#.BoolQuery create mode 100644 dist/docs/ejs.html#.BoostFactorScoreFunction create mode 100644 dist/docs/ejs.html#.BoostingQuery create mode 100644 dist/docs/ejs.html#.CardinalityAggregation create mode 100644 dist/docs/ejs.html#.CommonTermsQuery create mode 100644 dist/docs/ejs.html#.CompletionSuggester create mode 100644 dist/docs/ejs.html#.ConstantScoreQuery create mode 100644 dist/docs/ejs.html#.DateHistogramAggregation create mode 100644 dist/docs/ejs.html#.DateHistogramFacet create mode 100644 dist/docs/ejs.html#.DateRangeAggregation create mode 100644 dist/docs/ejs.html#.DecayScoreFunction create mode 100644 dist/docs/ejs.html#.DirectGenerator create mode 100644 dist/docs/ejs.html#.DirectSettingsMixin create mode 100644 dist/docs/ejs.html#.DisMaxQuery create mode 100644 dist/docs/ejs.html#.ExistsFilter create mode 100644 dist/docs/ejs.html#.FacetMixin create mode 100644 dist/docs/ejs.html#.FieldMaskingSpanQuery create mode 100644 dist/docs/ejs.html#.FieldValueFactorFunction create mode 100644 dist/docs/ejs.html#.FilterAggregation create mode 100644 dist/docs/ejs.html#.FilterFacet create mode 100644 dist/docs/ejs.html#.FilterMixin create mode 100644 dist/docs/ejs.html#.FilteredQuery create mode 100644 dist/docs/ejs.html#.FunctionScoreQuery create mode 100644 dist/docs/ejs.html#.FuzzyLikeThisFieldQuery create mode 100644 dist/docs/ejs.html#.FuzzyLikeThisQuery create mode 100644 dist/docs/ejs.html#.FuzzyQuery create mode 100644 dist/docs/ejs.html#.GeoBboxFilter create mode 100644 dist/docs/ejs.html#.GeoDistanceAggregation create mode 100644 dist/docs/ejs.html#.GeoDistanceFacet create mode 100644 dist/docs/ejs.html#.GeoDistanceFilter create mode 100644 dist/docs/ejs.html#.GeoDistanceRangeFilter create mode 100644 dist/docs/ejs.html#.GeoHashGridAggregation create mode 100644 dist/docs/ejs.html#.GeoPoint create mode 100644 dist/docs/ejs.html#.GeoPolygonFilter create mode 100644 dist/docs/ejs.html#.GeoShapeFilter create mode 100644 dist/docs/ejs.html#.GeoShapeQuery create mode 100644 dist/docs/ejs.html#.HasChildFilter create mode 100644 dist/docs/ejs.html#.HasChildQuery create mode 100644 dist/docs/ejs.html#.HasParentFilter create mode 100644 dist/docs/ejs.html#.HasParentQuery create mode 100644 dist/docs/ejs.html#.Highlight create mode 100644 dist/docs/ejs.html#.HistogramAggregation create mode 100644 dist/docs/ejs.html#.HistogramFacet create mode 100644 dist/docs/ejs.html#.IPv4RangeAggregation create mode 100644 dist/docs/ejs.html#.IdsFilter create mode 100644 dist/docs/ejs.html#.IdsQuery create mode 100644 dist/docs/ejs.html#.IndexedShape create mode 100644 dist/docs/ejs.html#.IndicesFilter create mode 100644 dist/docs/ejs.html#.IndicesQuery create mode 100644 dist/docs/ejs.html#.LimitFilter create mode 100644 dist/docs/ejs.html#.MatchQuery create mode 100644 dist/docs/ejs.html#.MetricsAggregationMixin create mode 100644 dist/docs/ejs.html#.MissingAggregation create mode 100644 dist/docs/ejs.html#.MissingFilter create mode 100644 dist/docs/ejs.html#.MoreLikeThisFieldQuery create mode 100644 dist/docs/ejs.html#.MoreLikeThisQuery create mode 100644 dist/docs/ejs.html#.MultiMatchQuery create mode 100644 dist/docs/ejs.html#.NestedAggregation create mode 100644 dist/docs/ejs.html#.NestedFilter create mode 100644 dist/docs/ejs.html#.NestedQuery create mode 100644 dist/docs/ejs.html#.NotFilter create mode 100644 dist/docs/ejs.html#.NumericRangeFilter create mode 100644 dist/docs/ejs.html#.OrFilter create mode 100644 dist/docs/ejs.html#.PercentilesAggregation create mode 100644 dist/docs/ejs.html#.PhraseSuggester create mode 100644 dist/docs/ejs.html#.PrefixFilter create mode 100644 dist/docs/ejs.html#.PrefixQuery create mode 100644 dist/docs/ejs.html#.QueryFacet create mode 100644 dist/docs/ejs.html#.QueryFilter create mode 100644 dist/docs/ejs.html#.QueryMixin create mode 100644 dist/docs/ejs.html#.QueryStringQuery create mode 100644 dist/docs/ejs.html#.RandomScoreFunction create mode 100644 dist/docs/ejs.html#.RangeAggregation create mode 100644 dist/docs/ejs.html#.RangeFacet create mode 100644 dist/docs/ejs.html#.RangeFilter create mode 100644 dist/docs/ejs.html#.RangeQuery create mode 100644 dist/docs/ejs.html#.RegexpFilter create mode 100644 dist/docs/ejs.html#.RegexpQuery create mode 100644 dist/docs/ejs.html#.Request create mode 100644 dist/docs/ejs.html#.Rescore create mode 100644 dist/docs/ejs.html#.ScoreFunctionMixin create mode 100644 dist/docs/ejs.html#.ScriptField create mode 100644 dist/docs/ejs.html#.ScriptFilter create mode 100644 dist/docs/ejs.html#.ScriptScoreFunction create mode 100644 dist/docs/ejs.html#.ScriptedMetricAggregation create mode 100644 dist/docs/ejs.html#.Shape create mode 100644 dist/docs/ejs.html#.SignificantTermsAggregation create mode 100644 dist/docs/ejs.html#.Sort create mode 100644 dist/docs/ejs.html#.SpanFirstQuery create mode 100644 dist/docs/ejs.html#.SpanMultiTermQuery create mode 100644 dist/docs/ejs.html#.SpanNearQuery create mode 100644 dist/docs/ejs.html#.SpanNotQuery create mode 100644 dist/docs/ejs.html#.SpanOrQuery create mode 100644 dist/docs/ejs.html#.SpanTermQuery create mode 100644 dist/docs/ejs.html#.StatisticalFacet create mode 100644 dist/docs/ejs.html#.SuggestContextMixin create mode 100644 dist/docs/ejs.html#.SuggesterMixin create mode 100644 dist/docs/ejs.html#.TermFilter create mode 100644 dist/docs/ejs.html#.TermQuery create mode 100644 dist/docs/ejs.html#.TermStatsFacet create mode 100644 dist/docs/ejs.html#.TermsAggregation create mode 100644 dist/docs/ejs.html#.TermsFacet create mode 100644 dist/docs/ejs.html#.TermsFilter create mode 100644 dist/docs/ejs.html#.TermsQuery create mode 100644 dist/docs/ejs.html#.TopChildrenQuery create mode 100644 dist/docs/ejs.html#.TopHitsAggregation create mode 100644 dist/docs/ejs.html#.TypeFilter create mode 100644 dist/docs/ejs.html#.WildcardQuery create mode 100644 dist/docs/elastic.js.html create mode 100644 dist/docs/fonts/OpenSans-Bold-webfont.eot create mode 100644 dist/docs/fonts/OpenSans-Bold-webfont.svg create mode 100644 dist/docs/fonts/OpenSans-Bold-webfont.woff create mode 100644 dist/docs/fonts/OpenSans-BoldItalic-webfont.eot create mode 100644 dist/docs/fonts/OpenSans-BoldItalic-webfont.svg create mode 100644 dist/docs/fonts/OpenSans-BoldItalic-webfont.woff create mode 100644 dist/docs/fonts/OpenSans-Italic-webfont.eot create mode 100644 dist/docs/fonts/OpenSans-Italic-webfont.svg create mode 100644 dist/docs/fonts/OpenSans-Italic-webfont.woff create mode 100644 dist/docs/fonts/OpenSans-Light-webfont.eot create mode 100644 dist/docs/fonts/OpenSans-Light-webfont.svg create mode 100644 dist/docs/fonts/OpenSans-Light-webfont.woff create mode 100644 dist/docs/fonts/OpenSans-LightItalic-webfont.eot create mode 100644 dist/docs/fonts/OpenSans-LightItalic-webfont.svg create mode 100644 dist/docs/fonts/OpenSans-LightItalic-webfont.woff create mode 100644 dist/docs/fonts/OpenSans-Regular-webfont.eot create mode 100644 dist/docs/fonts/OpenSans-Regular-webfont.svg create mode 100644 dist/docs/fonts/OpenSans-Regular-webfont.woff create mode 100644 dist/docs/img/glyphicons-halflings-white.png create mode 100644 dist/docs/img/glyphicons-halflings.png create mode 100644 dist/docs/index.html create mode 100644 dist/docs/scripts/lang-apollo.js create mode 100644 dist/docs/scripts/lang-clj.js create mode 100644 dist/docs/scripts/lang-css.js create mode 100644 dist/docs/scripts/lang-go.js create mode 100644 dist/docs/scripts/lang-hs.js create mode 100644 dist/docs/scripts/lang-lisp.js create mode 100644 dist/docs/scripts/lang-lua.js create mode 100644 dist/docs/scripts/lang-ml.js create mode 100644 dist/docs/scripts/lang-n.js create mode 100644 dist/docs/scripts/lang-proto.js create mode 100644 dist/docs/scripts/lang-scala.js create mode 100644 dist/docs/scripts/lang-sql.js create mode 100644 dist/docs/scripts/lang-tex.js create mode 100644 dist/docs/scripts/lang-vb.js create mode 100644 dist/docs/scripts/lang-vhdl.js create mode 100644 dist/docs/scripts/lang-wiki.js create mode 100644 dist/docs/scripts/lang-xq.js create mode 100644 dist/docs/scripts/lang-yaml.js create mode 100644 dist/docs/scripts/linenumber.js create mode 100644 dist/docs/scripts/prettify.js create mode 100644 dist/docs/scripts/prettify/Apache-License-2.0.txt create mode 100644 dist/docs/scripts/prettify/lang-css.js create mode 100644 dist/docs/scripts/prettify/prettify.js create mode 100644 dist/docs/styles/bootstrap.min.css create mode 100644 dist/docs/styles/jsdoc-default.css create mode 100644 dist/docs/styles/prettify-jsdoc.css create mode 100644 dist/docs/styles/prettify-tomorrow.css create mode 100644 dist/docs/styles/prettify.css create mode 100644 dist/docs/styles/style.css create mode 100644 src/aggregations/FiltersAggregation.js diff --git a/.gitignore b/.gitignore index 0c30b2f..40b878d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ -dist/docs node_modules/ \ No newline at end of file diff --git a/dist/docs/ejs.AggregationMixin.html b/dist/docs/ejs.AggregationMixin.html new file mode 100644 index 0000000..028ad13 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:11 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.AndFilter.html b/dist/docs/ejs.AndFilter.html new file mode 100644 index 0000000..248e521 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:12 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.AvgAggregation.html b/dist/docs/ejs.AvgAggregation.html new file mode 100644 index 0000000..0840626 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:12 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.BoolFilter.html b/dist/docs/ejs.BoolFilter.html new file mode 100644 index 0000000..062ae5c --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:12 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.BoolQuery.html b/dist/docs/ejs.BoolQuery.html new file mode 100644 index 0000000..ebb04a5 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:13 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.BoostFactorScoreFunction.html b/dist/docs/ejs.BoostFactorScoreFunction.html new file mode 100644 index 0000000..4a553eb --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:13 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.BoostingQuery.html b/dist/docs/ejs.BoostingQuery.html new file mode 100644 index 0000000..9347850 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:14 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.BucketsAggregationMixin.html b/dist/docs/ejs.BucketsAggregationMixin.html new file mode 100644 index 0000000..43479fb --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:14 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.CardinalityAggregation.html b/dist/docs/ejs.CardinalityAggregation.html new file mode 100644 index 0000000..ef86c03 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:15 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.CommonTermsQuery.html b/dist/docs/ejs.CommonTermsQuery.html new file mode 100644 index 0000000..9d55523 --- /dev/null +++ b/dist/docs/ejs.CommonTermsQuery.html @@ -0,0 +1,1302 @@ + + + + + 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
ObjectminimumShouldMatch(min)Sets the minimum number of low freq matches that need to match in + a document before that document is returned in the results.
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. + + + +
+ + + +
+ +
+
+
+ +

 minimumShouldMatch

+
+ + Object minimumShouldMatch ( 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. + + + +
+ + + +
+ +
+
+
+ +

 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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:15 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.CompletionSuggester.html b/dist/docs/ejs.CompletionSuggester.html new file mode 100644 index 0000000..bc33541 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:16 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.ConstantScoreQuery.html b/dist/docs/ejs.ConstantScoreQuery.html new file mode 100644 index 0000000..0b1ffe0 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:16 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.DateHistogramAggregation.html b/dist/docs/ejs.DateHistogramAggregation.html new file mode 100644 index 0000000..d8e7657 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:17 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.DateHistogramFacet.html b/dist/docs/ejs.DateHistogramFacet.html new file mode 100644 index 0000000..f4a9c16 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:18 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.DateRangeAggregation.html b/dist/docs/ejs.DateRangeAggregation.html new file mode 100644 index 0000000..13c3c31 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:19 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.DecayScoreFunction.html b/dist/docs/ejs.DecayScoreFunction.html new file mode 100644 index 0000000..2486bc3 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:20 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.DirectGenerator.html b/dist/docs/ejs.DirectGenerator.html new file mode 100644 index 0000000..a058491 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:20 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.DirectSettingsMixin.html b/dist/docs/ejs.DirectSettingsMixin.html new file mode 100644 index 0000000..c7ae40f --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:21 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.DisMaxQuery.html b/dist/docs/ejs.DisMaxQuery.html new file mode 100644 index 0000000..cdf95af --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:21 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.ExistsFilter.html b/dist/docs/ejs.ExistsFilter.html new file mode 100644 index 0000000..0cb0ffe --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:22 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.ExtendedStatsAggregation.html b/dist/docs/ejs.ExtendedStatsAggregation.html new file mode 100644 index 0000000..182a399 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:22 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.FacetMixin.html b/dist/docs/ejs.FacetMixin.html new file mode 100644 index 0000000..c2b8383 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:22 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.FieldMaskingSpanQuery.html b/dist/docs/ejs.FieldMaskingSpanQuery.html new file mode 100644 index 0000000..fe7d7c2 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:23 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.FieldValueFactorFunction.html b/dist/docs/ejs.FieldValueFactorFunction.html new file mode 100644 index 0000000..52e2f4e --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:23 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.FilterAggregation.html b/dist/docs/ejs.FilterAggregation.html new file mode 100644 index 0000000..04e0a42 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:23 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.FilterFacet.html b/dist/docs/ejs.FilterFacet.html new file mode 100644 index 0000000..349231e --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:24 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.FilterMixin.html b/dist/docs/ejs.FilterMixin.html new file mode 100644 index 0000000..27ecee2 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:25 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.FilteredQuery.html b/dist/docs/ejs.FilteredQuery.html new file mode 100644 index 0000000..5259c1e --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:24 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.FiltersAggregation.html b/dist/docs/ejs.FiltersAggregation.html new file mode 100644 index 0000000..48679c9 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:25 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.FunctionScoreQuery.html b/dist/docs/ejs.FunctionScoreQuery.html new file mode 100644 index 0000000..303ae9c --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:25 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.FuzzyLikeThisFieldQuery.html b/dist/docs/ejs.FuzzyLikeThisFieldQuery.html new file mode 100644 index 0000000..c8d270e --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:26 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.FuzzyLikeThisQuery.html b/dist/docs/ejs.FuzzyLikeThisQuery.html new file mode 100644 index 0000000..ffca1cf --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:27 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.FuzzyQuery.html b/dist/docs/ejs.FuzzyQuery.html new file mode 100644 index 0000000..945d3fb --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:27 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.GeoBboxFilter.html b/dist/docs/ejs.GeoBboxFilter.html new file mode 100644 index 0000000..5043a73 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:28 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.GeoBoundsAggregation.html b/dist/docs/ejs.GeoBoundsAggregation.html new file mode 100644 index 0000000..0c85f8e --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:28 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.GeoDistanceAggregation.html b/dist/docs/ejs.GeoDistanceAggregation.html new file mode 100644 index 0000000..14c5c91 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:28 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.GeoDistanceFacet.html b/dist/docs/ejs.GeoDistanceFacet.html new file mode 100644 index 0000000..3a7049f --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:29 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.GeoDistanceFilter.html b/dist/docs/ejs.GeoDistanceFilter.html new file mode 100644 index 0000000..38cf221 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:30 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.GeoDistanceRangeFilter.html b/dist/docs/ejs.GeoDistanceRangeFilter.html new file mode 100644 index 0000000..8dbb249 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:31 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.GeoHashGridAggregation.html b/dist/docs/ejs.GeoHashGridAggregation.html new file mode 100644 index 0000000..82d1be8 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:32 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.GeoPoint.html b/dist/docs/ejs.GeoPoint.html new file mode 100644 index 0000000..9d85363 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:32 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.GeoPolygonFilter.html b/dist/docs/ejs.GeoPolygonFilter.html new file mode 100644 index 0000000..cee9aff --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:32 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.GeoShapeFilter.html b/dist/docs/ejs.GeoShapeFilter.html new file mode 100644 index 0000000..a757a35 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:33 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.GeoShapeQuery.html b/dist/docs/ejs.GeoShapeQuery.html new file mode 100644 index 0000000..bca054a --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:33 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.GlobalAggregation.html b/dist/docs/ejs.GlobalAggregation.html new file mode 100644 index 0000000..2005ce1 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:34 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.HasChildFilter.html b/dist/docs/ejs.HasChildFilter.html new file mode 100644 index 0000000..294d595 --- /dev/null +++ b/dist/docs/ejs.HasChildFilter.html @@ -0,0 +1,1044 @@ + + + + + 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
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. + + + +
+ + + +
+ +
+
+
+ +

 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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:34 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.HasChildQuery.html b/dist/docs/ejs.HasChildQuery.html new file mode 100644 index 0000000..ef939c2 --- /dev/null +++ b/dist/docs/ejs.HasChildQuery.html @@ -0,0 +1,987 @@ + + + + + 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.
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. + + + +
+ + + +
+ +
+
+
+ +

 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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:35 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.HasParentFilter.html b/dist/docs/ejs.HasParentFilter.html new file mode 100644 index 0000000..12f0669 --- /dev/null +++ b/dist/docs/ejs.HasParentFilter.html @@ -0,0 +1,964 @@ + + + + + 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
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. + + + +
+ + + +
+ +
+
+
+ +

 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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:35 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.HasParentQuery.html b/dist/docs/ejs.HasParentQuery.html new file mode 100644 index 0000000..d32ddf1 --- /dev/null +++ b/dist/docs/ejs.HasParentQuery.html @@ -0,0 +1,899 @@ + + + + + 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.
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. + + + +
+ + + +
+ +
+
+
+ +

 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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:36 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.Highlight.html b/dist/docs/ejs.Highlight.html new file mode 100644 index 0000000..6d46714 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:36 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.HistogramAggregation.html b/dist/docs/ejs.HistogramAggregation.html new file mode 100644 index 0000000..e2573c7 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:37 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.HistogramFacet.html b/dist/docs/ejs.HistogramFacet.html new file mode 100644 index 0000000..cd4d1cd --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:38 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.IPv4RangeAggregation.html b/dist/docs/ejs.IPv4RangeAggregation.html new file mode 100644 index 0000000..eb35d15 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:41 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.IdsFilter.html b/dist/docs/ejs.IdsFilter.html new file mode 100644 index 0000000..27c2871 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:39 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.IdsQuery.html b/dist/docs/ejs.IdsQuery.html new file mode 100644 index 0000000..45b8e98 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:39 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.IndexedShape.html b/dist/docs/ejs.IndexedShape.html new file mode 100644 index 0000000..26e6959 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:39 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.IndicesFilter.html b/dist/docs/ejs.IndicesFilter.html new file mode 100644 index 0000000..967e8c5 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:40 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.IndicesQuery.html b/dist/docs/ejs.IndicesQuery.html new file mode 100644 index 0000000..a76502b --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:40 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.LimitFilter.html b/dist/docs/ejs.LimitFilter.html new file mode 100644 index 0000000..e420f23 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:41 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.MatchAllFilter.html b/dist/docs/ejs.MatchAllFilter.html new file mode 100644 index 0000000..725f154 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:42 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.MatchAllQuery.html b/dist/docs/ejs.MatchAllQuery.html new file mode 100644 index 0000000..4cccdca --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:42 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.MatchQuery.html b/dist/docs/ejs.MatchQuery.html new file mode 100644 index 0000000..8b99deb --- /dev/null +++ b/dist/docs/ejs.MatchQuery.html @@ -0,0 +1,1790 @@ + + + + + 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 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 percent value controlling how many "should" clauses in the + resulting Query should match.

+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
Parameters
+ + + + minMatch + + + <Integer> + + + + + + An integer between 0 and 100. +
+ + +
+ + + + + + +
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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:42 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.MaxAggregation.html b/dist/docs/ejs.MaxAggregation.html new file mode 100644 index 0000000..bb50407 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:43 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.MetricsAggregationMixin.html b/dist/docs/ejs.MetricsAggregationMixin.html new file mode 100644 index 0000000..4401932 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:43 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.MinAggregation.html b/dist/docs/ejs.MinAggregation.html new file mode 100644 index 0000000..52bff68 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:44 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.MissingAggregation.html b/dist/docs/ejs.MissingAggregation.html new file mode 100644 index 0000000..97a5252 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:44 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.MissingFilter.html b/dist/docs/ejs.MissingFilter.html new file mode 100644 index 0000000..73b48d5 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:45 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.MoreLikeThisFieldQuery.html b/dist/docs/ejs.MoreLikeThisFieldQuery.html new file mode 100644 index 0000000..dbe8851 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:45 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.MoreLikeThisQuery.html b/dist/docs/ejs.MoreLikeThisQuery.html new file mode 100644 index 0000000..84cc55a --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:46 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.MultiMatchQuery.html b/dist/docs/ejs.MultiMatchQuery.html new file mode 100644 index 0000000..ef76713 --- /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 + + + <Integer> + + + + + + An integer between 0 and 100. +
+ + +
+ + + + + + +
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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:47 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.NestedAggregation.html b/dist/docs/ejs.NestedAggregation.html new file mode 100644 index 0000000..d7db59b --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:48 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.NestedFilter.html b/dist/docs/ejs.NestedFilter.html new file mode 100644 index 0000000..2e1bcfa --- /dev/null +++ b/dist/docs/ejs.NestedFilter.html @@ -0,0 +1,1115 @@ + + + + + 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.
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. + + + +
+ + + +
+ +
+
+
+ +

 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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:48 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.NestedQuery.html b/dist/docs/ejs.NestedQuery.html new file mode 100644 index 0000000..615e4fb --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:49 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.NotFilter.html b/dist/docs/ejs.NotFilter.html new file mode 100644 index 0000000..b06ea18 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:49 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.NumericRangeFilter.html b/dist/docs/ejs.NumericRangeFilter.html new file mode 100644 index 0000000..5a4013b --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:49 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.OrFilter.html b/dist/docs/ejs.OrFilter.html new file mode 100644 index 0000000..3b7e02b --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:50 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.PercentilesAggregation.html b/dist/docs/ejs.PercentilesAggregation.html new file mode 100644 index 0000000..3a37d5f --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:51 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.PhraseSuggester.html b/dist/docs/ejs.PhraseSuggester.html new file mode 100644 index 0000000..54e8c22 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:51 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.PrefixFilter.html b/dist/docs/ejs.PrefixFilter.html new file mode 100644 index 0000000..f015fab --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:52 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.PrefixQuery.html b/dist/docs/ejs.PrefixQuery.html new file mode 100644 index 0000000..08ffe5d --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:52 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.QueryFacet.html b/dist/docs/ejs.QueryFacet.html new file mode 100644 index 0000000..6e49846 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:53 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.QueryFilter.html b/dist/docs/ejs.QueryFilter.html new file mode 100644 index 0000000..cc8691b --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:53 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.QueryMixin.html b/dist/docs/ejs.QueryMixin.html new file mode 100644 index 0000000..6be94fb --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:54 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.QueryStringQuery.html b/dist/docs/ejs.QueryStringQuery.html new file mode 100644 index 0000000..66d82b6 --- /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 + + + <Integer> + + + + + + An integer between 0 and 100. +
+ + +
+ + + + + + +
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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:54 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.RandomScoreFunction.html b/dist/docs/ejs.RandomScoreFunction.html new file mode 100644 index 0000000..db2365a --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:55 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.RangeAggregation.html b/dist/docs/ejs.RangeAggregation.html new file mode 100644 index 0000000..a1bb80b --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:55 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.RangeFacet.html b/dist/docs/ejs.RangeFacet.html new file mode 100644 index 0000000..80d5220 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:56 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.RangeFilter.html b/dist/docs/ejs.RangeFilter.html new file mode 100644 index 0000000..d4d285c --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:57 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.RangeQuery.html b/dist/docs/ejs.RangeQuery.html new file mode 100644 index 0000000..d44a6d7 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:58 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.RegexpFilter.html b/dist/docs/ejs.RegexpFilter.html new file mode 100644 index 0000000..fa2a1a2 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:58 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.RegexpQuery.html b/dist/docs/ejs.RegexpQuery.html new file mode 100644 index 0000000..c14708d --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:59 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.Request.html b/dist/docs/ejs.Request.html new file mode 100644 index 0000000..1b5002f --- /dev/null +++ b/dist/docs/ejs.Request.html @@ -0,0 +1,2215 @@ + + + + + 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.
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. + + + +
+ + + +
+ +
+
+
+ +

 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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:59 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.Rescore.html b/dist/docs/ejs.Rescore.html new file mode 100644 index 0000000..a8fa55f --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:32:00 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.ScoreFunction.html b/dist/docs/ejs.ScoreFunction.html new file mode 100644 index 0000000..b55f981 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:32:01 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.ScoreFunctionMixin.html b/dist/docs/ejs.ScoreFunctionMixin.html new file mode 100644 index 0000000..3ad62dc --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:32:01 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.ScriptField.html b/dist/docs/ejs.ScriptField.html new file mode 100644 index 0000000..82494e5 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:32:02 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.ScriptFilter.html b/dist/docs/ejs.ScriptFilter.html new file mode 100644 index 0000000..58026a4 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:32:02 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.ScriptScoreFunction.html b/dist/docs/ejs.ScriptScoreFunction.html new file mode 100644 index 0000000..125663c --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:32:03 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.ScriptedMetricAggregation.html b/dist/docs/ejs.ScriptedMetricAggregation.html new file mode 100644 index 0000000..b0281dc --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:32:01 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.Shape.html b/dist/docs/ejs.Shape.html new file mode 100644 index 0000000..88cd71c --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:32:03 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.SignificantTermsAggregation.html b/dist/docs/ejs.SignificantTermsAggregation.html new file mode 100644 index 0000000..76dc9e7 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:32:04 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.Sort.html b/dist/docs/ejs.Sort.html new file mode 100644 index 0000000..def2a0d --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:32:04 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.SpanFirstQuery.html b/dist/docs/ejs.SpanFirstQuery.html new file mode 100644 index 0000000..0579391 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:32:05 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.SpanMultiTermQuery.html b/dist/docs/ejs.SpanMultiTermQuery.html new file mode 100644 index 0000000..c35ceb3 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:32:06 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.SpanNearQuery.html b/dist/docs/ejs.SpanNearQuery.html new file mode 100644 index 0000000..58e5423 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:32:06 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.SpanNotQuery.html b/dist/docs/ejs.SpanNotQuery.html new file mode 100644 index 0000000..fae57f2 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:32:06 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.SpanOrQuery.html b/dist/docs/ejs.SpanOrQuery.html new file mode 100644 index 0000000..9cf8761 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:32:07 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.SpanTermQuery.html b/dist/docs/ejs.SpanTermQuery.html new file mode 100644 index 0000000..a15499c --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:32:07 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.StatisticalFacet.html b/dist/docs/ejs.StatisticalFacet.html new file mode 100644 index 0000000..ccdabe3 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:32:07 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.StatsAggregation.html b/dist/docs/ejs.StatsAggregation.html new file mode 100644 index 0000000..c2d3ae4 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:32:08 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.SuggestContextMixin.html b/dist/docs/ejs.SuggestContextMixin.html new file mode 100644 index 0000000..38af7eb --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:32:08 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.SuggesterMixin.html b/dist/docs/ejs.SuggesterMixin.html new file mode 100644 index 0000000..b1c1662 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:32:08 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.SumAggregation.html b/dist/docs/ejs.SumAggregation.html new file mode 100644 index 0000000..e500399 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:32:09 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.TermFilter.html b/dist/docs/ejs.TermFilter.html new file mode 100644 index 0000000..98a7fea --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:32:09 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.TermQuery.html b/dist/docs/ejs.TermQuery.html new file mode 100644 index 0000000..0f0e9cb --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:32:10 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.TermStatsFacet.html b/dist/docs/ejs.TermStatsFacet.html new file mode 100644 index 0000000..428d12d --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:32:13 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.TermSuggester.html b/dist/docs/ejs.TermSuggester.html new file mode 100644 index 0000000..529a731 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:32:14 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.TermsAggregation.html b/dist/docs/ejs.TermsAggregation.html new file mode 100644 index 0000000..54e0e11 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:32:10 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.TermsFacet.html b/dist/docs/ejs.TermsFacet.html new file mode 100644 index 0000000..d7c961e --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:32:11 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.TermsFilter.html b/dist/docs/ejs.TermsFilter.html new file mode 100644 index 0000000..2619e69 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:32:12 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.TermsQuery.html b/dist/docs/ejs.TermsQuery.html new file mode 100644 index 0000000..2534d7d --- /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(min)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 ( min ) + + +
Sets the minimum number of terms 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. + + + +
+ + + +
+ +
+
+
+ +

 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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:32:13 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.TopChildrenQuery.html b/dist/docs/ejs.TopChildrenQuery.html new file mode 100644 index 0000000..2151188 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:32:15 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.TopHitsAggregation.html b/dist/docs/ejs.TopHitsAggregation.html new file mode 100644 index 0000000..3915e77 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:32:15 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.TypeFilter.html b/dist/docs/ejs.TypeFilter.html new file mode 100644 index 0000000..5191666 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:32:16 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.ValueCountAggregation.html b/dist/docs/ejs.ValueCountAggregation.html new file mode 100644 index 0000000..ac54673 --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:32:16 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.WildcardQuery.html b/dist/docs/ejs.WildcardQuery.html new file mode 100644 index 0000000..2f4b98f --- /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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:32:17 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.html b/dist/docs/ejs.html new file mode 100644 index 0000000..3b1b707 --- /dev/null +++ b/dist/docs/ejs.html @@ -0,0 +1,807 @@ + + + + + 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.

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

+
+ +
+
+
+ Copyright © FullScale Labs, LLC. 2012 + + Documentation generated by JSDoc 3 on Thu Aug 06 2015 00:31:11 GMT+0200 (CEST) + +
+ +
+ + diff --git a/dist/docs/ejs.html#.AggregationMixin b/dist/docs/ejs.html#.AggregationMixin new file mode 100644 index 0000000..c6bb186 --- /dev/null +++ b/dist/docs/ejs.html#.AggregationMixin @@ -0,0 +1,132 @@ + + + + + JSDoc: Mixin: AggregationMixin + + + + + + + + + + +
+ +

Mixin: AggregationMixin

+ + + + + + +
+ +
+ +

+ ejs. + + AggregationMixin +

+ + +
+ +
+
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:09 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.AndFilter b/dist/docs/ejs.html#.AndFilter new file mode 100644 index 0000000..12c55b8 --- /dev/null +++ b/dist/docs/ejs.html#.AndFilter @@ -0,0 +1,223 @@ + + + + + JSDoc: Class: AndFilter + + + + + + + + + + +
+ +

Class: AndFilter

+ + + + + + +
+ +
+ +

+ ejs. + + AndFilter +

+ +
A container Filter that allows Boolean AND composition of Filters.
+ + +
+ +
+
+ + + + +

Constructor

+ + +

new AndFilter(f)

+ + + + + +
+ A container Filter that allows Boolean AND composition of Filters. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
f + + +Filter +| + +Array.<Filter> + + + + A single Filter object or an array of valid + Filter objects.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:09 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.BoolFilter b/dist/docs/ejs.html#.BoolFilter new file mode 100644 index 0000000..b7c7453 --- /dev/null +++ b/dist/docs/ejs.html#.BoolFilter @@ -0,0 +1,174 @@ + + + + + JSDoc: Class: BoolFilter + + + + + + + + + + +
+ +

Class: BoolFilter

+ + + + + + +
+ +
+ +

+ ejs. + + BoolFilter +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new BoolFilter()

+ + + + + +
+ A Filter that matches documents matching boolean combinations of other + filters. +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:09 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.BoolQuery b/dist/docs/ejs.html#.BoolQuery new file mode 100644 index 0000000..a585ddc --- /dev/null +++ b/dist/docs/ejs.html#.BoolQuery @@ -0,0 +1,173 @@ + + + + + JSDoc: Class: BoolQuery + + + + + + + + + + +
+ +

Class: BoolQuery

+ + + + + + +
+ +
+ +

+ ejs. + + BoolQuery +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new BoolQuery()

+ + + + + +
+ A Query that matches documents matching boolean combinations of other + queries, e.g. termQuerys, phraseQuerys or other boolQuerys. +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:09 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.BoostFactorScoreFunction b/dist/docs/ejs.html#.BoostFactorScoreFunction new file mode 100644 index 0000000..fcaf8f7 --- /dev/null +++ b/dist/docs/ejs.html#.BoostFactorScoreFunction @@ -0,0 +1,221 @@ + + + + + JSDoc: Class: BoostFactorScoreFunction + + + + + + + + + + +
+ +

Class: BoostFactorScoreFunction

+ + + + + + +
+ +
+ +

+ ejs. + + BoostFactorScoreFunction +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new BoostFactorScoreFunction(boostVal)

+ + + + + +
+

Multiply the score by the provided boost_factor.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
boostVal + + +Float + + + + the boost factor.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:09 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.BoostingQuery b/dist/docs/ejs.html#.BoostingQuery new file mode 100644 index 0000000..98b488b --- /dev/null +++ b/dist/docs/ejs.html#.BoostingQuery @@ -0,0 +1,269 @@ + + + + + JSDoc: Class: BoostingQuery + + + + + + + + + + +
+ +

Class: BoostingQuery

+ + + + + + +
+ +
+ +

+ ejs. + + BoostingQuery +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new BoostingQuery(positiveQry, negativeQry, negativeBoost)

+ + + + + +
+

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

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
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.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:09 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.CardinalityAggregation b/dist/docs/ejs.html#.CardinalityAggregation new file mode 100644 index 0000000..22ea6a8 --- /dev/null +++ b/dist/docs/ejs.html#.CardinalityAggregation @@ -0,0 +1,221 @@ + + + + + JSDoc: Class: CardinalityAggregation + + + + + + + + + + +
+ +

Class: CardinalityAggregation

+ + + + + + +
+ +
+ +

+ ejs. + + CardinalityAggregation +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new CardinalityAggregation(name)

+ + + + + +
+

Aggregation that calculates an approximate count of distinct values.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +String + + + + The name which be used to refer to this aggregation.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:09 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.CommonTermsQuery b/dist/docs/ejs.html#.CommonTermsQuery new file mode 100644 index 0000000..881c6c5 --- /dev/null +++ b/dist/docs/ejs.html#.CommonTermsQuery @@ -0,0 +1,253 @@ + + + + + JSDoc: Class: CommonTermsQuery + + + + + + + + + + +
+ +

Class: CommonTermsQuery

+ + + + + + +
+ +
+ +

+ ejs. + + CommonTermsQuery +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new CommonTermsQuery(field, qstr)

+ + + + + +
+ A query that executes high-frequency terms in a optional sub-query. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +String + + + + the document field/key to query against
qstr + + +String + + + + the query string
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:09 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.CompletionSuggester b/dist/docs/ejs.html#.CompletionSuggester new file mode 100644 index 0000000..2be795d --- /dev/null +++ b/dist/docs/ejs.html#.CompletionSuggester @@ -0,0 +1,218 @@ + + + + + JSDoc: Class: CompletionSuggester + + + + + + + + + + +
+ +

Class: CompletionSuggester

+ + + + + + +
+ +
+ +

+ ejs. + + CompletionSuggester +

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

new CompletionSuggester(name)

+ + + + + +
+

A suggester that allows basic auto-complete functionality.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +String + + + + The name which be used to refer to this suggester.
+ + + + + + +
+ + + + +
Since:
+
  • elasticsearch 0.90.4
+ + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:09 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.ConstantScoreQuery b/dist/docs/ejs.html#.ConstantScoreQuery new file mode 100644 index 0000000..548b357 --- /dev/null +++ b/dist/docs/ejs.html#.ConstantScoreQuery @@ -0,0 +1,180 @@ + + + + + JSDoc: Class: ConstantScoreQuery + + + + + + + + + + +
+ +

Class: ConstantScoreQuery

+ + + + + + +
+ +
+ +

+ ejs. + + ConstantScoreQuery +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new ConstantScoreQuery()

+ + + + + +
+

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

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:09 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.DateHistogramAggregation b/dist/docs/ejs.html#.DateHistogramAggregation new file mode 100644 index 0000000..8126306 --- /dev/null +++ b/dist/docs/ejs.html#.DateHistogramAggregation @@ -0,0 +1,228 @@ + + + + + JSDoc: Class: DateHistogramAggregation + + + + + + + + + + +
+ +

Class: DateHistogramAggregation

+ + + + + + +
+ +
+ +

+ ejs. + + DateHistogramAggregation +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new DateHistogramAggregation(name)

+ + + + + +
+

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

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +String + + + + The name which be used to refer to this aggregation.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:09 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.DateHistogramFacet b/dist/docs/ejs.html#.DateHistogramFacet new file mode 100644 index 0000000..27b9c5e --- /dev/null +++ b/dist/docs/ejs.html#.DateHistogramFacet @@ -0,0 +1,238 @@ + + + + + JSDoc: Class: DateHistogramFacet + + + + + + + + + + +
+ +

Class: DateHistogramFacet

+ + + + + + +
+ +
+ +

+ ejs. + + DateHistogramFacet +

+ +

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

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

Constructor

+ + +

new DateHistogramFacet(name)

+ + + + + +
+

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

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
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.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:09 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.DateRangeAggregation b/dist/docs/ejs.html#.DateRangeAggregation new file mode 100644 index 0000000..e801542 --- /dev/null +++ b/dist/docs/ejs.html#.DateRangeAggregation @@ -0,0 +1,227 @@ + + + + + JSDoc: Class: DateRangeAggregation + + + + + + + + + + +
+ +

Class: DateRangeAggregation

+ + + + + + +
+ +
+ +

+ ejs. + + DateRangeAggregation +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new DateRangeAggregation(name)

+ + + + + +
+

Aggregation that is dedicated for date value ranges.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +String + + + + The name which be used to refer to this aggregation.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:09 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.DecayScoreFunction b/dist/docs/ejs.html#.DecayScoreFunction new file mode 100644 index 0000000..4eef4e9 --- /dev/null +++ b/dist/docs/ejs.html#.DecayScoreFunction @@ -0,0 +1,225 @@ + + + + + JSDoc: Class: DecayScoreFunction + + + + + + + + + + +
+ +

Class: DecayScoreFunction

+ + + + + + +
+ +
+ +

+ ejs. + + DecayScoreFunction +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new 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:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +String + + + + the document field to run decay function against.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:09 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.DirectGenerator b/dist/docs/ejs.html#.DirectGenerator new file mode 100644 index 0000000..1ce0084 --- /dev/null +++ b/dist/docs/ejs.html#.DirectGenerator @@ -0,0 +1,175 @@ + + + + + JSDoc: Class: DirectGenerator + + + + + + + + + + +
+ +

Class: DirectGenerator

+ + + + + + +
+ +
+ +

+ ejs. + + DirectGenerator +

+ +

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

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new DirectGenerator()

+ + + + + +
+

A candidate generator that generates terms based on edit distance.

+
+ + + + + + + + + + + + + +
+ + + + +
Since:
+
  • elasticsearch 0.90
+ + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:09 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.DirectSettingsMixin b/dist/docs/ejs.html#.DirectSettingsMixin new file mode 100644 index 0000000..9a0c801 --- /dev/null +++ b/dist/docs/ejs.html#.DirectSettingsMixin @@ -0,0 +1,132 @@ + + + + + JSDoc: Mixin: DirectSettingsMixin + + + + + + + + + + +
+ +

Mixin: DirectSettingsMixin

+ + + + + + +
+ +
+ +

+ ejs. + + DirectSettingsMixin +

+ + +
+ +
+
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:09 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.DisMaxQuery b/dist/docs/ejs.html#.DisMaxQuery new file mode 100644 index 0000000..d7e68a2 --- /dev/null +++ b/dist/docs/ejs.html#.DisMaxQuery @@ -0,0 +1,174 @@ + + + + + JSDoc: Class: DisMaxQuery + + + + + + + + + + +
+ +

Class: DisMaxQuery

+ + + + + + +
+ +
+ +

+ ejs. + + DisMaxQuery +

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

Constructor

+ + +

new DisMaxQuery()

+ + + + + +
+ A query that generates the union of documents produced by its subqueries such + as termQuerys, phraseQuerys, boolQuerys, etc. +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:09 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.ExistsFilter b/dist/docs/ejs.html#.ExistsFilter new file mode 100644 index 0000000..2545634 --- /dev/null +++ b/dist/docs/ejs.html#.ExistsFilter @@ -0,0 +1,220 @@ + + + + + JSDoc: Class: ExistsFilter + + + + + + + + + + +
+ +

Class: ExistsFilter

+ + + + + + +
+ +
+ +

+ ejs. + + ExistsFilter +

+ +

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

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new ExistsFilter(fieldName)

+ + + + + +
+ Filters documents where a specified field exists and contains a value. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
fieldName + + +String + + + + the field name that must exists and contain a value.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:09 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.FacetMixin b/dist/docs/ejs.html#.FacetMixin new file mode 100644 index 0000000..5e482e8 --- /dev/null +++ b/dist/docs/ejs.html#.FacetMixin @@ -0,0 +1,132 @@ + + + + + JSDoc: Mixin: FacetMixin + + + + + + + + + + +
+ +

Mixin: FacetMixin

+ + + + + + +
+ +
+ +

+ ejs. + + FacetMixin +

+ + +
+ +
+
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:09 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.FieldMaskingSpanQuery b/dist/docs/ejs.html#.FieldMaskingSpanQuery new file mode 100644 index 0000000..f8a1dfa --- /dev/null +++ b/dist/docs/ejs.html#.FieldMaskingSpanQuery @@ -0,0 +1,246 @@ + + + + + JSDoc: Class: FieldMaskingSpanQuery + + + + + + + + + + +
+ +

Class: FieldMaskingSpanQuery

+ + + + + + +
+ +
+ +

+ ejs. + + FieldMaskingSpanQuery +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new FieldMaskingSpanQuery(spanQry, field)

+ + + + + +
+ Wraps a SpanQuery and hides the real field being searched across. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
spanQry + + +Query + + + + A valid SpanQuery
field + + +Integer + + + + the maximum field position in a match.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:09 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.FieldValueFactorFunction b/dist/docs/ejs.html#.FieldValueFactorFunction new file mode 100644 index 0000000..5392ed6 --- /dev/null +++ b/dist/docs/ejs.html#.FieldValueFactorFunction @@ -0,0 +1,222 @@ + + + + + JSDoc: Class: FieldValueFactorFunction + + + + + + + + + + +
+ +

Class: FieldValueFactorFunction

+ + + + + + +
+ +
+ +

+ ejs. + + FieldValueFactorFunction +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new FieldValueFactorFunction(field)

+ + + + + +
+

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

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +String + + + + the field to apply the function to.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:09 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.FilterAggregation b/dist/docs/ejs.html#.FilterAggregation new file mode 100644 index 0000000..dc2ad59 --- /dev/null +++ b/dist/docs/ejs.html#.FilterAggregation @@ -0,0 +1,221 @@ + + + + + JSDoc: Class: FilterAggregation + + + + + + + + + + +
+ +

Class: FilterAggregation

+ + + + + + +
+ +
+ +

+ ejs. + + FilterAggregation +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new FilterAggregation(name)

+ + + + + +
+

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

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +String + + + + The name which be used to refer to this aggregation.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:09 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.FilterFacet b/dist/docs/ejs.html#.FilterFacet new file mode 100644 index 0000000..40527d0 --- /dev/null +++ b/dist/docs/ejs.html#.FilterFacet @@ -0,0 +1,236 @@ + + + + + JSDoc: Class: FilterFacet + + + + + + + + + + +
+ +

Class: FilterFacet

+ + + + + + +
+ +
+ +

+ ejs. + + FilterFacet +

+ +

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

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

Constructor

+ + +

new FilterFacet(name)

+ + + + + +
+

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

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
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.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:09 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.FilterMixin b/dist/docs/ejs.html#.FilterMixin new file mode 100644 index 0000000..7c07162 --- /dev/null +++ b/dist/docs/ejs.html#.FilterMixin @@ -0,0 +1,132 @@ + + + + + JSDoc: Mixin: FilterMixin + + + + + + + + + + +
+ +

Mixin: FilterMixin

+ + + + + + +
+ +
+ +

+ ejs. + + FilterMixin +

+ + +
+ +
+
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:09 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.FilteredQuery b/dist/docs/ejs.html#.FilteredQuery new file mode 100644 index 0000000..b17f207 --- /dev/null +++ b/dist/docs/ejs.html#.FilteredQuery @@ -0,0 +1,247 @@ + + + + + JSDoc: Class: FilteredQuery + + + + + + + + + + +
+ +

Class: FilteredQuery

+ + + + + + +
+ +
+ +

+ ejs. + + FilteredQuery +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new FilteredQuery(someQuery, someFilter)

+ + + + + +
+

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

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
someQuery + + +Object + + + + a valid Query object
someFilter + + +Object + + + + a valid Filter object. This parameter + is optional.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:09 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.FunctionScoreQuery b/dist/docs/ejs.html#.FunctionScoreQuery new file mode 100644 index 0000000..517fd11 --- /dev/null +++ b/dist/docs/ejs.html#.FunctionScoreQuery @@ -0,0 +1,173 @@ + + + + + JSDoc: Class: FunctionScoreQuery + + + + + + + + + + +
+ +

Class: FunctionScoreQuery

+ + + + + + +
+ +
+ +

+ ejs. + + FunctionScoreQuery +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new FunctionScoreQuery()

+ + + + + +
+

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

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:09 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.FuzzyLikeThisFieldQuery b/dist/docs/ejs.html#.FuzzyLikeThisFieldQuery new file mode 100644 index 0000000..6afbc07 --- /dev/null +++ b/dist/docs/ejs.html#.FuzzyLikeThisFieldQuery @@ -0,0 +1,262 @@ + + + + + JSDoc: Class: FuzzyLikeThisFieldQuery + + + + + + + + + + +
+ +

Class: FuzzyLikeThisFieldQuery

+ + + + + + +
+ +
+ +

+ ejs. + + FuzzyLikeThisFieldQuery +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new FuzzyLikeThisFieldQuery(field, likeText)

+ + + + + +
+

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

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +String + + + + The field to run the query against.
likeText + + +String + + + + The text to find documents like it.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:09 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.FuzzyLikeThisQuery b/dist/docs/ejs.html#.FuzzyLikeThisQuery new file mode 100644 index 0000000..d6dbb5f --- /dev/null +++ b/dist/docs/ejs.html#.FuzzyLikeThisQuery @@ -0,0 +1,236 @@ + + + + + JSDoc: Class: FuzzyLikeThisQuery + + + + + + + + + + +
+ +

Class: FuzzyLikeThisQuery

+ + + + + + +
+ +
+ +

+ ejs. + + FuzzyLikeThisQuery +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new FuzzyLikeThisQuery(likeText)

+ + + + + +
+

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

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
likeText + + +String + + + + The text to find documents like it.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:09 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.FuzzyQuery b/dist/docs/ejs.html#.FuzzyQuery new file mode 100644 index 0000000..a3b8685 --- /dev/null +++ b/dist/docs/ejs.html#.FuzzyQuery @@ -0,0 +1,249 @@ + + + + + JSDoc: Class: FuzzyQuery + + + + + + + + + + +
+ +

Class: FuzzyQuery

+ + + + + + +
+ +
+ +

+ ejs. + + FuzzyQuery +

+ +

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

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new FuzzyQuery(field, value)

+ + + + + +
+

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

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +String + + + + The field to run the fuzzy query against.
value + + +String + + + + The value to fuzzify.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:09 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.GeoBboxFilter b/dist/docs/ejs.html#.GeoBboxFilter new file mode 100644 index 0000000..8d6a05e --- /dev/null +++ b/dist/docs/ejs.html#.GeoBboxFilter @@ -0,0 +1,220 @@ + + + + + JSDoc: Class: GeoBboxFilter + + + + + + + + + + +
+ +

Class: GeoBboxFilter

+ + + + + + +
+ +
+ +

+ ejs. + + GeoBboxFilter +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new GeoBboxFilter(fieldName)

+ + + + + +
+ Filter results to those which are contained within the defined bounding box. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
fieldName + + +String + + + + the document property/field containing the Geo Point (lon/lat).
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:09 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.GeoDistanceAggregation b/dist/docs/ejs.html#.GeoDistanceAggregation new file mode 100644 index 0000000..9d57103 --- /dev/null +++ b/dist/docs/ejs.html#.GeoDistanceAggregation @@ -0,0 +1,226 @@ + + + + + JSDoc: Class: GeoDistanceAggregation + + + + + + + + + + +
+ +

Class: GeoDistanceAggregation

+ + + + + + +
+ +
+ +

+ ejs. + + GeoDistanceAggregation +

+ +

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

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new GeoDistanceAggregation(name)

+ + + + + +
+

Aggregation that works on geo_point fields and conceptually works very + similar to the range aggregation.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +String + + + + The name which be used to refer to this aggregation.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.GeoDistanceFacet b/dist/docs/ejs.html#.GeoDistanceFacet new file mode 100644 index 0000000..f958b76 --- /dev/null +++ b/dist/docs/ejs.html#.GeoDistanceFacet @@ -0,0 +1,237 @@ + + + + + JSDoc: Class: GeoDistanceFacet + + + + + + + + + + +
+ +

Class: GeoDistanceFacet

+ + + + + + +
+ +
+ +

+ ejs. + + GeoDistanceFacet +

+ +

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

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

Constructor

+ + +

new GeoDistanceFacet(name)

+ + + + + +
+

A facet which provides information over a range of distances from a provided point.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
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.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.GeoDistanceFilter b/dist/docs/ejs.html#.GeoDistanceFilter new file mode 100644 index 0000000..fbfb972 --- /dev/null +++ b/dist/docs/ejs.html#.GeoDistanceFilter @@ -0,0 +1,220 @@ + + + + + JSDoc: Class: GeoDistanceFilter + + + + + + + + + + +
+ +

Class: GeoDistanceFilter

+ + + + + + +
+ +
+ +

+ ejs. + + GeoDistanceFilter +

+ +

A filter that restricts matched results/docs to a given distance from the + point of origin. The format conforms with the GeoJSON specification.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new GeoDistanceFilter(fieldName)

+ + + + + +
+ Filter results to those which fall within the given distance of the point of origin. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
fieldName + + +String + + + + the document property/field containing the Geo Point (lon/lat).
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.GeoDistanceRangeFilter b/dist/docs/ejs.html#.GeoDistanceRangeFilter new file mode 100644 index 0000000..45a43eb --- /dev/null +++ b/dist/docs/ejs.html#.GeoDistanceRangeFilter @@ -0,0 +1,220 @@ + + + + + JSDoc: Class: GeoDistanceRangeFilter + + + + + + + + + + +
+ +

Class: GeoDistanceRangeFilter

+ + + + + + +
+ +
+ +

+ ejs. + + GeoDistanceRangeFilter +

+ +

A filter that restricts matched results/docs to a given distance range from the + point of origin. The format conforms with the GeoJSON specification.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new GeoDistanceRangeFilter(fieldName)

+ + + + + +
+ Filter results to those which fall within the given distance range of the point of origin. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
fieldName + + +String + + + + the document property/field containing the Geo Point (lon/lat).
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.GeoHashGridAggregation b/dist/docs/ejs.html#.GeoHashGridAggregation new file mode 100644 index 0000000..e9ea95a --- /dev/null +++ b/dist/docs/ejs.html#.GeoHashGridAggregation @@ -0,0 +1,223 @@ + + + + + JSDoc: Class: GeoHashGridAggregation + + + + + + + + + + +
+ +

Class: GeoHashGridAggregation

+ + + + + + +
+ +
+ +

+ ejs. + + GeoHashGridAggregation +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new GeoHashGridAggregation(name)

+ + + + + +
+

Aggregation that works on geo_point fields and groups points into buckets + that represent cells in a grid.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +String + + + + The name which be used to refer to this aggregation.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.GeoPoint b/dist/docs/ejs.html#.GeoPoint new file mode 100644 index 0000000..1587d52 --- /dev/null +++ b/dist/docs/ejs.html#.GeoPoint @@ -0,0 +1,222 @@ + + + + + JSDoc: Class: GeoPoint + + + + + + + + + + +
+ +

Class: GeoPoint

+ + + + + + +
+ +
+ +

+ ejs. + + GeoPoint +

+ +

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

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new GeoPoint(p)

+ + + + + +
+

Defines a point

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
p + + +Array + + + + An optional point as an array in [lat, lon] format.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.GeoPolygonFilter b/dist/docs/ejs.html#.GeoPolygonFilter new file mode 100644 index 0000000..47897ae --- /dev/null +++ b/dist/docs/ejs.html#.GeoPolygonFilter @@ -0,0 +1,220 @@ + + + + + JSDoc: Class: GeoPolygonFilter + + + + + + + + + + +
+ +

Class: GeoPolygonFilter

+ + + + + + +
+ +
+ +

+ ejs. + + GeoPolygonFilter +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new GeoPolygonFilter(fieldName)

+ + + + + +
+ Filter results to those which are contained within the polygon of points. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
fieldName + + +String + + + + the document property/field containing the Geo Point (lon/lat).
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.GeoShapeFilter b/dist/docs/ejs.html#.GeoShapeFilter new file mode 100644 index 0000000..bc0f7a5 --- /dev/null +++ b/dist/docs/ejs.html#.GeoShapeFilter @@ -0,0 +1,177 @@ + + + + + JSDoc: Class: GeoShapeFilter + + + + + + + + + + +
+ +

Class: GeoShapeFilter

+ + + + + + +
+ +
+ +

+ ejs. + + GeoShapeFilter +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new GeoShapeFilter()

+ + + + + +
+ A Filter to find documents with a geo_shapes matching a specific shape. +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.GeoShapeQuery b/dist/docs/ejs.html#.GeoShapeQuery new file mode 100644 index 0000000..5d59690 --- /dev/null +++ b/dist/docs/ejs.html#.GeoShapeQuery @@ -0,0 +1,177 @@ + + + + + JSDoc: Class: GeoShapeQuery + + + + + + + + + + +
+ +

Class: GeoShapeQuery

+ + + + + + +
+ +
+ +

+ ejs. + + GeoShapeQuery +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new GeoShapeQuery()

+ + + + + +
+ A Query to find documents with a geo_shapes matching a specific shape. +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.HasChildFilter b/dist/docs/ejs.html#.HasChildFilter new file mode 100644 index 0000000..f352ef2 --- /dev/null +++ b/dist/docs/ejs.html#.HasChildFilter @@ -0,0 +1,243 @@ + + + + + JSDoc: Class: HasChildFilter + + + + + + + + + + +
+ +

Class: HasChildFilter

+ + + + + + +
+ +
+ +

+ ejs. + + HasChildFilter +

+ +

The has_child filter results in parent documents that have child docs + matching the query being returned.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new HasChildFilter(qryOrFltr, type)

+ + + + + +
+ Returns results that have child documents matching the filter. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
qryOrFltr + + +Object + + + + A valid query or filter object.
type + + +String + + + + The child type
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.HasChildQuery b/dist/docs/ejs.html#.HasChildQuery new file mode 100644 index 0000000..f1d5be2 --- /dev/null +++ b/dist/docs/ejs.html#.HasChildQuery @@ -0,0 +1,244 @@ + + + + + JSDoc: Class: HasChildQuery + + + + + + + + + + +
+ +

Class: HasChildQuery

+ + + + + + +
+ +
+ +

+ ejs. + + HasChildQuery +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new HasChildQuery(qry, type)

+ + + + + +
+ Returns results that have child documents matching the query. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
qry + + +Object + + + + A valid query object.
type + + +String + + + + The child type
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.HasParentFilter b/dist/docs/ejs.html#.HasParentFilter new file mode 100644 index 0000000..72f3e84 --- /dev/null +++ b/dist/docs/ejs.html#.HasParentFilter @@ -0,0 +1,243 @@ + + + + + JSDoc: Class: HasParentFilter + + + + + + + + + + +
+ +

Class: HasParentFilter

+ + + + + + +
+ +
+ +

+ ejs. + + HasParentFilter +

+ +

The has_parent results in child documents that have parent docs matching + the query being returned.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new HasParentFilter(qryOrFltr, parentType)

+ + + + + +
+ Returns results that have parent documents matching the filter. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
qryOrFltr + + +Object + + + + A valid query or filter object.
parentType + + +String + + + + The child type
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.HasParentQuery b/dist/docs/ejs.html#.HasParentQuery new file mode 100644 index 0000000..021f6f3 --- /dev/null +++ b/dist/docs/ejs.html#.HasParentQuery @@ -0,0 +1,244 @@ + + + + + JSDoc: Class: HasParentQuery + + + + + + + + + + +
+ +

Class: HasParentQuery

+ + + + + + +
+ +
+ +

+ ejs. + + HasParentQuery +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new HasParentQuery(qry, parentType)

+ + + + + +
+ Returns results that have parent documents matching the query. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
qry + + +Object + + + + A valid query object.
parentType + + +String + + + + The child type
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.Highlight b/dist/docs/ejs.html#.Highlight new file mode 100644 index 0000000..058f8ab --- /dev/null +++ b/dist/docs/ejs.html#.Highlight @@ -0,0 +1,234 @@ + + + + + JSDoc: Class: Highlight + + + + + + + + + + +
+ +

Class: Highlight

+ + + + + + +
+ +
+ +

+ ejs. + + Highlight +

+ +

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

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new Highlight(fields)

+ + + + + +
+

Allows to highlight search results on one or more fields.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
fields + + +String +| + +Array.<String> + + + + An optional field or array of fields to highlight.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.HistogramAggregation b/dist/docs/ejs.html#.HistogramAggregation new file mode 100644 index 0000000..12974cd --- /dev/null +++ b/dist/docs/ejs.html#.HistogramAggregation @@ -0,0 +1,222 @@ + + + + + JSDoc: Class: HistogramAggregation + + + + + + + + + + +
+ +

Class: HistogramAggregation

+ + + + + + +
+ +
+ +

+ ejs. + + HistogramAggregation +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new HistogramAggregation(name)

+ + + + + +
+

Aggregation that can be applied on numeric values extracted from the + documents.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +String + + + + The name which be used to refer to this aggregation.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.HistogramFacet b/dist/docs/ejs.html#.HistogramFacet new file mode 100644 index 0000000..8f52f12 --- /dev/null +++ b/dist/docs/ejs.html#.HistogramFacet @@ -0,0 +1,238 @@ + + + + + JSDoc: Class: HistogramFacet + + + + + + + + + + +
+ +

Class: HistogramFacet

+ + + + + + +
+ +
+ +

+ ejs. + + HistogramFacet +

+ +

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

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

Constructor

+ + +

new HistogramFacet(name)

+ + + + + +
+

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

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
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.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.IPv4RangeAggregation b/dist/docs/ejs.html#.IPv4RangeAggregation new file mode 100644 index 0000000..3d6223d --- /dev/null +++ b/dist/docs/ejs.html#.IPv4RangeAggregation @@ -0,0 +1,222 @@ + + + + + JSDoc: Class: IPv4RangeAggregation + + + + + + + + + + +
+ +

Class: IPv4RangeAggregation

+ + + + + + +
+ +
+ +

+ ejs. + + IPv4RangeAggregation +

+ +

A dedicated range aggregation for IPv4 typed fields.

+ +

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

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new IPv4RangeAggregation(name)

+ + + + + +
+

A dedicated range aggregation for IPv4 typed fields.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +String + + + + The name which be used to refer to this aggregation.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.IdsFilter b/dist/docs/ejs.html#.IdsFilter new file mode 100644 index 0000000..243f855 --- /dev/null +++ b/dist/docs/ejs.html#.IdsFilter @@ -0,0 +1,224 @@ + + + + + JSDoc: Class: IdsFilter + + + + + + + + + + +
+ +

Class: IdsFilter

+ + + + + + +
+ +
+ +

+ ejs. + + IdsFilter +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new IdsFilter(ids)

+ + + + + +
+ Matches documents with the specified id(s). +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
ids + + +String +| + +Array.<String> + + + + A single document id or a list of document ids.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.IdsQuery b/dist/docs/ejs.html#.IdsQuery new file mode 100644 index 0000000..1dc39bd --- /dev/null +++ b/dist/docs/ejs.html#.IdsQuery @@ -0,0 +1,224 @@ + + + + + JSDoc: Class: IdsQuery + + + + + + + + + + +
+ +

Class: IdsQuery

+ + + + + + +
+ +
+ +

+ ejs. + + IdsQuery +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new IdsQuery(ids)

+ + + + + +
+ Matches documents with the specified id(s). +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
ids + + +String +| + +Array.<String> + + + + A single document id or a list of document ids.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.IndexedShape b/dist/docs/ejs.html#.IndexedShape new file mode 100644 index 0000000..d878949 --- /dev/null +++ b/dist/docs/ejs.html#.IndexedShape @@ -0,0 +1,246 @@ + + + + + JSDoc: Class: IndexedShape + + + + + + + + + + +
+ +

Class: IndexedShape

+ + + + + + +
+ +
+ +

+ ejs. + + IndexedShape +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new IndexedShape(type, id)

+ + + + + +
+

Defines a shape that already exists in an index/type.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
type + + +String + + + + The name of the type where the shape is indexed.
id + + +String + + + + The document id of the shape.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.IndicesFilter b/dist/docs/ejs.html#.IndicesFilter new file mode 100644 index 0000000..347c40f --- /dev/null +++ b/dist/docs/ejs.html#.IndicesFilter @@ -0,0 +1,249 @@ + + + + + JSDoc: Class: IndicesFilter + + + + + + + + + + +
+ +

Class: IndicesFilter

+ + + + + + +
+ +
+ +

+ ejs. + + IndicesFilter +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new IndicesFilter(fltr, indices)

+ + + + + +
+ A configurable filter that is dependent on the index name. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
fltr + + +Object + + + + A valid filter object.
indices + + +String +| + +Array.<String> + + + + a single index name or an array of index + names.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.IndicesQuery b/dist/docs/ejs.html#.IndicesQuery new file mode 100644 index 0000000..31f1fde --- /dev/null +++ b/dist/docs/ejs.html#.IndicesQuery @@ -0,0 +1,249 @@ + + + + + JSDoc: Class: IndicesQuery + + + + + + + + + + +
+ +

Class: IndicesQuery

+ + + + + + +
+ +
+ +

+ ejs. + + IndicesQuery +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new IndicesQuery(qry, indices)

+ + + + + +
+ A configurable query that is dependent on the index name. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
qry + + +Query + + + + A valid query object.
indices + + +String +| + +Array.<String> + + + + a single index name or an array of index + names.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.LimitFilter b/dist/docs/ejs.html#.LimitFilter new file mode 100644 index 0000000..4170c14 --- /dev/null +++ b/dist/docs/ejs.html#.LimitFilter @@ -0,0 +1,219 @@ + + + + + JSDoc: Class: LimitFilter + + + + + + + + + + +
+ +

Class: LimitFilter

+ + + + + + +
+ +
+ +

+ ejs. + + LimitFilter +

+ +

A limit filter limits the number of documents (per shard) to execute on.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new LimitFilter(limit)

+ + + + + +
+ Limits the number of documents to execute on. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
limit + + +Integer + + + + The number of documents to execute on.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.MatchQuery b/dist/docs/ejs.html#.MatchQuery new file mode 100644 index 0000000..1384fa7 --- /dev/null +++ b/dist/docs/ejs.html#.MatchQuery @@ -0,0 +1,245 @@ + + + + + JSDoc: Class: MatchQuery + + + + + + + + + + +
+ +

Class: MatchQuery

+ + + + + + +
+ +
+ +

+ ejs. + + MatchQuery +

+ +
A MatchQuery is a type of Query that accepts + text/numerics/dates, analyzes it, generates a query based on the + MatchQuery type.
+ + +
+ +
+
+ + + + +

Constructor

+ + +

new MatchQuery(field, qstr)

+ + + + + +
+ A Query that appects text, analyzes it, generates internal query based + on the MatchQuery type. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +String + + + + the document field/field to query against
qstr + + +String + + + + the query string
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.MetricsAggregationMixin b/dist/docs/ejs.html#.MetricsAggregationMixin new file mode 100644 index 0000000..ce1955d --- /dev/null +++ b/dist/docs/ejs.html#.MetricsAggregationMixin @@ -0,0 +1,132 @@ + + + + + JSDoc: Mixin: MetricsAggregationMixin + + + + + + + + + + +
+ +

Mixin: MetricsAggregationMixin

+ + + + + + +
+ +
+ +

+ ejs. + + MetricsAggregationMixin +

+ + +
+ +
+
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.MissingAggregation b/dist/docs/ejs.html#.MissingAggregation new file mode 100644 index 0000000..82f7b60 --- /dev/null +++ b/dist/docs/ejs.html#.MissingAggregation @@ -0,0 +1,221 @@ + + + + + JSDoc: Class: MissingAggregation + + + + + + + + + + +
+ +

Class: MissingAggregation

+ + + + + + +
+ +
+ +

+ ejs. + + MissingAggregation +

+ +

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

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new MissingAggregation(name)

+ + + + + +
+

Defines a bucket of all documents that are missing a field value.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +String + + + + The name which be used to refer to this aggregation.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.MissingFilter b/dist/docs/ejs.html#.MissingFilter new file mode 100644 index 0000000..2635c33 --- /dev/null +++ b/dist/docs/ejs.html#.MissingFilter @@ -0,0 +1,219 @@ + + + + + JSDoc: Class: MissingFilter + + + + + + + + + + +
+ +

Class: MissingFilter

+ + + + + + +
+ +
+ +

+ ejs. + + MissingFilter +

+ +

An missingFilter matches documents where the specified field contains no legitimate value.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new MissingFilter(fieldName)

+ + + + + +
+ Filters documents where a specific field has no value present. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
fieldName + + +String + + + + the field name to check for missing values.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.MoreLikeThisFieldQuery b/dist/docs/ejs.html#.MoreLikeThisFieldQuery new file mode 100644 index 0000000..f53ab6b --- /dev/null +++ b/dist/docs/ejs.html#.MoreLikeThisFieldQuery @@ -0,0 +1,243 @@ + + + + + JSDoc: Class: MoreLikeThisFieldQuery + + + + + + + + + + +
+ +

Class: MoreLikeThisFieldQuery

+ + + + + + +
+ +
+ +

+ ejs. + + MoreLikeThisFieldQuery +

+ +

The more_like_this_field query is the same as the more_like_this query, + except it runs against a single field.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new MoreLikeThisFieldQuery(field, likeText)

+ + + + + +
+

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

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +String + + + + The field to run the query against.
likeText + + +String + + + + The text to find documents like it.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.MoreLikeThisQuery b/dist/docs/ejs.html#.MoreLikeThisQuery new file mode 100644 index 0000000..82104a3 --- /dev/null +++ b/dist/docs/ejs.html#.MoreLikeThisQuery @@ -0,0 +1,246 @@ + + + + + JSDoc: Class: MoreLikeThisQuery + + + + + + + + + + +
+ +

Class: MoreLikeThisQuery

+ + + + + + +
+ +
+ +

+ ejs. + + MoreLikeThisQuery +

+ +

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

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new MoreLikeThisQuery(fields, likeText)

+ + + + + +
+

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

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
fields + + +String +| + +Array.<String> + + + + A single field or array of fields to run against.
likeText + + +String + + + + The text to find documents like it.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.MultiMatchQuery b/dist/docs/ejs.html#.MultiMatchQuery new file mode 100644 index 0000000..a1fb444 --- /dev/null +++ b/dist/docs/ejs.html#.MultiMatchQuery @@ -0,0 +1,250 @@ + + + + + JSDoc: Class: MultiMatchQuery + + + + + + + + + + +
+ +

Class: MultiMatchQuery

+ + + + + + +
+ +
+ +

+ ejs. + + MultiMatchQuery +

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

Constructor

+ + +

new MultiMatchQuery(fields, qstr)

+ + + + + +
+ A Query that allow to more easily build a MatchQuery + over multiple fields +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
fields + + +String +| + +Array.<String> + + + + the single field or array of fields to search across
qstr + + +String + + + + the query string
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.NestedAggregation b/dist/docs/ejs.html#.NestedAggregation new file mode 100644 index 0000000..a43d38d --- /dev/null +++ b/dist/docs/ejs.html#.NestedAggregation @@ -0,0 +1,221 @@ + + + + + JSDoc: Class: NestedAggregation + + + + + + + + + + +
+ +

Class: NestedAggregation

+ + + + + + +
+ +
+ +

+ ejs. + + NestedAggregation +

+ +

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

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new NestedAggregation(name)

+ + + + + +
+

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

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +String + + + + The name which be used to refer to this aggregation.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.NestedFilter b/dist/docs/ejs.html#.NestedFilter new file mode 100644 index 0000000..81a38f0 --- /dev/null +++ b/dist/docs/ejs.html#.NestedFilter @@ -0,0 +1,227 @@ + + + + + JSDoc: Class: NestedFilter + + + + + + + + + + +
+ +

Class: NestedFilter

+ + + + + + +
+ +
+ +

+ ejs. + + NestedFilter +

+ +

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

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new NestedFilter(path)

+ + + + + +
+

Constructs a filter that is capable of executing a filter against objects + nested within a document.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
path + + +String + + + + The nested object path.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.NestedQuery b/dist/docs/ejs.html#.NestedQuery new file mode 100644 index 0000000..0df7ed9 --- /dev/null +++ b/dist/docs/ejs.html#.NestedQuery @@ -0,0 +1,226 @@ + + + + + JSDoc: Class: NestedQuery + + + + + + + + + + +
+ +

Class: NestedQuery

+ + + + + + +
+ +
+ +

+ ejs. + + NestedQuery +

+ +

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

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new NestedQuery(path)

+ + + + + +
+

Constructs a query that is capable of executing a search against objects + nested within a document.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
path + + +String + + + + The nested object path.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.NotFilter b/dist/docs/ejs.html#.NotFilter new file mode 100644 index 0000000..f4ab609 --- /dev/null +++ b/dist/docs/ejs.html#.NotFilter @@ -0,0 +1,220 @@ + + + + + JSDoc: Class: NotFilter + + + + + + + + + + +
+ +

Class: NotFilter

+ + + + + + +
+ +
+ +

+ ejs. + + NotFilter +

+ +

A container Filter that excludes the documents matched by the + contained filter.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new NotFilter(oFilter)

+ + + + + +
+ Container filter that excludes the matched documents of the contained filter. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
oFilter + + +Object + + + + a valid Filter object such as a termFilter, etc.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.NumericRangeFilter b/dist/docs/ejs.html#.NumericRangeFilter new file mode 100644 index 0000000..1b5c7ac --- /dev/null +++ b/dist/docs/ejs.html#.NumericRangeFilter @@ -0,0 +1,230 @@ + + + + + JSDoc: Class: NumericRangeFilter + + + + + + + + + + +
+ +

Class: NumericRangeFilter

+ + + + + + +
+ +
+ +

+ ejs. + + NumericRangeFilter +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new NumericRangeFilter(fieldName)

+ + + + + +
+ A Filter that only accepts numeric values within a specified range. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
fieldName + + +String + + + + The name of the field to filter on.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.OrFilter b/dist/docs/ejs.html#.OrFilter new file mode 100644 index 0000000..4f887e6 --- /dev/null +++ b/dist/docs/ejs.html#.OrFilter @@ -0,0 +1,222 @@ + + + + + JSDoc: Class: OrFilter + + + + + + + + + + +
+ +

Class: OrFilter

+ + + + + + +
+ +
+ +

+ ejs. + + OrFilter +

+ +
A container filter that allows Boolean OR composition of filters.
+ + +
+ +
+
+ + + + +

Constructor

+ + +

new OrFilter(filters)

+ + + + + +
+ A container Filter that allows Boolean OR composition of filters. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
filters + + +Filter +| + +Array.<Filter> + + + + A valid Filter or array of Filters.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.PercentilesAggregation b/dist/docs/ejs.html#.PercentilesAggregation new file mode 100644 index 0000000..31e9da5 --- /dev/null +++ b/dist/docs/ejs.html#.PercentilesAggregation @@ -0,0 +1,223 @@ + + + + + JSDoc: Class: PercentilesAggregation + + + + + + + + + + +
+ +

Class: PercentilesAggregation

+ + + + + + +
+ +
+ +

+ ejs. + + PercentilesAggregation +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new PercentilesAggregation(name)

+ + + + + +
+

Aggregation that calculates one or more percentiles over numeric values + extracted from the aggregated documents.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +String + + + + The name which be used to refer to this aggregation.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.PhraseSuggester b/dist/docs/ejs.html#.PhraseSuggester new file mode 100644 index 0000000..8cf5641 --- /dev/null +++ b/dist/docs/ejs.html#.PhraseSuggester @@ -0,0 +1,226 @@ + + + + + JSDoc: Class: PhraseSuggester + + + + + + + + + + +
+ +

Class: PhraseSuggester

+ + + + + + +
+ +
+ +

+ ejs. + + PhraseSuggester +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new PhraseSuggester(name)

+ + + + + +
+

A suggester that suggests entire corrected phrases.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +String + + + + The name which be used to refer to this suggester.
+ + + + + + +
+ + + + +
Since:
+
  • elasticsearch 0.90
+ + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.PrefixFilter b/dist/docs/ejs.html#.PrefixFilter new file mode 100644 index 0000000..2f35c76 --- /dev/null +++ b/dist/docs/ejs.html#.PrefixFilter @@ -0,0 +1,243 @@ + + + + + JSDoc: Class: PrefixFilter + + + + + + + + + + +
+ +

Class: PrefixFilter

+ + + + + + +
+ +
+ +

+ ejs. + + PrefixFilter +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new PrefixFilter(fieldName, prefix)

+ + + + + +
+ Filters documents that have fields containing terms with a specified prefix. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
fieldName + + +String + + + + the field name to be used during matching.
prefix + + +String + + + + the prefix value.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.PrefixQuery b/dist/docs/ejs.html#.PrefixQuery new file mode 100644 index 0000000..3231eae --- /dev/null +++ b/dist/docs/ejs.html#.PrefixQuery @@ -0,0 +1,243 @@ + + + + + JSDoc: Class: PrefixQuery + + + + + + + + + + +
+ +

Class: PrefixQuery

+ + + + + + +
+ +
+ +

+ ejs. + + PrefixQuery +

+ +

Matches documents that have fields containing terms with a specified + prefix (not analyzed). The prefix query maps to Lucene PrefixQuery.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new PrefixQuery(field, value)

+ + + + + +
+ Matches documents containing the specified un-analyzed prefix. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +String + + + + A valid field name.
value + + +String + + + + A string prefix.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.QueryFacet b/dist/docs/ejs.html#.QueryFacet new file mode 100644 index 0000000..a35b079 --- /dev/null +++ b/dist/docs/ejs.html#.QueryFacet @@ -0,0 +1,236 @@ + + + + + JSDoc: Class: QueryFacet + + + + + + + + + + +
+ +

Class: QueryFacet

+ + + + + + +
+ +
+ +

+ ejs. + + QueryFacet +

+ +

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

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

Constructor

+ + +

new QueryFacet(name)

+ + + + + +
+

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

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
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.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.QueryFilter b/dist/docs/ejs.html#.QueryFilter new file mode 100644 index 0000000..b6a7ea4 --- /dev/null +++ b/dist/docs/ejs.html#.QueryFilter @@ -0,0 +1,227 @@ + + + + + JSDoc: Class: QueryFilter + + + + + + + + + + +
+ +

Class: QueryFilter

+ + + + + + +
+ +
+ +

+ ejs. + + QueryFilter +

+ +

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

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new QueryFilter(qry)

+ + + + + +
+ Filters documents matching the wrapped query. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
qry + + +Object + + + + A valid query object.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.QueryMixin b/dist/docs/ejs.html#.QueryMixin new file mode 100644 index 0000000..cbea7c3 --- /dev/null +++ b/dist/docs/ejs.html#.QueryMixin @@ -0,0 +1,132 @@ + + + + + JSDoc: Mixin: QueryMixin + + + + + + + + + + +
+ +

Mixin: QueryMixin

+ + + + + + +
+ +
+ +

+ ejs. + + QueryMixin +

+ + +
+ +
+
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.QueryStringQuery b/dist/docs/ejs.html#.QueryStringQuery new file mode 100644 index 0000000..536bf2f --- /dev/null +++ b/dist/docs/ejs.html#.QueryStringQuery @@ -0,0 +1,224 @@ + + + + + JSDoc: Class: QueryStringQuery + + + + + + + + + + +
+ +

Class: QueryStringQuery

+ + + + + + +
+ +
+ +

+ ejs. + + QueryStringQuery +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new QueryStringQuery(qstr)

+ + + + + +
+ A query that is parsed using Lucene's default query parser. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
qstr + + +String + + + + A valid Lucene query string.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.RandomScoreFunction b/dist/docs/ejs.html#.RandomScoreFunction new file mode 100644 index 0000000..d064934 --- /dev/null +++ b/dist/docs/ejs.html#.RandomScoreFunction @@ -0,0 +1,171 @@ + + + + + JSDoc: Class: RandomScoreFunction + + + + + + + + + + +
+ +

Class: RandomScoreFunction

+ + + + + + +
+ +
+ +

+ ejs. + + RandomScoreFunction +

+ +

The random_score generates scores via a pseudo random number algorithm + that is initialized with a seed.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new RandomScoreFunction()

+ + + + + +
+

Randomly score documents.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.RangeAggregation b/dist/docs/ejs.html#.RangeAggregation new file mode 100644 index 0000000..adff12d --- /dev/null +++ b/dist/docs/ejs.html#.RangeAggregation @@ -0,0 +1,226 @@ + + + + + JSDoc: Class: RangeAggregation + + + + + + + + + + +
+ +

Class: RangeAggregation

+ + + + + + +
+ +
+ +

+ ejs. + + RangeAggregation +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new RangeAggregation(name)

+ + + + + +
+

Aggregation that enables the user to define a set of ranges that each + represent a bucket.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +String + + + + The name which be used to refer to this aggregation.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.RangeFacet b/dist/docs/ejs.html#.RangeFacet new file mode 100644 index 0000000..1866172 --- /dev/null +++ b/dist/docs/ejs.html#.RangeFacet @@ -0,0 +1,236 @@ + + + + + JSDoc: Class: RangeFacet + + + + + + + + + + +
+ +

Class: RangeFacet

+ + + + + + +
+ +
+ +

+ ejs. + + RangeFacet +

+ +

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

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

Constructor

+ + +

new RangeFacet(name)

+ + + + + +
+

A facet which provides information over a range of numeric intervals.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
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.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.RangeFilter b/dist/docs/ejs.html#.RangeFilter new file mode 100644 index 0000000..6a49824 --- /dev/null +++ b/dist/docs/ejs.html#.RangeFilter @@ -0,0 +1,219 @@ + + + + + JSDoc: Class: RangeFilter + + + + + + + + + + +
+ +

Class: RangeFilter

+ + + + + + +
+ +
+ +

+ ejs. + + RangeFilter +

+ +

Matches documents with fields that have terms within a certain range.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new RangeFilter(field)

+ + + + + +
+ Filters documents with fields that have terms within a certain range. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +String + + + + A valid field name.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.RangeQuery b/dist/docs/ejs.html#.RangeQuery new file mode 100644 index 0000000..996f762 --- /dev/null +++ b/dist/docs/ejs.html#.RangeQuery @@ -0,0 +1,222 @@ + + + + + JSDoc: Class: RangeQuery + + + + + + + + + + +
+ +

Class: RangeQuery

+ + + + + + +
+ +
+ +

+ ejs. + + RangeQuery +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new RangeQuery(field)

+ + + + + +
+ Matches documents with fields that have terms within a certain range. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +String + + + + A valid field name.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.RegexpFilter b/dist/docs/ejs.html#.RegexpFilter new file mode 100644 index 0000000..1a31db0 --- /dev/null +++ b/dist/docs/ejs.html#.RegexpFilter @@ -0,0 +1,244 @@ + + + + + JSDoc: Class: RegexpFilter + + + + + + + + + + +
+ +

Class: RegexpFilter

+ + + + + + +
+ +
+ +

+ ejs. + + RegexpFilter +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new RegexpFilter(field, value)

+ + + + + +
+ Matches documents that have fields matching a regular expression. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +String + + + + A valid field name.
value + + +String + + + + A regex pattern.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.RegexpQuery b/dist/docs/ejs.html#.RegexpQuery new file mode 100644 index 0000000..0536d6b --- /dev/null +++ b/dist/docs/ejs.html#.RegexpQuery @@ -0,0 +1,244 @@ + + + + + JSDoc: Class: RegexpQuery + + + + + + + + + + +
+ +

Class: RegexpQuery

+ + + + + + +
+ +
+ +

+ ejs. + + RegexpQuery +

+ +

Matches documents that have fields matching a regular expression. Based + on Lucene 4.0 RegexpQuery which uses automaton to efficiently iterate over + index terms.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new RegexpQuery(field, value)

+ + + + + +
+ Matches documents that have fields matching a regular expression. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +String + + + + A valid field name.
value + + +String + + + + A regex pattern.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.Request b/dist/docs/ejs.html#.Request new file mode 100644 index 0000000..b68dd1d --- /dev/null +++ b/dist/docs/ejs.html#.Request @@ -0,0 +1,223 @@ + + + + + JSDoc: Class: Request + + + + + + + + + + +
+ +

Class: Request

+ + + + + + +
+ +
+ +

+ ejs. + + Request +

+ +

The Request object provides methods generating an elasticsearch request body.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new Request(conf)

+ + + + + +
+

Provides methods for generating request bodies.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
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
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.Rescore b/dist/docs/ejs.html#.Rescore new file mode 100644 index 0000000..7833cf1 --- /dev/null +++ b/dist/docs/ejs.html#.Rescore @@ -0,0 +1,242 @@ + + + + + JSDoc: Class: Rescore + + + + + + + + + + +
+ +

Class: Rescore

+ + + + + + +
+ +
+ +

+ ejs. + + Rescore +

+ +

A method that allows to rescore queries with a typically more expensive.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new Rescore(windowSize, windowSize)

+ + + + + +
+

Defines an operation that rescores a query with another query.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
windowSize + + +Number + + + + The optional number of documents to reorder per shard.
windowSize + + +Query + + + + The optional query to use for rescoring.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.ScoreFunctionMixin b/dist/docs/ejs.html#.ScoreFunctionMixin new file mode 100644 index 0000000..0e23985 --- /dev/null +++ b/dist/docs/ejs.html#.ScoreFunctionMixin @@ -0,0 +1,132 @@ + + + + + JSDoc: Mixin: ScoreFunctionMixin + + + + + + + + + + +
+ +

Mixin: ScoreFunctionMixin

+ + + + + + +
+ +
+ +

+ ejs. + + ScoreFunctionMixin +

+ + +
+ +
+
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:10 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.ScriptField b/dist/docs/ejs.html#.ScriptField new file mode 100644 index 0000000..1cb36dd --- /dev/null +++ b/dist/docs/ejs.html#.ScriptField @@ -0,0 +1,223 @@ + + + + + JSDoc: Class: ScriptField + + + + + + + + + + +
+ +

Class: ScriptField

+ + + + + + +
+ +
+ +

+ ejs. + + ScriptField +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new ScriptField(fieldName)

+ + + + + +
+

Computes dynamic document properties based on information from other fields.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
fieldName + + +String + + + + A name of the script field to create.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:11 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.ScriptFilter b/dist/docs/ejs.html#.ScriptFilter new file mode 100644 index 0000000..2391f2e --- /dev/null +++ b/dist/docs/ejs.html#.ScriptFilter @@ -0,0 +1,219 @@ + + + + + JSDoc: Class: ScriptFilter + + + + + + + + + + +
+ +

Class: ScriptFilter

+ + + + + + +
+ +
+ +

+ ejs. + + ScriptFilter +

+ +

A filter allowing to define scripts as filters

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new ScriptFilter(script)

+ + + + + +
+ A filter allowing to define scripts as filters. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
script + + +String + + + + The script as a string.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:11 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.ScriptScoreFunction b/dist/docs/ejs.html#.ScriptScoreFunction new file mode 100644 index 0000000..040e6f9 --- /dev/null +++ b/dist/docs/ejs.html#.ScriptScoreFunction @@ -0,0 +1,172 @@ + + + + + JSDoc: Class: ScriptScoreFunction + + + + + + + + + + +
+ +

Class: ScriptScoreFunction

+ + + + + + +
+ +
+ +

+ ejs. + + ScriptScoreFunction +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new ScriptScoreFunction()

+ + + + + +
+

Modify a documents score using a script.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:11 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.ScriptedMetricAggregation b/dist/docs/ejs.html#.ScriptedMetricAggregation new file mode 100644 index 0000000..211718a --- /dev/null +++ b/dist/docs/ejs.html#.ScriptedMetricAggregation @@ -0,0 +1,220 @@ + + + + + JSDoc: Class: ScriptedMetricAggregation + + + + + + + + + + +
+ +

Class: ScriptedMetricAggregation

+ + + + + + +
+ +
+ +

+ ejs. + + ScriptedMetricAggregation +

+ +

A metric aggregation that executes using scripts to provide a metric output.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new ScriptedMetricAggregation(name)

+ + + + + +
+

Aggregation that keeps track and returns the minimum value among numeric + values extracted from the aggregated documents.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +String + + + + The name which be used to refer to this aggregation.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:11 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.Shape b/dist/docs/ejs.html#.Shape new file mode 100644 index 0000000..49b4eb3 --- /dev/null +++ b/dist/docs/ejs.html#.Shape @@ -0,0 +1,245 @@ + + + + + JSDoc: Class: Shape + + + + + + + + + + +
+ +

Class: Shape

+ + + + + + +
+ +
+ +

+ ejs. + + Shape +

+ +

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/

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new Shape(type, coords)

+ + + + + +
+

Defines a shape

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
type + + +String + + + + A valid shape type.
coords + + +Array + + + + An valid coordinat definition for the given shape.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:11 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.SignificantTermsAggregation b/dist/docs/ejs.html#.SignificantTermsAggregation new file mode 100644 index 0000000..06b2f67 --- /dev/null +++ b/dist/docs/ejs.html#.SignificantTermsAggregation @@ -0,0 +1,221 @@ + + + + + JSDoc: Class: SignificantTermsAggregation + + + + + + + + + + +
+ +

Class: SignificantTermsAggregation

+ + + + + + +
+ +
+ +

+ ejs. + + SignificantTermsAggregation +

+ +

An aggregation that returns interesting or unusual occurrences of terms in + a set.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new SignificantTermsAggregation(name)

+ + + + + +
+

An aggregation that returns interesting or unusual occurrences of terms in + a set.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +String + + + + The name which be used to refer to this aggregation.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:11 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.Sort b/dist/docs/ejs.html#.Sort new file mode 100644 index 0000000..ab7e789 --- /dev/null +++ b/dist/docs/ejs.html#.Sort @@ -0,0 +1,223 @@ + + + + + JSDoc: Class: Sort + + + + + + + + + + +
+ +

Class: Sort

+ + + + + + +
+ +
+ +

+ ejs. + + Sort +

+ +

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

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new Sort(fieldName)

+ + + + + +
+

Defines a sort value

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
fieldName + + +String + + + + The fieldName to sort against. Defaults to _score + if not specified.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:11 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.SpanFirstQuery b/dist/docs/ejs.html#.SpanFirstQuery new file mode 100644 index 0000000..6c4c18b --- /dev/null +++ b/dist/docs/ejs.html#.SpanFirstQuery @@ -0,0 +1,244 @@ + + + + + JSDoc: Class: SpanFirstQuery + + + + + + + + + + +
+ +

Class: SpanFirstQuery

+ + + + + + +
+ +
+ +

+ ejs. + + SpanFirstQuery +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new SpanFirstQuery(spanQry, end)

+ + + + + +
+ Matches spans near the beginning of a field. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
spanQry + + +Query + + + + A valid SpanQuery
end + + +Integer + + + + the maximum end position in a match.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:11 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.SpanMultiTermQuery b/dist/docs/ejs.html#.SpanMultiTermQuery new file mode 100644 index 0000000..e337d9e --- /dev/null +++ b/dist/docs/ejs.html#.SpanMultiTermQuery @@ -0,0 +1,221 @@ + + + + + JSDoc: Class: SpanMultiTermQuery + + + + + + + + + + +
+ +

Class: SpanMultiTermQuery

+ + + + + + +
+ +
+ +

+ ejs. + + SpanMultiTermQuery +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new SpanMultiTermQuery(qry)

+ + + + + +
+ Use MultiTermQueries as a SpanQuery. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
qry + + +Query + + + + An optional multi-term query object.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:11 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.SpanNearQuery b/dist/docs/ejs.html#.SpanNearQuery new file mode 100644 index 0000000..f3dc586 --- /dev/null +++ b/dist/docs/ejs.html#.SpanNearQuery @@ -0,0 +1,246 @@ + + + + + JSDoc: Class: SpanNearQuery + + + + + + + + + + +
+ +

Class: SpanNearQuery

+ + + + + + +
+ +
+ +

+ ejs. + + SpanNearQuery +

+ +

A spanNearQuery will look to find a number of spanQuerys within a given + distance from each other.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new SpanNearQuery(clauses, slop)

+ + + + + +
+ Matches spans which are near one another. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
clauses + + +Query +| + +Array.<Query> + + + + A single SpanQuery or array of SpanQueries
slop + + +Integer + + + + The number of intervening unmatched positions
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:11 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.SpanNotQuery b/dist/docs/ejs.html#.SpanNotQuery new file mode 100644 index 0000000..a7567f1 --- /dev/null +++ b/dist/docs/ejs.html#.SpanNotQuery @@ -0,0 +1,243 @@ + + + + + JSDoc: Class: SpanNotQuery + + + + + + + + + + +
+ +

Class: SpanNotQuery

+ + + + + + +
+ +
+ +

+ ejs. + + SpanNotQuery +

+ +

Removes matches which overlap with another span query. + The span not query maps to Lucene SpanNotQuery.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new SpanNotQuery(includeQry, excludeQry)

+ + + + + +
+ Removes matches which overlap with another span query. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
includeQry + + +Query + + + + a valid SpanQuery whose matching docs will be returned.
excludeQry + + +Query + + + + a valid SpanQuery whose matching docs will not be returned
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:11 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.SpanOrQuery b/dist/docs/ejs.html#.SpanOrQuery new file mode 100644 index 0000000..ec17393 --- /dev/null +++ b/dist/docs/ejs.html#.SpanOrQuery @@ -0,0 +1,220 @@ + + + + + JSDoc: Class: SpanOrQuery + + + + + + + + + + +
+ +

Class: SpanOrQuery

+ + + + + + +
+ +
+ +

+ ejs. + + SpanOrQuery +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new SpanOrQuery(clauses)

+ + + + + +
+ Matches the union of its span clauses. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
clauses + + +Object + + + + A single SpanQuery or array of SpanQueries.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:11 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.SpanTermQuery b/dist/docs/ejs.html#.SpanTermQuery new file mode 100644 index 0000000..e9bdd5a --- /dev/null +++ b/dist/docs/ejs.html#.SpanTermQuery @@ -0,0 +1,244 @@ + + + + + JSDoc: Class: SpanTermQuery + + + + + + + + + + +
+ +

Class: SpanTermQuery

+ + + + + + +
+ +
+ +

+ ejs. + + SpanTermQuery +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new SpanTermQuery(field, value)

+ + + + + +
+ Matches spans containing a term +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +String + + + + the document field/field to query against
value + + +String + + + + the literal value to be matched
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:11 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.StatisticalFacet b/dist/docs/ejs.html#.StatisticalFacet new file mode 100644 index 0000000..7e7dd04 --- /dev/null +++ b/dist/docs/ejs.html#.StatisticalFacet @@ -0,0 +1,236 @@ + + + + + JSDoc: Class: StatisticalFacet + + + + + + + + + + +
+ +

Class: StatisticalFacet

+ + + + + + +
+ +
+ +

+ ejs. + + StatisticalFacet +

+ +

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

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

Constructor

+ + +

new StatisticalFacet(name)

+ + + + + +
+

A facet which returns statistical information about a numeric field

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
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.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:11 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.SuggestContextMixin b/dist/docs/ejs.html#.SuggestContextMixin new file mode 100644 index 0000000..c5f68d7 --- /dev/null +++ b/dist/docs/ejs.html#.SuggestContextMixin @@ -0,0 +1,132 @@ + + + + + JSDoc: Mixin: SuggestContextMixin + + + + + + + + + + +
+ +

Mixin: SuggestContextMixin

+ + + + + + +
+ +
+ +

+ ejs. + + SuggestContextMixin +

+ + +
+ +
+
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:11 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.SuggesterMixin b/dist/docs/ejs.html#.SuggesterMixin new file mode 100644 index 0000000..d2b5b3d --- /dev/null +++ b/dist/docs/ejs.html#.SuggesterMixin @@ -0,0 +1,132 @@ + + + + + JSDoc: Mixin: SuggesterMixin + + + + + + + + + + +
+ +

Mixin: SuggesterMixin

+ + + + + + +
+ +
+ +

+ ejs. + + SuggesterMixin +

+ + +
+ +
+
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:11 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.TermFilter b/dist/docs/ejs.html#.TermFilter new file mode 100644 index 0000000..d8f34e4 --- /dev/null +++ b/dist/docs/ejs.html#.TermFilter @@ -0,0 +1,244 @@ + + + + + JSDoc: Class: TermFilter + + + + + + + + + + +
+ +

Class: TermFilter

+ + + + + + +
+ +
+ +

+ ejs. + + TermFilter +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new TermFilter(fieldName, term)

+ + + + + +
+ Constructs a filter for docs matching the term added to this object. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
fieldName + + +string + + + + The document field/fieldName to execute the filter against.
term + + +string + + + + The literal term used to filter the results.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:11 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.TermQuery b/dist/docs/ejs.html#.TermQuery new file mode 100644 index 0000000..a7d4474 --- /dev/null +++ b/dist/docs/ejs.html#.TermQuery @@ -0,0 +1,246 @@ + + + + + JSDoc: Class: TermQuery + + + + + + + + + + +
+ +

Class: TermQuery

+ + + + + + +
+ +
+ +

+ ejs. + + TermQuery +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new TermQuery(field, term)

+ + + + + +
+ A Query that matches documents containing a term. This may be + combined with other terms with a BooleanQuery. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +String + + + + the document field/key to query against
term + + +String + + + + the literal value to be matched
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:11 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.TermStatsFacet b/dist/docs/ejs.html#.TermStatsFacet new file mode 100644 index 0000000..a1fcdbe --- /dev/null +++ b/dist/docs/ejs.html#.TermStatsFacet @@ -0,0 +1,236 @@ + + + + + JSDoc: Class: TermStatsFacet + + + + + + + + + + +
+ +

Class: TermStatsFacet

+ + + + + + +
+ +
+ +

+ ejs. + + TermStatsFacet +

+ +

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

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

Constructor

+ + +

new TermStatsFacet(name)

+ + + + + +
+

A facet which computes statistical data based on an aggregate key.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
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.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:11 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.TermsAggregation b/dist/docs/ejs.html#.TermsAggregation new file mode 100644 index 0000000..b5511f2 --- /dev/null +++ b/dist/docs/ejs.html#.TermsAggregation @@ -0,0 +1,220 @@ + + + + + JSDoc: Class: TermsAggregation + + + + + + + + + + +
+ +

Class: TermsAggregation

+ + + + + + +
+ +
+ +

+ ejs. + + TermsAggregation +

+ +

A multi-bucket value source based aggregation where buckets are dynamically + built - one per unique value.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new TermsAggregation(name)

+ + + + + +
+

Defines an aggregation of unique values/terms.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +String + + + + The name which be used to refer to this aggregation.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:11 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.TermsFacet b/dist/docs/ejs.html#.TermsFacet new file mode 100644 index 0000000..13efd37 --- /dev/null +++ b/dist/docs/ejs.html#.TermsFacet @@ -0,0 +1,233 @@ + + + + + JSDoc: Class: TermsFacet + + + + + + + + + + +
+ +

Class: TermsFacet

+ + + + + + +
+ +
+ +

+ ejs. + + TermsFacet +

+ +

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

+ +
+
+ + + + +

Constructor

+ + +

new TermsFacet(name)

+ + + + + +
+

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

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
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.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:11 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.TermsFilter b/dist/docs/ejs.html#.TermsFilter new file mode 100644 index 0000000..6ae9c06 --- /dev/null +++ b/dist/docs/ejs.html#.TermsFilter @@ -0,0 +1,246 @@ + + + + + JSDoc: Class: TermsFilter + + + + + + + + + + +
+ +

Class: TermsFilter

+ + + + + + +
+ +
+ +

+ ejs. + + TermsFilter +

+ +

Filters documents that have fields that match any of the provided + terms (not analyzed)

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new TermsFilter(field, terms)

+ + + + + +
+ A Filter that matches documents containing provided terms. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +String + + + + the document field/key to filter against
terms + + +String +| + +Array.<String> + + + + a single term or an array of terms.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:11 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.TermsQuery b/dist/docs/ejs.html#.TermsQuery new file mode 100644 index 0000000..dbb48a3 --- /dev/null +++ b/dist/docs/ejs.html#.TermsQuery @@ -0,0 +1,247 @@ + + + + + JSDoc: Class: TermsQuery + + + + + + + + + + +
+ +

Class: TermsQuery

+ + + + + + +
+ +
+ +

+ ejs. + + TermsQuery +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new TermsQuery(field, terms)

+ + + + + +
+ A Query that matches documents containing provided terms. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +String + + + + the document field/key to query against
terms + + +String +| + +Array.<String> + + + + a single term or array of "terms" to match
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:11 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.TopChildrenQuery b/dist/docs/ejs.html#.TopChildrenQuery new file mode 100644 index 0000000..af09f6c --- /dev/null +++ b/dist/docs/ejs.html#.TopChildrenQuery @@ -0,0 +1,248 @@ + + + + + JSDoc: Class: TopChildrenQuery + + + + + + + + + + +
+ +

Class: TopChildrenQuery

+ + + + + + +
+ +
+ +

+ ejs. + + TopChildrenQuery +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new TopChildrenQuery(qry, type)

+ + + + + +
+ Returns child documents matching the query aggregated into the parent docs. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
qry + + +Object + + + + A valid query object.
type + + +String + + + + The child type to execute the query on
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:11 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.TopHitsAggregation b/dist/docs/ejs.html#.TopHitsAggregation new file mode 100644 index 0000000..b5cbae3 --- /dev/null +++ b/dist/docs/ejs.html#.TopHitsAggregation @@ -0,0 +1,222 @@ + + + + + JSDoc: Class: TopHitsAggregation + + + + + + + + + + +
+ +

Class: TopHitsAggregation

+ + + + + + +
+ +
+ +

+ ejs. + + TopHitsAggregation +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new TopHitsAggregation(name)

+ + + + + +
+

top_hits metric aggregator keeps track of the most relevant document being + aggregated.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +String + + + + The name which be used to refer to this aggregation.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:11 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.TypeFilter b/dist/docs/ejs.html#.TypeFilter new file mode 100644 index 0000000..b6cc121 --- /dev/null +++ b/dist/docs/ejs.html#.TypeFilter @@ -0,0 +1,219 @@ + + + + + JSDoc: Class: TypeFilter + + + + + + + + + + +
+ +

Class: TypeFilter

+ + + + + + +
+ +
+ +

+ ejs. + + TypeFilter +

+ +

A Filter that filters results by a specified index type.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new TypeFilter(type)

+ + + + + +
+ Filter results by a specified index type. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
type + + +String + + + + the index type to filter on.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:11 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/ejs.html#.WildcardQuery b/dist/docs/ejs.html#.WildcardQuery new file mode 100644 index 0000000..6b65aba --- /dev/null +++ b/dist/docs/ejs.html#.WildcardQuery @@ -0,0 +1,249 @@ + + + + + JSDoc: Class: WildcardQuery + + + + + + + + + + +
+ +

Class: WildcardQuery

+ + + + + + +
+ +
+ +

+ ejs. + + WildcardQuery +

+ +

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.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new WildcardQuery(field, value)

+ + + + + +
+ A Query that matches documents containing a wildcard. This may be + combined with other wildcards with a BooleanQuery. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +String + + + + the document field/key to query against
value + + +String + + + + the literal value to be matched
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:11 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file diff --git a/dist/docs/elastic.js.html b/dist/docs/elastic.js.html new file mode 100644 index 0000000..2eb0ed3 --- /dev/null +++ b/dist/docs/elastic.js.html @@ -0,0 +1,18220 @@ + + + + + JSDoc: Source: elastic.js + + + + + + + + + + +
+ +

Source: elastic.js

+ + + + + + +
+
+
/*! elastic.js - v1.3.3 - 2015-08-04
+ * https://github.com/fullscale/elastic.js
+ * Copyright (c) 2015 FullScale Labs, LLC; Licensed MIT */
+
+/**
+ @namespace
+ @name ejs
+ @desc All elastic.js modules are organized under the ejs namespace.
+ */
+(function () {
+  'use strict';
+
+  var
+
+    // save reference to global object
+    // `window` in browser
+    // `exports` on server
+    root = this,
+
+    // save the previous version of ejs
+    _ejs = root && root.ejs,
+
+    // from underscore.js, used in utils
+    ArrayProto = Array.prototype,
+    ObjProto = Object.prototype,
+    slice = ArrayProto.slice,
+    toString = ObjProto.toString,
+    hasOwnProp = ObjProto.hasOwnProperty,
+    nativeForEach = ArrayProto.forEach,
+    nativeIsArray = Array.isArray,
+    nativeIndexOf = ArrayProto.indexOf,
+    breaker = {},
+    has,
+    each,
+    extend,
+    indexOf,
+    isArray,
+    isObject,
+    isString,
+    isNumber,
+    isBoolean,
+    isFunction,
+    isEJSObject, // checks if valid ejs object
+    isQuery, // checks valid ejs Query object
+    isRescore, // checks valid ejs Rescore object
+    isFilter, // checks valid ejs Filter object
+    isFacet, // checks valid ejs Facet object
+    isAggregation, // checks valid ejs Aggregation object
+    isScriptField, // checks valid ejs ScriptField object
+    isGeoPoint, // checks valid ejs GeoPoint object
+    isIndexedShape, // checks valid ejs IndexedShape object
+    isShape, // checks valid ejs Shape object
+    isSort, // checks valid ejs Sort object
+    isHighlight, // checks valid ejs Highlight object
+    isSuggest, // checks valid ejs Suggest object
+    isGenerator, // checks valid ejs Generator object
+    isScoreFunction, // checks valid ejs ScoreFunction object
+
+    // create ejs object
+    ejs;
+
+  if (typeof exports !== 'undefined') {
+    ejs = exports;
+  } else {
+    ejs = root.ejs = {};
+  }
+
+  /* Utility methods, most of which are pulled from underscore.js. */
+
+  // Shortcut function for checking if an object has a given property directly
+  // on itself (in other words, not on a prototype).
+  has = function (obj, key) {
+    return hasOwnProp.call(obj, key);
+  };
+
+  // The cornerstone, an `each` implementation, aka `forEach`.
+  // Handles objects with the built-in `forEach`, arrays, and raw objects.
+  // Delegates to **ECMAScript 5**'s native `forEach` if available.
+  each = function (obj, iterator, context) {
+    if (obj == null) {
+      return;
+    }
+    if (nativeForEach && obj.forEach === nativeForEach) {
+      obj.forEach(iterator, context);
+    } else if (obj.length === +obj.length) {
+      for (var i = 0, l = obj.length; i < l; i++) {
+        if (iterator.call(context, obj[i], i, obj) === breaker) {
+          return;
+        }
+      }
+    } else {
+      for (var key in obj) {
+        if (has(obj, key)) {
+          if (iterator.call(context, obj[key], key, obj) === breaker) {
+            return;
+          }
+        }
+      }
+    }
+  };
+
+  // Extend a given object with all the properties in passed-in object(s).
+  extend = function (obj) {
+    each(slice.call(arguments, 1), function (source) {
+      for (var prop in source) {
+        obj[prop] = source[prop];
+      }
+    });
+    return obj;
+  };
+
+  // Returns the index at which value can be found in the array, or -1 if
+  // value is not present in the array.
+  indexOf = function (array, item) {
+    if (array == null) {
+      return -1;
+    }
+
+    var i = 0, l = array.length;
+    if (nativeIndexOf && array.indexOf === nativeIndexOf) {
+      return array.indexOf(item);
+    }
+
+    for (; i < l; i++) {
+      if (array[i] === item) {
+        return i;
+
+      }
+    }
+
+    return -1;
+  };
+
+  // Is a given value an array?
+  // Delegates to ECMA5's native Array.isArray
+  // switched to ===, not sure why underscore used ==
+  isArray = nativeIsArray || function (obj) {
+    return toString.call(obj) === '[object Array]';
+  };
+
+  // Is a given variable an object?
+  isObject = function (obj) {
+    return obj === Object(obj);
+  };
+
+  // switched to ===, not sure why underscore used ==
+  isString = function (obj) {
+    return toString.call(obj) === '[object String]';
+  };
+
+  // switched to ===, not sure why underscore used ==
+  isNumber = function (obj) {
+    return toString.call(obj) === '[object Number]';
+  };
+
+  isBoolean = function(obj) {
+    return obj === true || obj === false || toString.call(obj) === '[object Boolean]';
+  };
+
+  // switched to ===, not sure why underscore used ==
+  if (typeof (/./) !== 'function') {
+    isFunction = function (obj) {
+      return typeof obj === 'function';
+    };
+  } else {
+    isFunction = function (obj) {
+      return toString.call(obj) === '[object Function]';
+    };
+  }
+
+  // Is a given value an ejs object?
+  // Yes if object and has "_type", "toJSON", and "toString" properties
+  isEJSObject = function (obj) {
+    return (isObject(obj) &&
+      has(obj, '_type') &&
+      has(obj, 'toJSON'));
+  };
+
+  isQuery = function (obj) {
+    return (isEJSObject(obj) && obj._type() === 'query');
+  };
+
+  isRescore = function (obj) {
+    return (isEJSObject(obj) && obj._type() === 'rescore');
+  };
+
+  isFilter = function (obj) {
+    return (isEJSObject(obj) && obj._type() === 'filter');
+  };
+
+  isFacet = function (obj) {
+    return (isEJSObject(obj) && obj._type() === 'facet');
+  };
+
+  isAggregation = function (obj) {
+    return (isEJSObject(obj) && obj._type() === 'aggregation');
+  };
+
+  isScriptField = function (obj) {
+    return (isEJSObject(obj) && obj._type() === 'script field');
+  };
+
+  isGeoPoint = function (obj) {
+    return (isEJSObject(obj) && obj._type() === 'geo point');
+  };
+
+  isIndexedShape = function (obj) {
+    return (isEJSObject(obj) && obj._type() === 'indexed shape');
+  };
+
+  isShape = function (obj) {
+    return (isEJSObject(obj) && obj._type() === 'shape');
+  };
+
+  isSort = function (obj) {
+    return (isEJSObject(obj) && obj._type() === 'sort');
+  };
+
+  isHighlight = function (obj) {
+    return (isEJSObject(obj) && obj._type() === 'highlight');
+  };
+
+  isSuggest = function (obj) {
+    return (isEJSObject(obj) && obj._type() === 'suggest');
+  };
+
+  isGenerator = function (obj) {
+    return (isEJSObject(obj) && obj._type() === 'generator');
+  };
+
+  isScoreFunction = function (obj) {
+    return (isEJSObject(obj) && obj._type() === 'score function');
+  };
+
+  /**
+    @mixin
+    <p>The AggregationMixin provides support for common options used across
+    various <code>Aggregation</code> implementations.  This object should not be
+    used directly.</p>
+
+    @name ejs.AggregationMixin
+    */
+  ejs.AggregationMixin = function (name) {
+
+    var aggs = {};
+    aggs[name] = {};
+
+    return {
+
+      /**
+      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.
+
+      @member ejs.AggregationMixin
+      @param {Aggregation} agg Any valid <code>Aggregation</code> object.
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      aggregation: function(agg) {
+        if (agg == null) {
+          return aggs[name].aggs;
+        }
+
+        if (aggs[name].aggs == null) {
+          aggs[name].aggs = {};
+        }
+
+        if (!isAggregation(agg)) {
+          throw new TypeError('Argument must be an Aggregation');
+        }
+
+        extend(aggs[name].aggs, agg.toJSON());
+
+        return this;
+      },
+
+      /**
+      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.
+
+      @member ejs.AggregationMixin
+      @param {Aggregation} agg Any valid <code>Aggregation</code> object.
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      agg: function(agg) {
+        return this.aggregation(agg);
+      },
+
+      /**
+            The type of ejs object.  For internal use only.
+
+            @member ejs.AggregationMixin
+            @returns {String} the type of object
+            */
+      _type: function () {
+        return 'aggregation';
+      },
+
+      /**
+            <p>Retrieves the internal <code>agg</code> object. This is typically used by
+               internal API functions so use with caution.</p>
+
+            @member ejs.AggregationMixin
+            @returns {String} returns this object's internal object.
+            */
+      toJSON: function () {
+        return aggs;
+      }
+
+    };
+  };
+
+  /**
+    @mixin
+    <p>The BucketsAggregationMixin provides support for common options used across
+    various buckets <code>Aggregation</code> implementations.  This object should
+    not be used directly.</p>
+
+    @name ejs.BucketsAggregationMixin
+    @ejs aggregation
+    @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, {
+
+      /**
+      <p>Sets the field to operate on.</p>
+
+      @member ejs.MetricsAggregationMixin
+      @param {String} field a valid field name..
+      @returns {Object} returns <code>this</code> 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.MetricsAggregationMixin
+      @param {String} scriptCode A valid script string to execute.
+      @returns {Object} returns <code>this</code> 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.MetricsAggregationMixin
+      @param {String} scriptId A valid script id to execute.
+      @returns {Object} returns <code>this</code> 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.MetricsAggregationMixin
+      @param {String} scriptFile A valid script file to execute.
+      @returns {Object} returns <code>this</code> 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.MetricsAggregationMixin
+      @param {String} language The language of the script.
+      @returns {Object} returns <code>this</code> 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.MetricsAggregationMixin
+      @param {Object} p An object where the keys are the parameter name and
+        values are the parameter value.
+      @returns {Object} returns <code>this</code> 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
+    <p>The DirectSettingsMixin provides support for common options used across 
+    various <code>Suggester</code> implementations.  This object should not be 
+    used directly.</p>
+
+    @name ejs.DirectSettingsMixin
+  
+    @param {String} settings The object to set the options on.
+    */
+  ejs.DirectSettingsMixin = function (settings) {
+
+    return {
+        
+      /**
+            <p>Sets the accuracy.  How similar the suggested terms at least 
+            need to be compared to the original suggest text.</p>
+
+            @member ejs.DirectSettingsMixin
+            @param {Double} a A positive double value between 0 and 1.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      accuracy: function (a) {
+        if (a == null) {
+          return settings.accuracy;
+        }
+  
+        settings.accuracy = a;
+        return this;
+      },
+    
+      /**
+            <p>Sets the suggest mode.  Valid values are:</p>
+
+            <dl>
+              <dd><code>missing</code> - Only suggest terms in the suggest text that aren't in the index</dd>
+              <dd><code>popular</code> - Only suggest suggestions that occur in more docs then the original suggest text term</dd>
+              <dd><code>always</code> - Suggest any matching suggestions based on terms in the suggest text</dd> 
+            </dl>
+
+            @member ejs.DirectSettingsMixin
+            @param {String} m The mode of missing, popular, or always.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      suggestMode: function (m) {
+        if (m == null) {
+          return settings.suggest_mode;
+        }
+  
+        m = m.toLowerCase();
+        if (m === 'missing' || m === 'popular' || m === 'always') {
+          settings.suggest_mode = m;
+        }
+      
+        return this;
+      },
+    
+      /**
+            <p>Sets the sort mode.  Valid values are:</p>
+
+            <dl>
+              <dd><code>score</code> - Sort by score first, then document frequency, and then the term itself</dd>
+              <dd><code>frequency</code> - Sort by document frequency first, then simlarity score and then the term itself</dd>
+            </dl>
+
+            @member ejs.DirectSettingsMixin
+            @param {String} s The score type of score or frequency.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      sort: function (s) {
+        if (s == null) {
+          return settings.sort;
+        }
+  
+        s = s.toLowerCase();
+        if (s === 'score' || s === 'frequency') {
+          settings.sort = s;
+        }
+      
+        return this;
+      },
+    
+      /**
+            <p>Sets what string distance implementation to use for comparing 
+            how similar suggested terms are.  Valid values are:</p>
+
+            <dl>
+              <dd><code>internal</code> - based on damerau_levenshtein but but highly optimized for comparing string distance for terms inside the index</dd>
+              <dd><code>damerau_levenshtein</code> - String distance algorithm based on Damerau-Levenshtein algorithm</dd>
+              <dd><code>levenstein</code> - String distance algorithm based on Levenstein edit distance algorithm</dd>
+              <dd><code>jarowinkler</code> - String distance algorithm based on Jaro-Winkler algorithm</dd>
+              <dd><code>ngram</code> - String distance algorithm based on character n-grams</dd>
+            </dl>
+
+            @member ejs.DirectSettingsMixin
+            @param {String} s The string distance algorithm name.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      stringDistance: function (s) {
+        if (s == null) {
+          return settings.string_distance;
+        }
+  
+        s = s.toLowerCase();
+        if (s === 'internal' || s === 'damerau_levenshtein' || 
+            s === 'levenstein' || s === 'jarowinkler' || s === 'ngram') {
+          settings.string_distance = s;
+        }
+      
+        return this;
+      },
+    
+      /**
+            <p>Sets the maximum edit distance candidate suggestions can have 
+            in order to be considered as a suggestion.</p>
+
+            @member ejs.DirectSettingsMixin
+            @param {Integer} max An integer value greater than 0.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      maxEdits: function (max) {
+        if (max == null) {
+          return settings.max_edits;
+        }
+  
+        settings.max_edits = max;
+        return this;
+      },
+    
+      /**
+            <p>The factor that is used to multiply with the size in order 
+            to inspect more candidate suggestions.</p>
+
+            @member ejs.DirectSettingsMixin
+            @param {Integer} max A positive integer value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      maxInspections: function (max) {
+        if (max == null) {
+          return settings.max_inspections;
+        }
+  
+        settings.max_inspections = max;
+        return this;
+      },
+    
+      /**
+            <p>Sets a maximum threshold in number of documents a suggest text 
+            token can exist in order to be corrected.</p>
+
+            @member ejs.DirectSettingsMixin
+            @param {Double} max A positive double value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      maxTermFreq: function (max) {
+        if (max == null) {
+          return settings.max_term_freq;
+        }
+  
+        settings.max_term_freq = max;
+        return this;
+      },
+    
+      /**
+            <p>Sets the number of minimal prefix characters that must match in 
+            order be a candidate suggestion.</p>
+
+            @member ejs.DirectSettingsMixin
+            @param {Integer} len A positive integer value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      prefixLen: function (len) {
+        if (len == null) {
+          return settings.prefix_len;
+        }
+  
+        settings.prefix_len = len;
+        return this;
+      },
+    
+      /**
+            <p>Sets the minimum length a suggest text term must have in order 
+            to be corrected.</p>
+
+            @member ejs.DirectSettingsMixin
+            @param {Integer} len A positive integer value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      minWordLen: function (len) {
+        if (len == null) {
+          return settings.min_word_len;
+        }
+  
+        settings.min_word_len = len;
+        return this;
+      },
+    
+      /**
+            <p>Sets a minimal threshold of the number of documents a suggested 
+            term should appear in.</p>
+
+            @member ejs.DirectSettingsMixin
+            @param {Double} min A positive double value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      minDocFreq: function (min) {
+        if (min == null) {
+          return settings.min_doc_freq;
+        }
+  
+        settings.min_doc_freq = min;
+        return this;
+      }
+      
+    };
+  };
+
+  /**
+    @mixin
+    <p>The FacetMixin provides support for common options used across 
+    various <code>Facet</code> implementations.  This object should not be 
+    used directly.</p>
+
+    @name ejs.FacetMixin
+    */
+  ejs.FacetMixin = function (name) {
+
+    var facet = {};
+    facet[name] = {};
+    
+    return {
+    
+      /**
+            <p>Allows you to reduce the documents used for computing facet results.</p>
+
+            @member ejs.FacetMixin
+            @param {Object} oFilter A valid <code>Filter</code> object.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      facetFilter: function (oFilter) {
+        if (oFilter == null) {
+          return facet[name].facet_filter;
+        }
+      
+        if (!isFilter(oFilter)) {
+          throw new TypeError('Argument must be a Filter');
+        }
+        
+        facet[name].facet_filter = oFilter.toJSON();
+        return this;
+      },
+
+      /**
+            <p>Computes values across the entire index</p>
+
+            @member ejs.FacetMixin
+            @param {Boolean} trueFalse Calculate facet counts globally or not.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      global: function (trueFalse) {
+        if (trueFalse == null) {
+          return facet[name].global;
+        }
+        
+        facet[name].global = trueFalse;
+        return this;
+      },
+      
+      /**
+            <p>Sets the mode the facet will use.<p>
+            
+            <dl>
+                <dd><code>collector</code></dd>
+                <dd><code>post</code></dd>
+            <dl>
+            
+            @member ejs.FacetMixin
+            @param {String} m The mode: collector or post.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      mode: function (m) {
+        if (m == null) {
+          return facet[name].mode;
+        }
+      
+        m = m.toLowerCase();
+        if (m === 'collector' || m === 'post') {
+          facet[name].mode = m;
+        }
+        
+        return this;
+      },
+      
+      /**
+            <p>Enables caching of the <code>facetFilter</code></p>
+
+            @member ejs.FacetMixin
+            @param {Boolean} trueFalse If the facetFilter should be cached or not
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      cacheFilter: function (trueFalse) {
+        if (trueFalse == null) {
+          return facet[name].cache_filter;
+        }
+        
+        facet[name].cache_filter = trueFalse;
+        return this;
+      },
+      
+      /**
+            <p>Computes values across the the specified scope</p>
+
+            @deprecated since elasticsearch 0.90
+            @member ejs.FacetMixin
+            @param {String} scope The scope name to calculate facet counts with.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      scope: function (scope) {
+        return this;
+      },
+      
+      /**
+            <p>Sets the path to the nested document if faceting against a
+            nested field.</p>
+
+            @member ejs.FacetMixin
+            @param {String} path The nested path
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      nested: function (path) {
+        if (path == null) {
+          return facet[name].nested;
+        }
+        
+        facet[name].nested = path;
+        return this;
+      },
+
+      /**
+            The type of ejs object.  For internal use only.
+            
+            @member ejs.FacetMixin
+            @returns {String} the type of object
+            */
+      _type: function () {
+        return 'facet';
+      },
+      
+      /**
+            <p>Retrieves the internal <code>facet</code> object. This is typically used by
+               internal API functions so use with caution.</p>
+
+            @member ejs.FacetMixin
+            @returns {String} returns this object's internal <code>facet</code> property.
+            */
+      toJSON: function () {
+        return facet;
+      }
+      
+    };
+  };
+
+  /**
+    @mixin
+    <p>The FilterMixin provides support for common options used across 
+    various <code>Filter</code> implementations.  This object should not be 
+    used directly.</p>
+
+    @name ejs.FilterMixin
+    */
+  ejs.FilterMixin = function (type) {
+
+    var filter = {};
+    filter[type] = {};
+
+    return {
+
+      /**
+            Sets the filter name.
+
+            @member ejs.FilterMixin
+            @param {String} name A name for the filter.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      name: function (name) {
+        if (name == null) {
+          return filter[type]._name;
+        }
+
+        filter[type]._name = name;
+        return this;
+      },
+
+      /**
+            Enable or disable caching of the filter
+
+            @member ejs.FilterMixin
+            @param {Boolean} trueFalse True to cache the filter, false otherwise.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      cache: function (trueFalse) {
+        if (trueFalse == null) {
+          return filter[type]._cache;
+        }
+
+        filter[type]._cache = trueFalse;
+        return this;
+      },
+
+      /**
+            Sets the cache key.
+
+            @member ejs.FilterMixin
+            @param {String} key the cache key as a string.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      cacheKey: function (key) {
+        if (key == null) {
+          return filter[type]._cache_key;
+        }
+
+        filter[type]._cache_key = key;
+        return this;
+      },
+
+      /**
+            The type of ejs object.  For internal use only.
+          
+            @member ejs.FilterMixin
+            @returns {String} the type of object
+            */
+      _type: function () {
+        return 'filter';
+      },
+    
+      /**
+             Returns the filter object.
+
+             @member ejs.FilterMixin
+             @returns {Object} filter object
+             */
+      toJSON: function () {
+        return filter;
+      }
+    
+    };
+  };
+
+  /**
+    @mixin
+    <p>The MetricsAggregationMixin provides support for common options used across
+    various metrics <code>Aggregation</code> implementations.  This object should
+    not be used directly.</p>
+
+    @name ejs.MetricsAggregationMixin
+    @ejs aggregation
+    @borrows ejs.AggregationMixin._type as _type
+    @borrows ejs.AggregationMixin.toJSON as toJSON
+
+    */
+  ejs.MetricsAggregationMixin = function (name, type) {
+
+    var
+      _common = ejs.AggregationMixin(name),
+      agg = _common.toJSON();
+
+    // remove ability for sub-aggregations since metrics aggregations dont
+    // support them.
+    delete _common.aggregation;
+    delete _common.agg;
+
+    agg[name][type] = {};
+
+    return extend(_common, {
+
+      /**
+      <p>Sets the field to operate on.</p>
+
+      @member ejs.MetricsAggregationMixin
+      @param {String} field a valid field name..
+      @returns {Object} returns <code>this</code> 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.MetricsAggregationMixin
+      @param {String} scriptCode A valid script string to execute.
+      @returns {Object} returns <code>this</code> 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.MetricsAggregationMixin
+      @param {String} scriptId A valid script id to execute.
+      @returns {Object} returns <code>this</code> 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.MetricsAggregationMixin
+      @param {String} scriptFile A valid script file to execute.
+      @returns {Object} returns <code>this</code> 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.MetricsAggregationMixin
+      @param {String} language The language of the script.
+      @returns {Object} returns <code>this</code> 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.MetricsAggregationMixin
+      @param {Object} p An object where the keys are the parameter name and
+        values are the parameter value.
+      @returns {Object} returns <code>this</code> 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
+    <p>The QueryMixin provides support for common options used across 
+    various <code>Query</code> implementations.  This object should not be 
+    used directly.</p>
+
+    @name ejs.QueryMixin
+    */
+  ejs.QueryMixin = function (type) {
+
+    var query = {};
+    query[type] = {};
+
+    return {
+
+      /**
+            Sets the boost value for documents matching the <code>Query</code>.
+
+            @member ejs.QueryMixin
+            @param {Double} boost A positive <code>double</code> value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      boost: function (boost) {
+        if (boost == null) {
+          return query[type].boost;
+        }
+
+        query[type].boost = boost;
+        return this;
+      },
+    
+      /**
+            The type of ejs object.  For internal use only.
+          
+            @member ejs.QueryMixin
+            @returns {String} the type of object
+            */
+      _type: function () {
+        return 'query';
+      },
+    
+      /**
+            Retrieves the internal <code>query</code> object. This is typically used by
+            internal API functions so use with caution.
+
+            @member ejs.QueryMixin
+            @returns {String} returns this object's internal <code>query</code> property.
+            */
+      toJSON: function () {
+        return query;
+      }
+  
+    };
+  };
+
+  /**
+    @mixin
+    <p>The ScoreFunctionMixin provides support for common options used across
+    various <code>ScoreFunction</code> implementations.  This object should not be
+    used directly.</p>
+
+    @name ejs.ScoreFunctionMixin
+    */
+  ejs.ScoreFunctionMixin = function (name) {
+
+    var func = {};
+
+    if (name != null) {
+      func[name] = {};
+    }
+
+    return {
+
+      /**
+      Adds a filter whose matching documents will have the score function applied.
+
+      @member ejs.ScoreFunctionMixin
+      @param {Filter} oFilter Any valid <code>Filter</code> object.
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      filter: function(oFilter) {
+        if (oFilter == null) {
+          return func.filter;
+        }
+
+        if (!isFilter(oFilter)) {
+          throw new TypeError('Argument must be a Filter');
+        }
+
+        func.filter = oFilter.toJSON();
+        return this;
+      },
+
+      /**
+      Sets the weight of the score function
+
+      @member ejs.ScoreFunctionMixin
+      @param {Number} oWeight The weight of this score function.
+      @returns {Object} returns <code>this</code> 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.
+
+      @member ejs.ScoreFunctionMixin
+      @returns {String} the type of object
+      */
+      _type: function () {
+        return 'score function';
+      },
+
+      /**
+      <p>Retrieves the internal <code>agg</code> object. This is typically used by
+         internal API functions so use with caution.</p>
+
+      @member ejs.ScoreFunctionMixin
+      @returns {String} returns this object's internal object.
+      */
+      toJSON: function () {
+        return func;
+      }
+
+    };
+  };
+
+  /**
+    @mixin
+    <p>The SuggestContextMixin provides support for suggest context settings 
+    across various <code>Suggester</code> implementations.  This object should not be 
+    used directly.</p>
+
+    @name ejs.SuggestContextMixin
+  
+    @param {String} settings The object to set the options on.
+    */
+  ejs.SuggestContextMixin = function (settings) {
+
+    return {
+    
+      /**
+            <p>Sets analyzer used to analyze the suggest text.</p>
+
+            @member ejs.SuggestContextMixin
+            @param {String} analyzer A valid analyzer name.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      analyzer: function (analyzer) {
+        if (analyzer == null) {
+          return settings.analyzer;
+        }
+  
+        settings.analyzer = analyzer;
+        return this;
+      },
+    
+      /**
+            <p>Sets the field used to generate suggestions from.</p>
+
+            @member ejs.SuggestContextMixin
+            @param {String} field A valid field name.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      field: function (field) {
+        if (field == null) {
+          return settings.field;
+        }
+  
+        settings.field = field;
+        return this;
+      },
+    
+      /**
+            <p>Sets the number of suggestions returned for each token.</p>
+
+            @member ejs.SuggestContextMixin
+            @param {Integer} s A positive integer value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      size: function (s) {
+        if (s == null) {
+          return settings.size;
+        }
+  
+        settings.size = s;
+        return this;
+      },
+    
+      /**
+            <p>Sets the maximum number of suggestions to be retrieved from 
+            each individual shard.</p>
+
+            @member ejs.SuggestContextMixin
+            @param {Integer} s A positive integer value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      shardSize: function (s) {
+        if (s == null) {
+          return settings.shard_size;
+        }
+  
+        settings.shard_size = s;
+        return this;
+      }
+      
+    };
+  };
+
+  /**
+    @mixin
+    <p>The SuggesterMixin provides support for the base setting of all suggesters. 
+    This object should not be used directly.</p>
+
+    @name ejs.SuggesterMixin
+  
+    @param {String} name The name of the suggester.
+    */
+  ejs.SuggesterMixin = function (name) {
+  
+    var suggest = {};
+    suggest[name] = {};
+
+    return {
+  
+      /**
+            <p>Sets the text to get suggestions for.  If not set, the global
+            suggestion text will be used.</p>
+
+            @member ejs.SuggesterMixin
+            @param {String} txt A string to get suggestions for.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      text: function (txt) {
+        if (txt == null) {
+          return suggest[name].text;
+        }
+  
+        suggest[name].text = txt;
+        return this;
+      },
+  
+      /**
+            The type of ejs object.  For internal use only.
+        
+            @member ejs.SuggesterMixin
+            @returns {String} the type of object
+            */
+      _type: function () {
+        return 'suggest';
+      },
+  
+      /**
+            <p>Retrieves the internal <code>suggest</code> object. This is typically used by
+               internal API functions so use with caution.</p>
+
+            @member ejs.SuggesterMixin
+            @returns {String} returns this object's internal <code>suggest</code> property.
+            */
+      toJSON: function () {
+        return suggest;
+      }
+    
+    };
+  };
+
+  /**
+    @class
+    <p>The DateHistogram facet works with time-based values by building a histogram across time
+       intervals of the <code>value</code> field. Each value is <em>rounded</em> into an interval (or
+       placed in a bucket), and statistics are provided per interval/bucket (count and total).</p>
+
+    <p>Facets are similar to SQL <code>GROUP BY</code> statements but perform much
+       better. You can also construct several <em>"groups"</em> at once by simply
+       specifying multiple facets.</p>
+
+    <div class="alert-message block-message info">
+        <p>
+            <strong>Tip: </strong>
+            For more information on faceted navigation, see
+            <a href="http://en.wikipedia.org/wiki/Faceted_classification">this</a>
+            Wikipedia article on Faceted Classification.
+        </p>
+    </div>
+
+    @name ejs.DateHistogramFacet
+    @ejs facet
+    @borrows ejs.FacetMixin.facetFilter as facetFilter
+    @borrows ejs.FacetMixin.global as global
+    @borrows ejs.FacetMixin.mode as mode
+    @borrows ejs.FacetMixin.cacheFilter as cacheFilter
+    @borrows ejs.FacetMixin.scope as scope
+    @borrows ejs.FacetMixin.nested as nested
+    @borrows ejs.FacetMixin._type as _type
+    @borrows ejs.FacetMixin.toJSON as toJSON
+  
+    @desc
+    <p>A facet which returns the N most frequent terms within a collection
+       or set of collections.</p>
+
+    @param {String} name The name which be used to refer to this facet. For instance,
+        the facet itself might utilize a field named <code>doc_authors</code>. Setting
+        <code>name</code> to <code>Authors</code> would allow you to refer to the
+        facet by that name, possibly simplifying some of the display logic.
+
+    */
+  ejs.DateHistogramFacet = function (name) {
+
+    var  
+      _common = ejs.FacetMixin(name),
+      facet = _common.toJSON();
+
+    facet[name].date_histogram = {};
+
+    return extend(_common, {
+
+      /**
+            Sets the field to be used to construct the this facet.
+
+            @member ejs.DateHistogramFacet
+            @param {String} fieldName The field name whose data will be used to construct the facet.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      field: function (fieldName) {
+        if (fieldName == null) {
+          return facet[name].date_histogram.field;
+        }
+      
+        facet[name].date_histogram.field = fieldName;
+        return this;
+      },
+
+      /**
+            Allows you to specify a different key field to be used to group intervals.
+
+            @member ejs.DateHistogramFacet
+            @param {String} fieldName The name of the field to be used.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      keyField: function (fieldName) {
+        if (fieldName == null) {
+          return facet[name].date_histogram.key_field;
+        }
+      
+        facet[name].date_histogram.key_field = fieldName;
+        return this;
+      },
+      
+      /**
+            Allows you to specify a different value field to aggrerate over.
+
+            @member ejs.DateHistogramFacet
+            @param {String} fieldName The name of the field to be used.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      valueField: function (fieldName) {
+        if (fieldName == null) {
+          return facet[name].date_histogram.value_field;
+        }
+      
+        facet[name].date_histogram.value_field = fieldName;
+        return this;
+      },
+      
+      /**
+            Sets the bucket interval used to calculate the distribution.
+
+            @member ejs.DateHistogramFacet
+            @param {String} timeInterval The bucket interval. Valid values are <code>year, month, week, day, hour,</code> and <code>minute</code>.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      interval: function (timeInterval) {
+        if (timeInterval == null) {
+          return facet[name].date_histogram.interval;
+        }
+      
+        facet[name].date_histogram.interval = timeInterval;
+        return this;
+      },
+
+      /**
+            <p>By default, time values are stored in UTC format.<p> 
+
+            <p>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 
+            <coe>preZone</code>.  Use <code>preZone</code> if possible. The 
+            value is an offset from UTC.<p>
+            
+            <p>For example, to use EST you would set the value to <code>-5</code>.</p>
+
+            @member ejs.DateHistogramFacet
+            @param {Integer} tz An offset value from UTC.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      timeZone: function (tz) {
+        if (tz == null) {
+          return facet[name].date_histogram.time_zone;
+        }
+      
+        facet[name].date_histogram.time_zone = tz;
+        return this;
+      },
+
+      /**
+            <p>By default, time values are stored in UTC format.<p> 
+
+            <p>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.<p>
+            
+            <p>For example, to use EST you would set the value to <code>-5</code>.</p>
+
+            @member ejs.DateHistogramFacet
+            @param {Integer} tz An offset value from UTC.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      preZone: function (tz) {
+        if (tz == null) {
+          return facet[name].date_histogram.pre_zone;
+        }
+      
+        facet[name].date_histogram.pre_zone = tz;
+        return this;
+      },
+      
+      /**
+            <p>Enables large date interval conversions (day and up).</p>  
+
+            <p>Set to true to enable and then set the <code>interval</code> to an 
+            interval greater than a day.</p>
+            
+            @member ejs.DateHistogramFacet
+            @param {Boolean} trueFalse A valid boolean value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      preZoneAdjustLargeInterval: function (trueFalse) {
+        if (trueFalse == null) {
+          return facet[name].date_histogram.pre_zone_adjust_large_interval;
+        }
+      
+        facet[name].date_histogram.pre_zone_adjust_large_interval = trueFalse;
+        return this;
+      },
+      
+      /**
+            <p>By default, time values are stored in UTC format.<p> 
+
+            <p>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.<p>
+            
+            <p>For example, to use EST you would set the value to <code>-5</code>.</p>
+
+            @member ejs.DateHistogramFacet
+            @param {Integer} tz An offset value from UTC.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      postZone: function (tz) {
+        if (tz == null) {
+          return facet[name].date_histogram.post_zone;
+        }
+      
+        facet[name].date_histogram.post_zone = tz;
+        return this;
+      },
+
+      /**
+            Set's a specific pre-rounding offset.  Format is 1d, 1h, etc.
+
+            @member ejs.DateHistogramFacet
+            @param {String} offset The offset as a string (1d, 1h, etc)
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      preOffset: function (offset) {
+        if (offset == null) {
+          return facet[name].date_histogram.pre_offset;
+        }
+      
+        facet[name].date_histogram.pre_offset = offset;
+        return this;
+      },
+      
+      /**
+            Set's a specific post-rounding offset.  Format is 1d, 1h, etc.
+
+            @member ejs.DateHistogramFacet
+            @param {String} offset The offset as a string (1d, 1h, etc)
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      postOffset: function (offset) {
+        if (offset == null) {
+          return facet[name].date_histogram.post_offset;
+        }
+      
+        facet[name].date_histogram.post_offset = offset;
+        return this;
+      },
+      
+      /**
+            <p>The date histogram works on numeric values (since time is stored 
+            in milliseconds since the epoch in UTC).<p> 
+
+            <p>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.</p>
+
+            <p>For example, when storing in a numeric field seconds resolution, 
+            the factor can be set to 1000.<p>
+
+            @member ejs.DateHistogramFacet
+            @param {Integer} f The conversion factor.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      factor: function (f) {
+        if (f == null) {
+          return facet[name].date_histogram.factor;
+        }
+      
+        facet[name].date_histogram.factor = f;
+        return this;
+      },
+      
+      /**
+            Allows you modify the <code>value</code> field using a script. The modified value
+            is then used to compute the statistical data.
+
+            @member ejs.DateHistogramFacet
+            @param {String} scriptCode A valid script string to execute.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      valueScript: function (scriptCode) {
+        if (scriptCode == null) {
+          return facet[name].date_histogram.value_script;
+        }
+      
+        facet[name].date_histogram.value_script = scriptCode;
+        return this;
+      },
+
+      /**
+            <p>Sets the type of ordering that will be performed on the date
+            buckets.  Valid values are:<p>
+            
+            <dl>
+                <dd><code>time</code> - the default, sort by the buckets start time in milliseconds.</dd>
+                <dd><code>count</code> - sort by the number of items in the bucket</dd>
+                <dd><code>total</code> - sort by the sum/total of the items in the bucket</dd>
+            <dl>
+            
+            @member ejs.DateHistogramFacet
+            @param {String} o The ordering method: time, count, or total.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      order: function (o) {
+        if (o == null) {
+          return facet[name].date_histogram.order;
+        }
+      
+        o = o.toLowerCase();
+        if (o === 'time' || o === 'count' || o === 'total') {
+          facet[name].date_histogram.order = o;
+        }
+        
+        return this;
+      },
+      
+      /**
+            The script language being used. Currently supported values are
+            <code>javascript</code>, <code>groovy</code>, and <code>mvel</code>.
+
+            @member ejs.DateHistogramFacet
+            @param {String} language The language of the script.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      lang: function (language) {
+        if (language == null) {
+          return facet[name].date_histogram.lang;
+        }
+      
+        facet[name].date_histogram.lang = language;
+        return this;
+      },
+
+      /**
+            Sets parameters that will be applied to the script.  Overwrites 
+            any existing params.
+
+            @member ejs.DateHistogramFacet
+            @param {Object} p An object where the keys are the parameter name and 
+              values are the parameter value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      params: function (p) {
+        if (p == null) {
+          return facet[name].date_histogram.params;
+        }
+    
+        facet[name].date_histogram.params = p;
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>The FilterFacet allows you to specify any valid <code>Filter</code> and
+    have the number of matching hits returned as the value.</p>
+
+    <p>Facets are similar to SQL <code>GROUP BY</code> statements but perform much
+       better. You can also construct several <em>"groups"</em> at once by simply
+       specifying multiple facets.</p>
+
+    <div class="alert-message block-message info">
+        <p>
+            <strong>Tip: </strong>
+            For more information on faceted navigation, see
+            <a href="http://en.wikipedia.org/wiki/Faceted_classification">this</a>
+            Wikipedia article on Faceted Classification.
+        </p>
+    </div>
+
+    @name ejs.FilterFacet
+    @ejs facet
+    @borrows ejs.FacetMixin.facetFilter as facetFilter
+    @borrows ejs.FacetMixin.global as global
+    @borrows ejs.FacetMixin.mode as mode
+    @borrows ejs.FacetMixin.cacheFilter as cacheFilter
+    @borrows ejs.FacetMixin.scope as scope
+    @borrows ejs.FacetMixin.nested as nested
+    @borrows ejs.FacetMixin._type as _type
+    @borrows ejs.FacetMixin.toJSON as toJSON
+
+    @desc
+    <p>A facet that return a count of the hits matching the given filter.</p>
+
+    @param {String} name The name which be used to refer to this facet. For instance,
+        the facet itself might utilize a field named <code>doc_authors</code>. Setting
+        <code>name</code> to <code>Authors</code> would allow you to refer to the
+        facet by that name, possibly simplifying some of the display logic.
+
+    */
+  ejs.FilterFacet = function (name) {
+
+    var
+      _common = ejs.FacetMixin(name),
+      facet = _common.toJSON();
+
+    return extend(_common, {
+
+      /**
+            <p>Sets the filter to be used for this facet.</p>
+
+            @member ejs.FilterFacet
+            @param {Object} oFilter A valid <code>Query</code> object.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      filter: function (oFilter) {
+        if (oFilter == null) {
+          return facet[name].filter;
+        }
+      
+        if (!isFilter(oFilter)) {
+          throw new TypeError('Argument must be a Filter');
+        }
+        
+        facet[name].filter = oFilter.toJSON();
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>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).</p>
+
+    <p>Facets are similar to SQL <code>GROUP BY</code> statements but perform much
+       better. You can also construct several <em>"groups"</em> at once by simply
+       specifying multiple facets.</p>
+
+    <div class="alert-message block-message info">
+        <p>
+            <strong>Tip: </strong>
+            For more information on faceted navigation, see
+            <a href="http://en.wikipedia.org/wiki/Faceted_classification">this</a>
+            Wikipedia article on Faceted Classification.
+        </p>
+    </div>
+
+    @name ejs.GeoDistanceFacet
+    @ejs facet
+    @borrows ejs.FacetMixin.facetFilter as facetFilter
+    @borrows ejs.FacetMixin.global as global
+    @borrows ejs.FacetMixin.mode as mode
+    @borrows ejs.FacetMixin.cacheFilter as cacheFilter
+    @borrows ejs.FacetMixin.scope as scope
+    @borrows ejs.FacetMixin.nested as nested
+    @borrows ejs.FacetMixin._type as _type
+    @borrows ejs.FacetMixin.toJSON as toJSON
+
+    @desc
+    <p>A facet which provides information over a range of distances from a provided point.</p>
+
+    @param {String} name The name which be used to refer to this facet. For instance,
+        the facet itself might utilize a field named <code>doc_authors</code>. Setting
+        <code>name</code> to <code>Authors</code> would allow you to refer to the
+        facet by that name, possibly simplifying some of the display logic.
+
+    */
+  ejs.GeoDistanceFacet = function (name) {
+
+    var
+      _common = ejs.FacetMixin(name),
+      facet = _common.toJSON(),
+      point = ejs.GeoPoint([0, 0]),
+      field = 'location';
+
+    facet[name].geo_distance = {
+      location: point.toJSON(),
+      ranges: []
+    };
+
+    return extend(_common, {
+
+      /**
+            Sets the document field containing the geo-coordinate to be used 
+            to calculate the distance.  Defaults to "location".
+
+            @member ejs.GeoDistanceFacet
+            @param {String} fieldName The field name whose data will be used to construct the facet.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      field: function (fieldName) {
+        var oldValue = facet[name].geo_distance[field];
+        
+        if (fieldName == null) {
+          return field;
+        }
+
+        delete facet[name].geo_distance[field];
+        field = fieldName;
+        facet[name].geo_distance[fieldName] = oldValue;
+        
+        return this;
+      },
+
+      /**
+            Sets the point of origin from where distances will be measured.
+
+            @member ejs.GeoDistanceFacet
+            @param {GeoPoint} p A valid GeoPoint object
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      point: function (p) {
+        if (p == null) {
+          return point;
+        }
+      
+        if (!isGeoPoint(p)) {
+          throw new TypeError('Argument must be a GeoPoint');
+        }
+        
+        point = p;
+        facet[name].geo_distance[field] = p.toJSON();
+        return this;
+      },
+
+      /**
+            Adds a new bounded range.
+
+            @member ejs.GeoDistanceFacet
+            @param {Number} from The lower bound of the range
+            @param {Number} to The upper bound of the range
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      addRange: function (from, to) {
+        if (arguments.length === 0) {
+          return facet[name].geo_distance.ranges;
+        }
+      
+        facet[name].geo_distance.ranges.push({
+          from: from,
+          to: to
+        });
+        
+        return this;
+      },
+
+      /**
+            Adds a new unbounded lower limit.
+
+            @member ejs.GeoDistanceFacet
+            @param {Number} from The lower limit of the unbounded range
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      addUnboundedFrom: function (from) {
+        if (from == null) {
+          return facet[name].geo_distance.ranges;
+        }
+      
+        facet[name].geo_distance.ranges.push({
+          from: from
+        });
+        
+        return this;
+      },
+
+      /**
+            Adds a new unbounded upper limit.
+
+            @member ejs.GeoDistanceFacet
+            @param {Number} to The upper limit of the unbounded range
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      addUnboundedTo: function (to) {
+        if (to == null) {
+          return facet[name].geo_distance.ranges;
+        }
+      
+        facet[name].geo_distance.ranges.push({
+          to: to
+        });
+        
+        return this;
+      },
+
+      /**
+             Sets the distance unit.  Valid values are "mi" for miles or "km"
+             for kilometers. Defaults to "km".
+
+             @member ejs.GeoDistanceFacet
+             @param {Number} unit the unit of distance measure.
+             @returns {Object} returns <code>this</code> so that calls can be chained.
+             */
+      unit: function (unit) {
+        if (unit == null) {
+          return facet[name].geo_distance.unit;
+        }
+      
+        unit = unit.toLowerCase();
+        if (unit === 'mi' || unit === 'km') {
+          facet[name].geo_distance.unit = unit;
+        }
+        
+        return this;
+      },
+      
+      /**
+            How to compute the distance. Can either be arc (better precision) 
+            or plane (faster). Defaults to arc.
+
+            @member ejs.GeoDistanceFacet
+            @param {String} type The execution type as a string.  
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      distanceType: function (type) {
+        if (type == null) {
+          return facet[name].geo_distance.distance_type;
+        }
+
+        type = type.toLowerCase();
+        if (type === 'arc' || type === 'plane') {
+          facet[name].geo_distance.distance_type = type;
+        }
+        
+        return this;
+      },
+
+      /**
+            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
+
+            @member ejs.GeoDistanceFacet
+            @param {String} trueFalse True if the coordinates should be normalized. False otherwise.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      normalize: function (trueFalse) {
+        if (trueFalse == null) {
+          return facet[name].geo_distance.normalize;
+        }
+
+        facet[name].geo_distance.normalize = trueFalse;
+        return this;
+      },
+      
+      /**
+            Allows you to specify a different value field to aggrerate over.
+
+            @member ejs.GeoDistanceFacet
+            @param {String} fieldName The name of the field to be used.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      valueField: function (fieldName) {
+        if (fieldName == null) {
+          return facet[name].geo_distance.value_field;
+        }
+      
+        facet[name].geo_distance.value_field = fieldName;
+        return this;
+      },
+      
+      /**
+            Allows you modify the <code>value</code> field using a script. The modified value
+            is then used to compute the statistical data.
+
+            @member ejs.GeoDistanceFacet
+            @param {String} scriptCode A valid script string to execute.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      valueScript: function (scriptCode) {
+        if (scriptCode == null) {
+          return facet[name].geo_distance.value_script;
+        }
+      
+        facet[name].geo_distance.value_script = scriptCode;
+        return this;
+      },
+      
+      /**
+            The script language being used. Currently supported values are
+            <code>javascript</code>, <code>groovy</code>, and <code>mvel</code>.
+
+            @member ejs.GeoDistanceFacet
+            @param {String} language The language of the script.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      lang: function (language) {
+        if (language == null) {
+          return facet[name].geo_distance.lang;
+        }
+      
+        facet[name].geo_distance.lang = language;
+        return this;
+      },
+      
+      /**
+            Sets parameters that will be applied to the script.  Overwrites 
+            any existing params.
+
+            @member ejs.GeoDistanceFacet
+            @param {Object} p An object where the keys are the parameter name and 
+              values are the parameter value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      params: function (p) {
+        if (p == null) {
+          return facet[name].geo_distance.params;
+        }
+    
+        facet[name].geo_distance.params = p;
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>The histogram facet works with numeric data by building a histogram across intervals
+       of the field values. Each value is <em>rounded</em> into an interval (or placed in a
+       bucket), and statistics are provided per interval/bucket (count and total).</p>
+
+    <p>Facets are similar to SQL <code>GROUP BY</code> statements but perform much
+       better. You can also construct several <em>"groups"</em> at once by simply
+       specifying multiple facets.</p>
+
+    <div class="alert-message block-message info">
+        <p>
+            <strong>Tip: </strong>
+            For more information on faceted navigation, see
+            <a href="http://en.wikipedia.org/wiki/Faceted_classification">this</a>
+            Wikipedia article on Faceted Classification.
+        </p>
+    </div>
+
+    @name ejs.HistogramFacet
+    @ejs facet
+    @borrows ejs.FacetMixin.facetFilter as facetFilter
+    @borrows ejs.FacetMixin.global as global
+    @borrows ejs.FacetMixin.mode as mode
+    @borrows ejs.FacetMixin.cacheFilter as cacheFilter
+    @borrows ejs.FacetMixin.scope as scope
+    @borrows ejs.FacetMixin.nested as nested
+    @borrows ejs.FacetMixin._type as _type
+    @borrows ejs.FacetMixin.toJSON as toJSON
+
+    @desc
+    <p>A facet which returns the N most frequent terms within a collection
+       or set of collections.</p>
+
+    @param {String} name The name which be used to refer to this facet. For instance,
+        the facet itself might utilize a field named <code>doc_authors</code>. Setting
+        <code>name</code> to <code>Authors</code> would allow you to refer to the
+        facet by that name, possibly simplifying some of the display logic.
+
+    */
+  ejs.HistogramFacet = function (name) {
+
+    var 
+      _common = ejs.FacetMixin(name),
+      facet = _common.toJSON();
+
+    facet[name].histogram = {};
+
+    return extend(_common, {
+
+      /**
+            Sets the field to be used to construct the this facet.
+
+            @member ejs.HistogramFacet
+            @param {String} fieldName The field name whose data will be used to construct the facet.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      field: function (fieldName) {
+        if (fieldName == null) {
+          return facet[name].histogram.field;
+        }
+      
+        facet[name].histogram.field = fieldName;
+        return this;
+      },
+
+      /**
+            Sets the bucket interval used to calculate the distribution.
+
+            @member ejs.HistogramFacet
+            @param {Number} numericInterval The bucket interval in which to group values.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      interval: function (numericInterval) {
+        if (numericInterval == null) {
+          return facet[name].histogram.interval;
+        }
+      
+        facet[name].histogram.interval = numericInterval;
+        return this;
+      },
+
+      /**
+            Sets the bucket interval used to calculate the distribution based
+            on a time value such as "1d", "1w", etc.
+
+            @member ejs.HistogramFacet
+            @param {Number} timeInterval The bucket interval in which to group values.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      timeInterval: function (timeInterval) {
+        if (timeInterval == null) {
+          return facet[name].histogram.time_interval;
+        }
+      
+        facet[name].histogram.time_interval = timeInterval;
+        return this;
+      },
+
+      /**
+            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.
+
+            @member ejs.HistogramFacet
+            @param {Number} from the lower bounds bucket value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      from: function (from) {
+        if (from == null) {
+          return facet[name].histogram.from;
+        }
+      
+        facet[name].histogram.from = from;
+        return this;
+      },
+
+      /**
+            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.
+
+            @member ejs.HistogramFacet
+            @param {Number} to the upper bounds bucket value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      to: function (to) {
+        if (to == null) {
+          return facet[name].histogram.to;
+        }
+      
+        facet[name].histogram.to = to;
+        return this;
+      },
+                  
+      /**
+            Allows you to specify a different value field to aggrerate over.
+
+            @member ejs.HistogramFacet
+            @param {String} fieldName The name of the field to be used.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      valueField: function (fieldName) {
+        if (fieldName == null) {
+          return facet[name].histogram.value_field;
+        }
+      
+        facet[name].histogram.value_field = fieldName;
+        return this;
+      },
+
+      /**
+            Allows you to specify a different key field to be used to group intervals.
+
+            @member ejs.HistogramFacet
+            @param {String} fieldName The name of the field to be used.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      keyField: function (fieldName) {
+        if (fieldName == null) {
+          return facet[name].histogram.key_field;
+        }
+      
+        facet[name].histogram.key_field = fieldName;
+        return this;
+      },
+
+      /**
+            Allows you modify the <code>value</code> field using a script. The modified value
+            is then used to compute the statistical data.
+
+            @member ejs.HistogramFacet
+            @param {String} scriptCode A valid script string to execute.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      valueScript: function (scriptCode) {
+        if (scriptCode == null) {
+          return facet[name].histogram.value_script;
+        }
+      
+        facet[name].histogram.value_script = scriptCode;
+        return this;
+      },
+
+      /**
+            Allows you modify the <code>key</code> field using a script. The modified value
+            is then used to generate the interval.
+
+            @member ejs.HistogramFacet
+            @param {String} scriptCode A valid script string to execute.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      keyScript: function (scriptCode) {
+        if (scriptCode == null) {
+          return facet[name].histogram.key_script;
+        }
+      
+        facet[name].histogram.key_script = scriptCode;
+        return this;
+      },
+
+      /**
+            The script language being used. Currently supported values are
+            <code>javascript</code>, <code>groovy</code>, and <code>mvel</code>.
+
+            @member ejs.HistogramFacet
+            @param {String} language The language of the script.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      lang: function (language) {
+        if (language == null) {
+          return facet[name].histogram.lang;
+        }
+      
+        facet[name].histogram.lang = language;
+        return this;
+      },
+
+      /**
+            Sets parameters that will be applied to the script.  Overwrites 
+            any existing params.
+
+            @member ejs.HistogramFacet
+            @param {Object} p An object where the keys are the parameter name and 
+              values are the parameter value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      params: function (p) {
+        if (p == null) {
+          return facet[name].histogram.params;
+        }
+    
+        facet[name].histogram.params = p;
+        return this;
+      },
+      
+      /**
+            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
+            
+            @member ejs.HistogramFacet
+            @param {String} o The ordering method: key, count, or total.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      order: function (o) {
+        if (o == null) {
+          return facet[name].histogram.order;
+        }
+      
+        o = o.toLowerCase();
+        if (o === 'key' || o === 'count' || o === 'total') {
+          facet[name].histogram.order = o;
+        }
+        
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>The QueryFacet facet allows you to specify any valid <code>Query</code> and
+    have the number of matching hits returned as the value.</p>
+
+    <p>Facets are similar to SQL <code>GROUP BY</code> statements but perform much
+       better. You can also construct several <em>"groups"</em> at once by simply
+       specifying multiple facets.</p>
+
+    <div class="alert-message block-message info">
+        <p>
+            <strong>Tip: </strong>
+            For more information on faceted navigation, see
+            <a href="http://en.wikipedia.org/wiki/Faceted_classification">this</a>
+            Wikipedia article on Faceted Classification.
+        </p>
+    </div>
+
+    @name ejs.QueryFacet
+    @ejs facet
+    @borrows ejs.FacetMixin.facetFilter as facetFilter
+    @borrows ejs.FacetMixin.global as global
+    @borrows ejs.FacetMixin.mode as mode
+    @borrows ejs.FacetMixin.cacheFilter as cacheFilter
+    @borrows ejs.FacetMixin.scope as scope
+    @borrows ejs.FacetMixin.nested as nested
+    @borrows ejs.FacetMixin._type as _type
+    @borrows ejs.FacetMixin.toJSON as toJSON
+
+    @desc
+    <p>A facet that return a count of the hits matching the given query.</p>
+
+    @param {String} name The name which be used to refer to this facet. For instance,
+        the facet itself might utilize a field named <code>doc_authors</code>. Setting
+        <code>name</code> to <code>Authors</code> would allow you to refer to the
+        facet by that name, possibly simplifying some of the display logic.
+
+    */
+  ejs.QueryFacet = function (name) {
+
+    var 
+      _common = ejs.FacetMixin(name),
+      facet = _common.toJSON();
+
+    return extend(_common, {
+
+      /**
+            <p>Sets the query to be used for this facet.</p>
+
+            @member ejs.QueryFacet
+            @param {Object} oQuery A valid <code>Query</code> object.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      query: function (oQuery) {
+        if (oQuery == null) {
+          return facet[name].query;
+        }
+      
+        if (!isQuery(oQuery)) {
+          throw new TypeError('Argument must be a Query');
+        }
+        
+        facet[name].query = oQuery.toJSON();
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>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.</p>
+
+    <p>Facets are similar to SQL <code>GROUP BY</code> statements but perform much
+       better. You can also construct several <em>"groups"</em> at once by simply
+       specifying multiple facets.</p>
+
+    <div class="alert-message block-message info">
+        <p>
+            <strong>Tip: </strong>
+            For more information on faceted navigation, see
+            <a href="http://en.wikipedia.org/wiki/Faceted_classification">this</a>
+            Wikipedia article on Faceted Classification.
+        </p>
+    </div>
+
+    @name ejs.RangeFacet
+    @ejs facet
+    @borrows ejs.FacetMixin.facetFilter as facetFilter
+    @borrows ejs.FacetMixin.global as global
+    @borrows ejs.FacetMixin.mode as mode
+    @borrows ejs.FacetMixin.cacheFilter as cacheFilter
+    @borrows ejs.FacetMixin.scope as scope
+    @borrows ejs.FacetMixin.nested as nested
+    @borrows ejs.FacetMixin._type as _type
+    @borrows ejs.FacetMixin.toJSON as toJSON
+
+    @desc
+    <p>A facet which provides information over a range of numeric intervals.</p>
+
+    @param {String} name The name which be used to refer to this facet. For instance,
+        the facet itself might utilize a field named <code>doc_authors</code>. Setting
+        <code>name</code> to <code>Authors</code> would allow you to refer to the
+        facet by that name, possibly simplifying some of the display logic.
+
+    */
+  ejs.RangeFacet = function (name) {
+
+    var 
+      _common = ejs.FacetMixin(name),
+      facet = _common.toJSON();
+
+    facet[name].range = {
+      ranges: []
+    };
+
+    return extend(_common, {
+
+      /**
+            Sets the document field to be used for the facet.
+
+            @member ejs.RangeFacet
+            @param {String} fieldName The field name whose data will be used to compute the interval.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      field: function (fieldName) {
+        if (fieldName == null) {
+          return facet[name].range.field;
+        }
+      
+        facet[name].range.field = fieldName;
+        return this;
+      },
+
+      /**
+            Allows you to specify an alternate key field to be used to compute the interval.
+
+            @member ejs.RangeFacet
+            @param {String} fieldName The field name whose data will be used to compute the interval.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      keyField: function (fieldName) {
+        if (fieldName == null) {
+          return facet[name].range.key_field;
+        }
+      
+        facet[name].range.key_field = fieldName;
+        return this;
+      },
+
+      /**
+            Allows you to specify an alternate value field to be used to compute statistical information.
+
+            @member ejs.RangeFacet
+            @param {String} fieldName The field name whose data will be used to compute statistics.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      valueField: function (fieldName) {
+        if (fieldName == null) {
+          return facet[name].range.value_field;
+        }
+      
+        facet[name].range.value_field = fieldName;
+        return this;
+      },
+
+      /**
+            Allows you modify the <code>value</code> field using a script. The modified value
+            is then used to compute the statistical data.
+
+            @member ejs.RangeFacet
+            @param {String} scriptCode A valid script string to execute.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      valueScript: function (scriptCode) {
+        if (scriptCode == null) {
+          return facet[name].range.value_script;
+        }
+      
+        facet[name].range.value_script = scriptCode;
+        return this;
+      },
+
+      /**
+            Allows you modify the <code>key</code> field using a script. The modified value
+            is then used to generate the interval.
+
+            @member ejs.RangeFacet
+            @param {String} scriptCode A valid script string to execute.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      keyScript: function (scriptCode) {
+        if (scriptCode == null) {
+          return facet[name].range.key_script;
+        }
+      
+        facet[name].range.key_script = scriptCode;
+        return this;
+      },
+
+      /**
+            The script language being used. Currently supported values are
+            <code>javascript</code>, <code>groovy</code>, and <code>mvel</code>.
+
+            @member ejs.RangeFacet
+            @param {String} language The language of the script.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      lang: function (language) {
+        if (language == null) {
+          return facet[name].range.lang;
+        }
+      
+        facet[name].range.lang = language;
+        return this;
+      },
+
+      /**
+            Sets parameters that will be applied to the script.  Overwrites 
+            any existing params.
+
+            @member ejs.RangeFacet
+            @param {Object} p An object where the keys are the parameter name and 
+              values are the parameter value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      params: function (p) {
+        if (p == null) {
+          return facet[name].range.params;
+        }
+    
+        facet[name].range.params = p;
+        return this;
+      },
+      
+      /**
+            Adds a new bounded range.
+
+            @member ejs.RangeFacet
+            @param {Number} from The lower bound of the range (can also be <code>Date</code>).
+            @param {Number} to The upper bound of the range (can also be <code>Date</code>).
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      addRange: function (from, to) {
+        if (arguments.length === 0) {
+          return facet[name].range.ranges;
+        }
+      
+        facet[name].range.ranges.push({
+          from: from,
+          to: to
+        });
+        
+        return this;
+      },
+
+      /**
+            Adds a new unbounded lower limit.
+
+            @member ejs.RangeFacet
+            @param {Number} from The lower limit of the unbounded range (can also be <code>Date</code>).
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      addUnboundedFrom: function (from) {
+        if (from == null) {
+          return facet[name].range.ranges;
+        }
+      
+        facet[name].range.ranges.push({
+          from: from
+        });
+        
+        return this;
+      },
+
+      /**
+            Adds a new unbounded upper limit.
+
+            @member ejs.RangeFacet
+            @param {Number} to The upper limit of the unbounded range (can also be <code>Date</code>).
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      addUnboundedTo: function (to) {
+        if (to == null) {
+          return facet[name].range.ranges;
+        }
+      
+        facet[name].range.ranges.push({
+          to: to
+        });
+        
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>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.</p>
+
+    <p>Facets are similar to SQL <code>GROUP BY</code> statements but perform much
+       better. You can also construct several <em>"groups"</em> at once by simply
+       specifying multiple facets.</p>
+
+    <div class="alert-message block-message info">
+        <p>
+            <strong>Tip: </strong>
+            For more information on faceted navigation, see
+            <a href="http://en.wikipedia.org/wiki/Faceted_classification">this</a>
+            Wikipedia article on Faceted Classification.
+        </p>
+    </div>
+
+    @name ejs.StatisticalFacet
+    @ejs facet
+    @borrows ejs.FacetMixin.facetFilter as facetFilter
+    @borrows ejs.FacetMixin.global as global
+    @borrows ejs.FacetMixin.mode as mode
+    @borrows ejs.FacetMixin.cacheFilter as cacheFilter
+    @borrows ejs.FacetMixin.scope as scope
+    @borrows ejs.FacetMixin.nested as nested
+    @borrows ejs.FacetMixin._type as _type
+    @borrows ejs.FacetMixin.toJSON as toJSON
+
+    @desc
+    <p>A facet which returns statistical information about a numeric field</p>
+
+    @param {String} name The name which be used to refer to this facet. For instance,
+        the facet itself might utilize a field named <code>doc_authors</code>. Setting
+        <code>name</code> to <code>Authors</code> would allow you to refer to the
+        facet by that name, possibly simplifying some of the display logic.
+
+    */
+  ejs.StatisticalFacet = function (name) {
+
+    var 
+      _common = ejs.FacetMixin(name),
+      facet = _common.toJSON();
+
+    facet[name].statistical = {};
+
+    return extend(_common, {
+
+      /**
+            Sets the field to be used to construct the this facet.
+
+            @member ejs.StatisticalFacet
+            @param {String} fieldName The field name whose data will be used to construct the facet.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      field: function (fieldName) {
+        if (fieldName == null) {
+          return facet[name].statistical.field;
+        }
+      
+        facet[name].statistical.field = fieldName;
+        return this;
+      },
+
+      /**
+            Aggregate statistical info across a set of fields.
+
+            @member ejs.StatisticalFacet
+            @param {Array} aFieldName An array of field names.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      fields: function (fields) {
+        if (fields == null) {
+          return facet[name].statistical.fields;
+        }
+      
+        if (!isArray(fields)) {
+          throw new TypeError('Argument must be an array');
+        }
+        
+        facet[name].statistical.fields = fields;
+        return this;
+      },
+
+      /**
+            Define a script to evaluate of which the result will be used to generate
+            the statistical information.
+
+            @member ejs.StatisticalFacet
+            @param {String} code The script code to execute.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      script: function (code) {
+        if (code == null) {
+          return facet[name].statistical.script;
+        }
+      
+        facet[name].statistical.script = code;
+        return this;
+      },
+
+      /**
+            The script language being used. Currently supported values are
+            <code>javascript</code>, <code>groovy</code>, and <code>mvel</code>.
+
+            @member ejs.StatisticalFacet
+            @param {String} language The language of the script.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      lang: function (language) {
+        if (language == null) {
+          return facet[name].statistical.lang;
+        }
+      
+        facet[name].statistical.lang = language;
+        return this;
+      },
+
+      /**
+            Allows you to set script parameters to be used during the execution of the script.
+
+            @member ejs.StatisticalFacet
+            @param {Object} oParams An object containing key/value pairs representing param name/value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      params: function (oParams) {
+        if (oParams == null) {
+          return facet[name].statistical.params;
+        }
+      
+        facet[name].statistical.params = oParams;
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>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 <em>pivot table</em>.</p>
+
+    <p>Facets are similar to SQL <code>GROUP BY</code> statements but perform much
+       better. You can also construct several <em>"groups"</em> at once by simply
+       specifying multiple facets.</p>
+
+    <div class="alert-message block-message info">
+        <p>
+            <strong>Tip: </strong>
+            For more information on faceted navigation, see
+            <a href="http://en.wikipedia.org/wiki/Faceted_classification">this</a>
+            Wikipedia article on Faceted Classification.
+        </p>
+    </div>
+
+    @name ejs.TermStatsFacet
+    @ejs facet
+    @borrows ejs.FacetMixin.facetFilter as facetFilter
+    @borrows ejs.FacetMixin.global as global
+    @borrows ejs.FacetMixin.mode as mode
+    @borrows ejs.FacetMixin.cacheFilter as cacheFilter
+    @borrows ejs.FacetMixin.scope as scope
+    @borrows ejs.FacetMixin.nested as nested
+    @borrows ejs.FacetMixin._type as _type
+    @borrows ejs.FacetMixin.toJSON as toJSON
+
+    @desc
+    <p>A facet which computes statistical data based on an aggregate key.</p>
+
+    @param {String} name The name which be used to refer to this facet. For instance,
+        the facet itself might utilize a field named <code>doc_authors</code>. Setting
+        <code>name</code> to <code>Authors</code> would allow you to refer to the
+        facet by that name, possibly simplifying some of the display logic.
+
+    */
+  ejs.TermStatsFacet = function (name) {
+
+    var 
+      _common = ejs.FacetMixin(name),
+      facet = _common.toJSON();
+
+    facet[name].terms_stats = {};
+
+    return extend(_common, {
+
+      /**
+            Sets the field for which statistical information will be generated.
+
+            @member ejs.TermStatsFacet
+            @param {String} fieldName The field name whose data will be used to construct the facet.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      valueField: function (fieldName) {
+        if (fieldName == null) {
+          return facet[name].terms_stats.value_field;
+        }
+      
+        facet[name].terms_stats.value_field = fieldName;
+        return this;
+      },
+
+      /**
+            Sets the field which will be used to pivot on (group-by).
+
+            @member ejs.TermStatsFacet
+            @param {String} fieldName The field name whose data will be used to construct the facet.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      keyField: function (fieldName) {
+        if (fieldName == null) {
+          return facet[name].terms_stats.key_field;
+        }
+      
+        facet[name].terms_stats.key_field = fieldName;
+        return this;
+      },
+
+      /**
+            Sets a script that will provide the terms for a given document.
+
+            @member ejs.TermStatsFacet
+            @param {String} script The script code.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      scriptField: function (script) {
+        if (script == null) {
+          return facet[name].terms_stats.script_field;
+        }
+      
+        facet[name].terms_stats.script_field = script;
+        return this;
+      },
+      
+      /**
+            Define a script to evaluate of which the result will be used to generate
+            the statistical information.
+
+            @member ejs.TermStatsFacet
+            @param {String} code The script code to execute.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      valueScript: function (code) {
+        if (code == null) {
+          return facet[name].terms_stats.value_script;
+        }
+      
+        facet[name].terms_stats.value_script = code;
+        return this;
+      },
+
+      /**
+            <p>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
+               <em>out-of-memory</em> errors.</p>
+
+            @member ejs.TermStatsFacet
+            @param {String} trueFalse <code>true</code> or <code>false</code>
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      allTerms: function (trueFalse) {
+        if (trueFalse == null) {
+          return facet[name].terms_stats.all_terms;
+        }
+      
+        facet[name].terms_stats.all_terms = trueFalse;
+        return this;
+      },
+      
+      /**
+            The script language being used. Currently supported values are
+            <code>javascript</code>, <code>groovy</code>, and <code>mvel</code>.
+
+            @member ejs.TermStatsFacet
+            @param {String} language The language of the script.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      lang: function (language) {
+        if (language == null) {
+          return facet[name].terms_stats.lang;
+        }
+      
+        facet[name].terms_stats.lang = language;
+        return this;
+      },
+
+      /**
+            Allows you to set script parameters to be used during the execution of the script.
+
+            @member ejs.TermStatsFacet
+            @param {Object} oParams An object containing key/value pairs representing param name/value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      params: function (oParams) {
+        if (oParams == null) {
+          return facet[name].terms_stats.params;
+        }
+      
+        facet[name].terms_stats.params = oParams;
+        return this;
+      },
+
+      /**
+            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. <strong>Higher settings could cause memory strain</strong>.
+
+            @member ejs.TermStatsFacet
+            @param {Integer} facetSize The numer of facet entries to be returned.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      size: function (facetSize) {
+        if (facetSize == null) {
+          return facet[name].terms_stats.size;
+        }
+      
+        facet[name].terms_stats.size = facetSize;
+        return this;
+      },
+
+      /**
+            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.
+            
+            @member ejs.TermStatsFacet
+            @param {String} o The ordering method
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      order: function (o) {
+        if (o == null) {
+          return facet[name].terms_stats.order;
+        }
+      
+        o = o.toLowerCase();
+        if (o === 'count' || o === 'term' || o === 'reverse_count' || 
+          o === 'reverse_term' || o === 'total' || o === 'reverse_total' || 
+          o === 'min' || o === 'reverse_min' || o === 'max' || 
+          o === 'reverse_max' || o === 'mean' || o === 'reverse_mean') {
+          
+          facet[name].terms_stats.order = o;
+        }
+        
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>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.</p>
+
+    <p>Facets are similar to SQL <code>GROUP BY</code> statements but perform much
+       better. You can also construct several <em>"groups"</em> at once by simply
+       specifying multiple facets.</p>
+
+    <p>For more information on faceted navigation, see this Wikipedia article on
+       <a href="http://en.wikipedia.org/wiki/Faceted_classification">Faceted Classification</a></p<
+
+    @name ejs.TermsFacet
+    @ejs facet
+    @borrows ejs.FacetMixin.facetFilter as facetFilter
+    @borrows ejs.FacetMixin.global as global
+    @borrows ejs.FacetMixin.mode as mode
+    @borrows ejs.FacetMixin.cacheFilter as cacheFilter
+    @borrows ejs.FacetMixin.scope as scope
+    @borrows ejs.FacetMixin.nested as nested
+    @borrows ejs.FacetMixin._type as _type
+    @borrows ejs.FacetMixin.toJSON as toJSON
+
+    @desc
+    <p>A facet which returns the N most frequent terms within a collection
+       or set of collections.</p>
+
+    @param {String} name The name which be used to refer to this facet. For instance,
+        the facet itself might utilize a field named <code>doc_authors</code>. Setting
+        <code>name</code> to <code>Authors</code> would allow you to refer to the
+        facet by that name, possibly simplifying some of the display logic.
+
+    */
+  ejs.TermsFacet = function (name) {
+
+    var
+      _common = ejs.FacetMixin(name),
+      facet = _common.toJSON();
+
+    facet[name].terms = {};
+
+    return extend(_common, {
+
+      /**
+            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.
+
+            @member ejs.TermsFacet
+            @param {String} fieldName The field name whose data will be used to construct the facet.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      field: function (fieldName) {
+        if (fieldName == null) {
+          return facet[name].terms.field;
+        }
+
+        facet[name].terms.field = fieldName;
+        return this;
+      },
+
+      /**
+            Aggregate statistical info across a set of fields.
+
+            @member ejs.TermsFacet
+            @param {Array} aFieldName An array of field names.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      fields: function (fields) {
+        if (fields == null) {
+          return facet[name].terms.fields;
+        }
+
+        if (!isArray(fields)) {
+          throw new TypeError('Argument must be an array');
+        }
+
+        facet[name].terms.fields = fields;
+        return this;
+      },
+
+      /**
+            Sets a script that will provide the terms for a given document.
+
+            @member ejs.TermsFacet
+            @param {String} script The script code.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      scriptField: function (script) {
+        if (script == null) {
+          return facet[name].terms.script_field;
+        }
+
+        facet[name].terms.script_field = script;
+        return this;
+      },
+
+      /**
+            Sets the number of facet entries that will be returned for this facet. For instance, you
+            might ask for only the top 5 <code>authors</code> although there might be hundreds of
+            unique authors.
+
+            @member ejs.TermsFacet
+            @param {Integer} facetSize The numer of facet entries to be returned.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      size: function (facetSize) {
+        if (facetSize == null) {
+          return facet[name].terms.size;
+        }
+
+        facet[name].terms.size = facetSize;
+        return this;
+      },
+
+
+      /**
+            Determines how many terms the coordinating node will request from
+            each shard.
+
+            @member ejs.TermsFacet
+            @param {Integer} shardSize The numer of terms to fetch from each shard.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      shardSize: function (shardSize) {
+        if (shardSize == null) {
+          return facet[name].terms.shard_size;
+        }
+
+        facet[name].terms.shard_size = shardSize;
+        return this;
+      },
+
+      /**
+            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.
+
+            @member ejs.TermsFacet
+            @param {String} o The ordering method
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      order: function (o) {
+        if (o == null) {
+          return facet[name].terms.order;
+        }
+
+        o = o.toLowerCase();
+        if (o === 'count' || o === 'term' ||
+          o === 'reverse_count' || o === 'reverse_term') {
+
+          facet[name].terms.order = o;
+        }
+
+        return this;
+      },
+
+      /**
+            <p>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
+               <em>out-of-memory</em> errors.</p>
+
+            @member ejs.TermsFacet
+            @param {String} trueFalse <code>true</code> or <code>false</code>
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      allTerms: function (trueFalse) {
+        if (trueFalse == null) {
+          return facet[name].terms.all_terms;
+        }
+
+        facet[name].terms.all_terms = trueFalse;
+        return this;
+      },
+
+      /**
+            <p>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.</p>
+
+            @member ejs.TermsFacet
+            @param {(String|String[])} exclude A single term to exclude or an
+              array of terms to exclude.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      exclude: function (exclude) {
+        if (facet[name].terms.exclude == null) {
+          facet[name].terms.exclude = [];
+        }
+
+        if (exclude == null) {
+          return facet[name].terms.exclude;
+        }
+
+        if (isString(exclude)) {
+          facet[name].terms.exclude.push(exclude);
+        } else if (isArray(exclude)) {
+          facet[name].terms.exclude = exclude;
+        } else {
+          throw new TypeError('Argument must be string or array');
+        }
+
+        return this;
+      },
+
+      /**
+            <p>Allows you to only include facet entries matching a specified regular expression.</p>
+
+            @member ejs.TermsFacet
+            @param {String} exp A valid regular expression.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      regex: function (exp) {
+        if (exp == null) {
+          return facet[name].terms.regex;
+        }
+
+        facet[name].terms.regex = exp;
+        return this;
+      },
+
+      /**
+            <p>Allows you to set the regular expression flags to be used
+            with the <code>regex</code></p>
+
+            @member ejs.TermsFacet
+            @param {String} flags A valid regex flag - see <a href="http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html#field_summary">Java Pattern API</a>
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      regexFlags: function (flags) {
+        if (flags == null) {
+          return facet[name].terms.regex_flags;
+        }
+
+        facet[name].terms.regex_flags = flags;
+        return this;
+      },
+
+      /**
+            Allows you modify the term using a script. The modified value
+            is then used in the facet collection.
+
+            @member ejs.TermsFacet
+            @param {String} scriptCode A valid script string to execute.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      script: function (scriptCode) {
+        if (scriptCode == null) {
+          return facet[name].terms.script;
+        }
+
+        facet[name].terms.script = scriptCode;
+        return this;
+      },
+
+      /**
+            The script language being used. Currently supported values are
+            <code>javascript</code>, <code>groovy</code>, and <code>mvel</code>.
+
+            @member ejs.TermsFacet
+            @param {String} language The language of the script.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      lang: function (language) {
+        if (language == null) {
+          return facet[name].terms.lang;
+        }
+
+        facet[name].terms.lang = language;
+        return this;
+      },
+
+      /**
+            Sets parameters that will be applied to the script.  Overwrites
+            any existing params.
+
+            @member ejs.TermsFacet
+            @param {Object} p An object where the keys are the parameter name and
+              values are the parameter value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      params: function (p) {
+        if (p == null) {
+          return facet[name].terms.params;
+        }
+
+        facet[name].terms.params = p;
+        return this;
+      },
+
+      /**
+            Sets the execution hint determines how the facet is computed.
+            Currently only supported value is "map".
+
+            @member ejs.TermsFacet
+            @param {Object} h The hint value as a string.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      executionHint: function (h) {
+        if (h == null) {
+          return facet[name].terms.execution_hint;
+        }
+
+        facet[name].terms.execution_hint = h;
+        return this;
+      }
+
+    });
+  };
+
+  /**
+    @class
+    <p>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.</p>
+
+    @name ejs.AvgAggregation
+    @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
+    <p>Aggregation that computes the average of numeric values that are extracted
+    from the aggregated documents.</p>
+
+    @param {String} name The name which be used to refer to this aggregation.
+
+    */
+  ejs.AvgAggregation = function (name) {
+
+    var
+      _common = ejs.MetricsAggregationMixin(name, 'avg'),
+      agg = _common.toJSON();
+
+    return _common;
+  };
+
+  /**
+    @class
+    <p>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.</p>
+
+    @name ejs.CardinalityAggregation
+    @ejs aggregation
+    @borrows ejs.MetricsAggregationMixin.field as field
+    @borrows ejs.MetricsAggregationMixin.script as script
+    @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
+    <p>Aggregation that calculates an approximate count of distinct values.</p>
+
+    @param {String} name The name which be used to refer to this aggregation.
+
+    */
+  ejs.CardinalityAggregation = function (name) {
+
+    var
+      _common = ejs.MetricsAggregationMixin(name, 'cardinality'),
+      agg = _common.toJSON();
+
+    return extend(_common, {
+
+      /**
+      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.
+
+      @member ejs.CardinalityAggregation
+      @param {Boolean} trueFalse set to false to disable rehashing
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      rehash: function (trueFalse) {
+        if (trueFalse == null) {
+          return agg[name].cardinality.rehash;
+        }
+
+        agg[name].cardinality.rehash = trueFalse;
+        return this;
+      },
+
+      /**
+      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).
+
+      @member ejs.CardinalityAggregation
+      @param {Long} num The threshold value
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      precisionThreshold: function (num) {
+        if (num == null) {
+          return agg[name].cardinality.precision_threshold;
+        }
+
+        agg[name].cardinality.precision_threshold = num;
+        return this;
+      }
+
+    });
+
+  };
+
+  /**
+    @class
+    <p>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.</p>
+
+    @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
+
+    @desc
+    <p>Aggregation similar to the histogram except it can only be applied on
+    date values.</p>
+
+    @param {String} name The name which be used to refer to this aggregation.
+
+    */
+  ejs.DateHistogramAggregation = function (name) {
+
+    var
+      _common = ejs.BucketsAggregationMixin(name, 'date_histogram'),
+      agg = _common.toJSON();
+
+    return extend(_common, {
+
+      /**
+      Set the date time zone.
+
+      @member ejs.DateHistogramAggregation
+      @param {String} tz the time zone.
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      timeZone: function (tz) {
+        if (tz == null) {
+          return agg[name].date_histogram.time_zone;
+        }
+
+        agg[name].date_histogram.time_zone = tz;
+        return this;
+      },
+
+      /**
+      Set the pre-rouding date time zone.
+
+      @member ejs.DateHistogramAggregation
+      @param {String} tz the time zone.
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      preZone: function (tz) {
+        if (tz == null) {
+          return agg[name].date_histogram.pre_zone;
+        }
+
+        agg[name].date_histogram.pre_zone = tz;
+        return this;
+      },
+
+      /**
+      Set the post-rouding date time zone.
+
+      @member ejs.DateHistogramAggregation
+      @param {String} tz the time zone.
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      postZone: function (tz) {
+        if (tz == null) {
+          return agg[name].date_histogram.post_zone;
+        }
+
+        agg[name].date_histogram.post_zone = tz;
+        return this;
+      },
+
+      /**
+      Set the pre-rouding offset.
+
+      @member ejs.DateHistogramAggregation
+      @param {String} offset the offset.
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      preOffset: function (offset) {
+        if (offset == null) {
+          return agg[name].date_histogram.pre_offset;
+        }
+
+        agg[name].date_histogram.pre_offset = offset;
+        return this;
+      },
+
+      /**
+      Set the post-rouding offset.
+
+      @member ejs.DateHistogramAggregation
+      @param {String} offset the offset.
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      postOffset: function (offset) {
+        if (offset == null) {
+          return agg[name].date_histogram.post_offset;
+        }
+
+        agg[name].date_histogram.post_offset = offset;
+        return this;
+      },
+
+      /**
+      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.
+
+      @member ejs.DateHistogramAggregation
+      @param {(String|Long)} min The start bound / minimum bound value
+      @param {(String|Long)} max The end bound / maximum bound value
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      extendedBounds: function (min, max) {
+        var bounds;
+        if (min == null && max == null) {
+          return agg[name].date_histogram.extended_bounds;
+        }
+
+        bounds = {};
+        if (min != null) {
+          bounds.min = min;
+        }
+
+        if (max != null) {
+          bounds.max = max;
+        }
+
+        agg[name].date_histogram.extended_bounds = bounds;
+        return this;
+      },
+
+      /**
+      Sets the histogram interval.  Buckets are generated based on this interval
+      value.
+
+      @member ejs.DateHistogramAggregation
+      @param {String} i The interval
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      interval: function (i) {
+        if (i == null) {
+          return agg[name].date_histogram.interval;
+        }
+
+        agg[name].date_histogram.interval = i;
+        return this;
+      },
+
+      /**
+      Sets the format expression for the terms.  Use for number or date
+      formatting
+
+      @member ejs.DateHistogramAggregation
+      @param {String} f the format string
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      format: function (f) {
+        if (f == null) {
+          return agg[name].date_histogram.format;
+        }
+
+        agg[name].date_histogram.format = f;
+        return this;
+      },
+
+      /**
+      Enable the response to be returned as a keyed object where the key is the
+      bucket interval.
+
+      @member ejs.DateHistogramAggregation
+      @param {Boolean} trueFalse to enable keyed response or not
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      keyed: function (trueFalse) {
+        if (trueFalse == null) {
+          return agg[name].date_histogram.keyed;
+        }
+
+        agg[name].date_histogram.keyed = trueFalse;
+        return this;
+      },
+
+      /**
+      Set to true to apply interval adjusts to day and above intervals.
+
+      @member ejs.DateHistogramAggregation
+      @param {Boolean} trueFalse adjust large intervals or not
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      preZoneAdjustLargeInterval: function (trueFalse) {
+        if (trueFalse == null) {
+          return agg[name].date_histogram.pre_zone_adjust_large_interval;
+        }
+
+        agg[name].date_histogram.pre_zone_adjust_large_interval = trueFalse;
+        return this;
+      },
+
+      /**
+      Only return terms that match more than a configured number of hits.
+
+      @member ejs.DateHistogramAggregation
+      @param {Integer} num The numer of minimum number of hits.
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      minDocCount: function (num) {
+        if (num == null) {
+          return agg[name].date_histogram.min_doc_count;
+        }
+
+        agg[name].date_histogram.min_doc_count = num;
+        return this;
+      },
+
+      /**
+      Sets order for the aggregated values.
+
+      @member ejs.DateHistogramAggregation
+      @param {String} order The order string.
+      @param {String} direction The sort direction, asc or desc.
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      order: function (order, direction) {
+        if (order == null) {
+          return agg[name].date_histogram.order;
+        }
+
+        if (direction == null) {
+          direction = 'desc';
+        }
+
+        direction = direction.toLowerCase();
+        if (direction !== 'asc' && direction !== 'desc') {
+          direction = 'desc';
+        }
+
+        agg[name].date_histogram.order = {};
+        agg[name].date_histogram.order[order] = direction;
+        return this;
+      }
+
+    });
+  };
+
+  /**
+    @class
+    <p>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.</p>
+
+    <p>Note that this aggregration includes the from value and excludes the to
+    value for each range.</p>
+
+    @name ejs.DateRangeAggregation
+    @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
+    <p>Aggregation that is dedicated for date value ranges.</p>
+
+    @param {String} name The name which be used to refer to this aggregation.
+
+    */
+  ejs.DateRangeAggregation = function (name) {
+
+    var
+      _common = ejs.BucketsAggregationMixin(name, 'date_range'),
+      agg = _common.toJSON();
+
+    return extend(_common, {
+
+      /**
+      Sets the date format expression.
+
+      @member ejs.DateRangeAggregation
+      @param {String} f the format string
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      format: function (f) {
+        if (f == null) {
+          return agg[name].date_range.format;
+        }
+
+        agg[name].date_range.format = f;
+        return this;
+      },
+
+      /**
+      Adds a range to the list of exsiting range expressions.
+
+      @member ejs.DateRangeAggregation
+      @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 <code>this</code> so that calls can be chained.
+      */
+      range: function (from, to, key) {
+        var rangeObj = {};
+        if (agg[name].date_range.ranges == null) {
+          agg[name].date_range.ranges = [];
+        }
+
+        if (from == null && to == null) {
+          return agg[name].date_range.ranges;
+        }
+
+        if (from != null) {
+          rangeObj.from = from;
+        }
+
+        if (to != null) {
+          rangeObj.to = to;
+        }
+
+        if (key != null) {
+          rangeObj.key = key;
+        }
+
+        agg[name].date_range.ranges.push(rangeObj);
+        return this;
+      },
+
+      /**
+      Enable the response to be returned as a keyed object where the key is the
+      bucket interval.
+
+      @member ejs.DateRangeAggregation
+      @param {Boolean} trueFalse to enable keyed response or not
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      keyed: function (trueFalse) {
+        if (trueFalse == null) {
+          return agg[name].date_range.keyed;
+        }
+
+        agg[name].date_range.keyed = trueFalse;
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>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.</p>
+
+    <p>The extended_stats aggregations is an extended version of the
+    <code>StatsAggregation</code>, where additional metrics are added such as
+    sum_of_squares, variance and std_deviation.</p>
+
+    @name ejs.ExtendedStatsAggregation
+    @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
+    <p>Aggregation that computes extra stats over numeric values extracted from
+    the aggregated documents.</p>
+
+    @param {String} name The name which be used to refer to this aggregation.
+
+    */
+  ejs.ExtendedStatsAggregation = function (name) {
+
+    var
+      _common = ejs.MetricsAggregationMixin(name, 'extended_stats'),
+      agg = _common.toJSON();
+
+    return _common;
+  };
+
+  /**
+    @class
+    <p>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.</p>
+
+    @name ejs.FilterAggregation
+    @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
+    <p>Defines a single bucket of all the documents that match a given filter.</p>
+
+    @param {String} name The name which be used to refer to this aggregation.
+
+    */
+  ejs.FilterAggregation = function (name) {
+
+    var
+      _common = ejs.AggregationMixin(name),
+      agg = _common.toJSON();
+
+    return extend(_common, {
+
+      /**
+      <p>Sets the filter to be used for this aggregation.</p>
+
+      @member ejs.FilterAggregation
+      @param {Filter} oFilter A valid <code>Filter</code> object.
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      filter: function (oFilter) {
+        if (oFilter == null) {
+          return agg[name].filter;
+        }
+
+        if (!isFilter(oFilter)) {
+          throw new TypeError('Argument must be a Filter');
+        }
+
+        agg[name].filter = oFilter.toJSON();
+        return this;
+      }
+
+    });
+  };
+
+  /**
+    @class
+    <p>Defines a multi bucket aggregations where each bucket is 
+    associated with a filter. Each bucket will collect all documents 
+    that match its associated filter.</p>
+
+    @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
+    <p>Defines a multi bucket aggregations where each bucket is 
+    associated with a filter. Each bucket will collect all documents 
+    that match its associated filter.</p>
+
+    @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, {
+
+      /**
+      <p>Sets the filter to be used for this aggregation.</p>
+
+      @member ejs.FilterAggregation
+      @param {Filter} oFilter A valid <code>Filter</code> object.
+      @param {id} string A name for the filter.
+      @returns {Object} returns <code>this</code> 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
+    <p>A metric aggregation that computes the bounding box containing all geo_point values for a field.</p>
+
+    @name ejs.GeoBoundsAggregation
+    @ejs aggregation
+    @borrows ejs.MetricsAggregationMixin.field as field
+    @borrows ejs.AggregationMixin._type as _type
+    @borrows ejs.AggregationMixin.toJSON as toJSON
+
+    @desc
+    <p>Aggregation that computes the bounding box containing all geo_point values for a field.</p>
+
+    @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.wrapLongitude
+      @param {Boolean} trueFalse to overlap the international date line. 
+      @returns {Object} returns <code>this</code> 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
+    <p>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).</p>
+
+    @name ejs.GeoDistanceAggregation
+    @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
+    <p>Aggregation that works on geo_point fields and conceptually works very
+    similar to the range aggregation.</p>
+
+    @param {String} name The name which be used to refer to this aggregation.
+
+    */
+  ejs.GeoDistanceAggregation = function (name) {
+
+    var
+      _common = ejs.AggregationMixin(name),
+      point = ejs.GeoPoint([0, 0]),
+      agg = _common.toJSON();
+
+    agg[name].geo_distance = {};
+
+    return extend(_common, {
+
+      /**
+      <p>Sets the field to gather terms from.</p>
+
+      @member ejs.GeoDistanceAggregation
+      @param {String} field a valid field name..
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      field: function (field) {
+        if (field == null) {
+          return agg[name].geo_distance.field;
+        }
+
+        agg[name].geo_distance.field = field;
+        return this;
+      },
+
+      /**
+      Sets the distance unit.  Valid values are:
+      in, yd, ft, km, NM, mm, cm, mi, and m.
+
+      @member ejs.GeoDistanceAggregation
+      @param {Number} unit the unit of distance measure.
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      unit: function (unit) {
+        if (unit == null) {
+          return agg[name].geo_distance.unit;
+        }
+
+        if (unit === 'in' || unit === 'yd' || unit === 'ft' || unit === 'km' ||
+            unit === 'NM' || unit === 'mm' || unit === 'cm' || unit === 'mi' ||
+            unit === 'm')  {
+          agg[name].geo_distance.unit = unit;
+        }
+
+        return this;
+      },
+
+      /**
+      How to compute the distance. Valid values are:
+      plane, arc, sloppy_arc, and factor.
+
+      @member ejs.GeoDistanceAggregation
+      @param {String} type The execution type as a string.
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      distanceType: function (type) {
+        if (type == null) {
+          return agg[name].geo_distance.distance_type;
+        }
+
+        type = type.toLowerCase();
+        if (type === 'plane' || type === 'arc' || type === 'sloppy_arc' ||
+            type === 'factor') {
+          agg[name].geo_distance.distance_type = type;
+        }
+
+        return this;
+      },
+
+      /**
+      Sets the point of origin from where distances will be measured.
+
+      @member ejs.GeoDistanceAggregation
+      @param {GeoPoint} p A valid GeoPoint object
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      origin: function (p) {
+        if (p == null) {
+          return point;
+        }
+
+        if (!isGeoPoint(p)) {
+          throw new TypeError('Argument must be a GeoPoint');
+        }
+
+        point = p;
+        agg[name].geo_distance.origin = p.toJSON();
+        return this;
+      },
+
+      /**
+      Sets the point of origin from where distances will be measured. Same as
+      origin.
+
+      @member ejs.GeoDistanceAggregation
+      @param {GeoPoint} p A valid GeoPoint object
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      point: function (p) {
+        if (p == null) {
+          return point;
+        }
+
+        if (!isGeoPoint(p)) {
+          throw new TypeError('Argument must be a GeoPoint');
+        }
+
+        point = p;
+        agg[name].geo_distance.point = p.toJSON();
+        return this;
+      },
+
+      /**
+      Sets the point of origin from where distances will be measured. Same as
+      origin.
+
+      @member ejs.GeoDistanceAggregation
+      @param {GeoPoint} p A valid GeoPoint object
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      center: function (p) {
+        if (p == null) {
+          return point;
+        }
+
+        if (!isGeoPoint(p)) {
+          throw new TypeError('Argument must be a GeoPoint');
+        }
+
+        point = p;
+        agg[name].geo_distance.center = p.toJSON();
+        return this;
+      },
+
+      /**
+      Adds a range to the list of exsiting range expressions.
+
+      @member ejs.GeoDistanceAggregation
+      @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 <code>this</code> so that calls can be chained.
+      */
+      range: function (from, to, key) {
+        var rangeObj = {};
+        if (agg[name].geo_distance.ranges == null) {
+          agg[name].geo_distance.ranges = [];
+        }
+
+        if (from == null && to == null) {
+          return agg[name].geo_distance.ranges;
+        }
+
+        if (from != null) {
+          rangeObj.from = from;
+        }
+
+        if (to != null) {
+          rangeObj.to = to;
+        }
+
+        if (key != null) {
+          rangeObj.key = key;
+        }
+
+        agg[name].geo_distance.ranges.push(rangeObj);
+        return this;
+      },
+
+      /**
+      Enable the response to be returned as a keyed object where the key is the
+      bucket interval.
+
+      @member ejs.GeoDistanceAggregation
+      @param {Boolean} trueFalse to enable keyed response or not
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      keyed: function (trueFalse) {
+        if (trueFalse == null) {
+          return agg[name].geo_distance.keyed;
+        }
+
+        agg[name].geo_distance.keyed = trueFalse;
+        return this;
+      }
+
+    });
+  };
+
+  /**
+    @class
+    <p>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.</p>
+
+    @name ejs.GeoHashGridAggregation
+    @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
+    <p>Aggregation that works on geo_point fields and groups points into buckets
+    that represent cells in a grid.</p>
+
+    @param {String} name The name which be used to refer to this aggregation.
+
+    */
+  ejs.GeoHashGridAggregation = function (name) {
+
+    var
+      _common = ejs.AggregationMixin(name),
+      agg = _common.toJSON();
+
+    agg[name].geohash_grid = {};
+
+    return extend(_common, {
+
+      /**
+      Sets the geo field to perform calculations from.
+
+      @member ejs.GeoHashGridAggregation
+      @param {String} field a valid field name.
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      field: function (field) {
+        if (field == null) {
+          return agg[name].geohash_grid.field;
+        }
+
+        agg[name].geohash_grid.field = field;
+        return this;
+      },
+
+      /**
+      Sets the Geo Hash precision.  The precision value can be between 1 and 12
+      where 12 is the highest precision.
+
+      @member ejs.GeoHashGridAggregation
+      @param {Integer} p The precision.  Integer between 1 and 12.
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      precision: function (p) {
+        if (p == null) {
+          return agg[name].geohash_grid.precision;
+        }
+
+        agg[name].geohash_grid.precision = p;
+        return this;
+      },
+
+      /**
+      Sets the number of aggregation entries that will be returned.
+
+      @member ejs.GeoHashGridAggregation
+      @param {Integer} size The numer of aggregation entries to be returned.
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      size: function (size) {
+        if (size == null) {
+          return agg[name].geohash_grid.size;
+        }
+
+        agg[name].geohash_grid.size = size;
+        return this;
+      },
+
+
+      /**
+      Determines how many geohash_grid the coordinating node will request from
+      each shard.
+
+      @member ejs.GeoHashGridAggregation
+      @param {Integer} shardSize The numer of geohash_grid to fetch from each shard.
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      shardSize: function (shardSize) {
+        if (shardSize == null) {
+          return agg[name].geohash_grid.shard_size;
+        }
+
+        agg[name].geohash_grid.shard_size = shardSize;
+        return this;
+      }
+
+    });
+  };
+
+  /**
+    @class
+    <p>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.</p>
+
+    @name ejs.GlobalAggregation
+    @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
+    <p>Defines a single bucket of all the documents within the search context.</p>
+
+    @param {String} name The name which be used to refer to this aggregation.
+
+    */
+  ejs.GlobalAggregation = function (name) {
+
+    var
+      _common = ejs.AggregationMixin(name),
+      agg = _common.toJSON();
+
+    agg[name].global = {};
+
+    return _common;
+  };
+
+  /**
+    @class
+    <p>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.</p>
+
+    @name ejs.HistogramAggregation
+    @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
+    <p>Aggregation that can be applied on numeric values extracted from the
+    documents.</p>
+
+    @param {String} name The name which be used to refer to this aggregation.
+
+    */
+  ejs.HistogramAggregation = function (name) {
+
+    var
+      _common = ejs.BucketsAggregationMixin(name, 'histogram'),
+      agg = _common.toJSON();
+
+    return extend(_common, {
+
+      /**
+      Sets the format expression for the terms.  Use for number or date
+      formatting
+
+      @member ejs.HistogramAggregation
+      @param {String} f the format string
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      format: function (f) {
+        if (f == null) {
+          return agg[name].histogram.format;
+        }
+
+        agg[name].histogram.format = f;
+        return this;
+      },
+
+      /**
+      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.
+
+      @member ejs.HistogramAggregation
+      @param {Long} min The start bound / minimum bound value
+      @param {Long} max The end bound / maximum bound value
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      extendedBounds: function (min, max) {
+        var bounds;
+        if (min == null && max == null) {
+          return agg[name].histogram.extended_bounds;
+        }
+
+        bounds = {};
+        if (min != null) {
+          bounds.min = min;
+        }
+
+        if (max != null) {
+          bounds.max = max;
+        }
+
+        agg[name].histogram.extended_bounds = bounds;
+        return this;
+      },
+
+      /**
+      Sets the histogram interval.  Buckets are generated based on this interval
+      value.
+
+      @member ejs.HistogramAggregation
+      @param {Integer} i The interval
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      interval: function (i) {
+        if (i == null) {
+          return agg[name].histogram.interval;
+        }
+
+        agg[name].histogram.interval = i;
+        return this;
+      },
+
+      /**
+      Only return terms that match more than a configured number of hits.
+
+      @member ejs.HistogramAggregation
+      @param {Integer} num The numer of minimum number of hits.
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      minDocCount: function (num) {
+        if (num == null) {
+          return agg[name].histogram.min_doc_count;
+        }
+
+        agg[name].histogram.min_doc_count = num;
+        return this;
+      },
+
+      /**
+      Enable the response to be returned as a keyed object where the key is the
+      bucket interval.
+
+      @member ejs.HistogramAggregation
+      @param {Boolean} trueFalse to enable keyed response or not
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      keyed: function (trueFalse) {
+        if (trueFalse == null) {
+          return agg[name].histogram.keyed;
+        }
+
+        agg[name].histogram.keyed = trueFalse;
+        return this;
+      },
+
+      /**
+      Sets order for the aggregated values.
+
+      @member ejs.HistogramAggregation
+      @param {String} order The order string.
+      @param {String} direction The sort direction, asc or desc.
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      order: function (order, direction) {
+        if (order == null) {
+          return agg[name].histogram.order;
+        }
+
+        if (direction == null) {
+          direction = 'desc';
+        }
+
+        direction = direction.toLowerCase();
+        if (direction !== 'asc' && direction !== 'desc') {
+          direction = 'desc';
+        }
+
+        agg[name].histogram.order = {};
+        agg[name].histogram.order[order] = direction;
+        return this;
+      }
+
+    });
+  };
+
+  /**
+    @class
+    <p>A dedicated range aggregation for IPv4 typed fields.</p>
+
+    <p>Note that this aggregration includes the from value and excludes the to
+    value for each range.</p>
+
+    @name ejs.IPv4RangeAggregation
+    @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
+    <p>A dedicated range aggregation for IPv4 typed fields.</p>
+
+    @param {String} name The name which be used to refer to this aggregation.
+
+    */
+  ejs.IPv4RangeAggregation = function (name) {
+
+    var
+      _common = ejs.BucketsAggregationMixin(name, 'ip_range'),
+      agg = _common.toJSON();
+
+    return extend(_common, {
+
+      /**
+      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 <code>this</code> 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);
+        return this;
+      },
+
+      /**
+      Enable the response to be returned as a keyed object where the key is the
+      bucket interval.
+
+      @member ejs.IPv4RangeAggregation
+      @param {Boolean} trueFalse to enable keyed response or not
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      keyed: function (trueFalse) {
+        if (trueFalse == null) {
+          return agg[name].ip_range.keyed;
+        }
+
+        agg[name].ip_range.keyed = trueFalse;
+        return this;
+      }
+
+    });
+  };
+
+  /**
+    @class
+    <p>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.</p>
+
+    @name ejs.MaxAggregation
+    @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
+    <p>Aggregation that keeps track and returns the maximum value among the
+    numeric values extracted from the aggregated documents.</p>
+
+    @param {String} name The name which be used to refer to this aggregation.
+
+    */
+  ejs.MaxAggregation = function (name) {
+
+    var
+      _common = ejs.MetricsAggregationMixin(name, 'max'),
+      agg = _common.toJSON();
+
+    return _common;
+  };
+
+  /**
+    @class
+    <p>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.</p>
+
+    @name ejs.MinAggregation
+    @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
+    <p>Aggregation that keeps track and returns the minimum value among numeric
+    values extracted from the aggregated documents.</p>
+
+    @param {String} name The name which be used to refer to this aggregation.
+
+    */
+  ejs.MinAggregation = function (name) {
+
+    var
+      _common = ejs.MetricsAggregationMixin(name, 'min'),
+      agg = _common.toJSON();
+
+    return _common;
+  };
+
+  /**
+    @class
+    <p>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).</p>
+
+    @name ejs.MissingAggregation
+    @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
+    <p>Defines a bucket of all documents that are missing a field value.</p>
+
+    @param {String} name The name which be used to refer to this aggregation.
+
+    */
+  ejs.MissingAggregation = function (name) {
+
+    var
+      _common = ejs.AggregationMixin(name),
+      agg = _common.toJSON();
+
+    agg[name].missing = {};
+
+    return extend(_common, {
+
+      /**
+      <p>Sets the field to gather missing terms from.</p>
+
+      @member ejs.MissingAggregation
+      @param {String} field a valid field name..
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      field: function (field) {
+        if (field == null) {
+          return agg[name].missing.field;
+        }
+
+        agg[name].missing.field = field;
+        return this;
+      }
+
+    });
+  };
+
+  /**
+    @class
+    <p>A special single bucket aggregation that enables aggregating nested
+    documents.</p>
+
+    @name ejs.NestedAggregation
+    @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
+    <p>A special single bucket aggregation that enables aggregating nested
+    documents.</p>
+
+    @param {String} name The name which be used to refer to this aggregation.
+
+    */
+  ejs.NestedAggregation = function (name) {
+
+    var
+      _common = ejs.AggregationMixin(name),
+      agg = _common.toJSON();
+
+    agg[name].nested = {};
+
+    return extend(_common, {
+
+      /**
+      <p>Sets the nested path.</p>
+
+      @member ejs.NestedAggregation
+      @param {String} path The nested path value.
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      path: function (path) {
+        if (path == null) {
+          return agg[name].nested.path;
+        }
+
+        agg[name].nested.path = path;
+        return this;
+      }
+
+    });
+  };
+
+  /**
+    @class
+    <p>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.</p>
+
+    @name ejs.PercentilesAggregation
+    @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
+    <p>Aggregation that calculates one or more percentiles over numeric values
+    extracted from the aggregated documents.</p>
+
+    @param {String} name The name which be used to refer to this aggregation.
+
+    */
+  ejs.PercentilesAggregation = function (name) {
+
+    var
+      _common = ejs.MetricsAggregationMixin(name, 'percentiles'),
+      agg = _common.toJSON();
+
+    return extend(_common, {
+
+      /**
+      Enable the response to be returned as a keyed object where the key is the
+      bucket interval.
+
+      @member ejs.PercentilesAggregation
+      @param {Boolean} trueFalse to enable keyed response or not
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      keyed: function (trueFalse) {
+        if (trueFalse == null) {
+          return agg[name].percentiles.keyed;
+        }
+
+        agg[name].percentiles.keyed = trueFalse;
+        return this;
+      },
+
+      /**
+      Sets the percentile bucket array.  Overwrites all existing values.
+
+      @member ejs.PercentilesAggregation
+      @param {Double[]} percents A double array of percentiles
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      percents: function (percentArr) {
+        if (percentArr == null) {
+          return agg[name].percentiles.percents;
+        }
+
+        if (!isArray(percentArr)) {
+          throw new TypeError('Percents must be an array of doubles');
+        }
+
+        agg[name].percentiles.percents = percentArr;
+        return this;
+      },
+
+      /**
+      Add a single percentile to the current list of percentiles.
+
+      @member ejs.PercentilesAggregation
+      @param {Double} percentile A double percentile value to add
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      percent: function (percentile) {
+        if (agg[name].percentiles.percents == null) {
+          agg[name].percentiles.percents = [];
+        }
+
+        if (percentile == null) {
+          return agg[name].percentiles.percents;
+        }
+
+        agg[name].percentiles.percents.push(percentile);
+        return this;
+      },
+
+      /**
+      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.
+
+      @member ejs.PercentilesAggregation
+      @param {Integer} c The compression level.
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      compression: function (c) {
+        if (c == null) {
+          return agg[name].percentiles.compression;
+        }
+
+        agg[name].percentiles.compression = c;
+        return this;
+      }
+
+    });
+  };
+
+  /**
+    @class
+    <p>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.</p>
+
+    <p>Note that this aggregration includes the from value and excludes the to
+    value for each range.</p>
+
+    @name ejs.RangeAggregation
+    @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
+    <p>Aggregation that enables the user to define a set of ranges that each
+    represent a bucket.</p>
+
+    @param {String} name The name which be used to refer to this aggregation.
+
+    */
+  ejs.RangeAggregation = function (name) {
+
+    var
+      _common = ejs.BucketsAggregationMixin(name, 'range'),
+      agg = _common.toJSON();
+
+    return extend(_common, {
+
+      /**
+      Adds a range to the list of exsiting range expressions.
+
+      @member ejs.RangeAggregation
+      @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 <code>this</code> so that calls can be chained.
+      */
+      range: function (from, to, key) {
+        var rangeObj = {};
+        if (agg[name].range.ranges == null) {
+          agg[name].range.ranges = [];
+        }
+
+        if (from == null && to == null) {
+          return agg[name].range.ranges;
+        }
+
+        if (from != null) {
+          rangeObj.from = from;
+        }
+
+        if (to != null) {
+          rangeObj.to = to;
+        }
+
+        if (key != null) {
+          rangeObj.key = key;
+        }
+
+        agg[name].range.ranges.push(rangeObj);
+        return this;
+      },
+
+      /**
+      Enable the response to be returned as a keyed object where the key is the
+      bucket interval.
+
+      @member ejs.RangeAggregation
+      @param {Boolean} trueFalse to enable keyed response or not
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      keyed: function (trueFalse) {
+        if (trueFalse == null) {
+          return agg[name].range.keyed;
+        }
+
+        agg[name].range.keyed = trueFalse;
+        return this;
+      },
+
+    });
+  };
+
+  /**
+    @class
+    <p>A metric aggregation that executes using scripts to provide a metric output.</p>
+
+    @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
+    <p>Aggregation that keeps track and returns the minimum value among numeric
+    values extracted from the aggregated documents.</p>
+
+    @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, {
+
+      /**
+      <p>Sets the initialization script.</p>
+
+      @member ejs.ScriptedMetricAggregation
+      @param {String} initScript The initialization script
+      @returns {Object} returns <code>this</code> 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;
+      },
+
+      /**
+      <p>Sets the map script. This is the only required script.</p>
+      @member ejs.ScriptedMetricAggregation
+      @param {String} mapScript The map script.
+      @returns {Object} returns <code>this</code> 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;
+      },
+
+      /**
+      <p>Sets the combine phase script.</p>
+      @member ejs.ScriptedMetricAggregation
+      @param {String} combineScript The combine script.
+      @returns {Object} returns <code>this</code> 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;
+      },
+
+      /**
+      <p>Sets the combine phase script.</p>
+      @member ejs.ScriptedMetricAggregation
+      @param {String} reduceScript The reduce script.
+      @returns {Object} returns <code>this</code> 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;
+      },
+
+      /**
+      <p>Sets the init_script_file.</p>
+
+      @member ejs.ScriptedMetricAggregation
+      @param {String} init_script_file A valid script file name.
+      @returns {Object} returns <code>this</code> 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;
+      },
+
+      /**
+      <p>Sets the init_script_id.</p>
+
+      @member ejs.ScriptedMetricAggregation
+      @param {String} init_script_id A valid id from indexed script.
+      @returns {Object} returns <code>this</code> 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;
+      },
+        
+      /**
+      <p>Sets the map_script_file.</p>
+
+      @member ejs.ScriptedMetricAggregation
+      @param {String} map_script_file A valid script file name.
+      @returns {Object} returns <code>this</code> 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;
+      },
+
+      /**
+      <p>Sets the map_script_id.</p>
+
+      @member ejs.ScriptedMetricAggregation
+      @param {String} map_script_id A valid id from indexed script.
+      @returns {Object} returns <code>this</code> 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;
+      },
+
+      /**
+      <p>Sets the combine_script_file.</p>
+
+      @member ejs.ScriptedMetricAggregation
+      @param {String} combine_script_file A valid script file name.
+      @returns {Object} returns <code>this</code> 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;
+      },
+        
+      /**
+      <p>Sets the combine_script_id.</p>
+
+      @member ejs.ScriptedMetricAggregation
+      @param {String} combine_script_id A valid id from indexed script.
+      @returns {Object} returns <code>this</code> 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;
+      },
+
+      /**
+      <p>Sets the reduce_script_file.</p>
+
+      @member ejs.ScriptedMetricAggregation
+      @param {String} reduce_script_file A valid script file name.
+      @returns {Object} returns <code>this</code> 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;
+      },
+
+      /**
+      <p>Sets the reduce_script_id.</p>
+
+      @member ejs.ScriptedMetricAggregation
+      @param {String} reduce_script_id A valid id from indexed script.
+      @returns {Object} returns <code>this</code> 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;
+      },
+
+      /**
+      <p>Set parameters which will be passed to the init, map and combine scripts.</p>
+      @member ejs.ScriptedMetricAggregation
+      @param {String} params Parameters passed to the init, map and combine scripts.
+      @returns {Object} returns <code>this</code> 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;
+      },
+
+      /**
+      <p>Set parameters which will be passed to the reduce script.</p>
+      @member ejs.ScriptedMetricAggregation
+      @param {String} reduceParams Paramters to pass to the recude script.
+      @returns {Object} returns <code>this</code> 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;
+      },
+
+      /**
+      <p>Set the scripting language used for this aggregation.</p>
+      @member ejs.ScriptedMetricAggregation
+      @param {String} lang The script langauge.
+      @returns {Object} returns <code>this</code> 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;
+      }
+    });
+  };
+
+  /**
+    @class
+    <p>An aggregation that returns interesting or unusual occurrences of terms in
+    a set.</p>
+
+    @name ejs.SignificantTermsAggregation
+    @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
+    <p>An aggregation that returns interesting or unusual occurrences of terms in
+    a set.</p>
+
+    @param {String} name The name which be used to refer to this aggregation.
+
+    */
+  ejs.SignificantTermsAggregation = function (name) {
+
+    var
+      _common = ejs.AggregationMixin(name),
+      agg = _common.toJSON();
+
+    agg[name].significant_terms = {};
+
+    return extend(_common, {
+
+      /**
+      <p>Sets the field to gather terms from.</p>
+
+      @member ejs.SignificantTermsAggregation
+      @param {String} field a valid field name..
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      field: function (field) {
+        if (field == null) {
+          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.
+
+      @member ejs.SignificantTermsAggregation
+      @param {String} f the format string
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      format: function (f) {
+        if (f == null) {
+          return agg[name].significant_terms.format;
+        }
+
+        agg[name].significant_terms.format = f;
+        return this;
+      },
+
+      /**
+      <p>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.</p>
+
+      @member ejs.SignificantTermsAggregation
+      @param {String} include A regular expression include string
+      @param {String} flags Optional regular expression flags..
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      include: function (include, flags) {
+        if (agg[name].significant_terms.include == null) {
+          agg[name].significant_terms.include = {};
+        }
+
+        if (include == null) {
+          return agg[name].significant_terms.include;
+        }
+
+        agg[name].significant_terms.include.pattern = include;
+        if (flags != null) {
+          agg[name].significant_terms.include.flags = flags;
+        }
+
+        return this;
+      },
+
+      /**
+      <p>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.</p>
+
+      @member ejs.SignificantTermsAggregation
+      @param {String} exclude A regular expression exclude string
+      @param {String} flags Optional regular expression flags..
+      @returns {Object} returns <code>this</code> 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;
+        }
+
+        return this;
+      },
+
+      /**
+      Sets the execution hint determines how the aggregation is computed.
+      Supported values are: map and ordinals.
+
+      @member ejs.SignificantTermsAggregation
+      @param {String} h The hint value as a string.
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      executionHint: function (h) {
+        if (h == null) {
+          return agg[name].significant_terms.execution_hint;
+        }
+
+        h = h.toLowerCase();
+        if (h === 'map' || h === 'ordinals') {
+          agg[name].significant_terms.execution_hint = h;
+        }
+
+        return this;
+      },
+
+      /**
+      Sets the number of aggregation entries that will be returned.
+
+      @member ejs.SignificantTermsAggregation
+      @param {Integer} size The numer of aggregation entries to be returned.
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      size: function (size) {
+        if (size == null) {
+          return agg[name].significant_terms.size;
+        }
+
+        agg[name].significant_terms.size = size;
+        return this;
+      },
+
+
+      /**
+      Determines how many terms the coordinating node will request from
+      each shard.
+
+      @member ejs.SignificantTermsAggregation
+      @param {Integer} shardSize The numer of terms to fetch from each shard.
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      shardSize: function (shardSize) {
+        if (shardSize == null) {
+          return agg[name].significant_terms.shard_size;
+        }
+
+        agg[name].significant_terms.shard_size = shardSize;
+        return this;
+      },
+
+      /**
+      Only return terms that match more than a configured number of hits.
+
+      @member ejs.SignificantTermsAggregation
+      @param {Integer} num The numer of minimum number of hits.
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      minDocCount: function (num) {
+        if (num == null) {
+          return agg[name].significant_terms.min_doc_count;
+        }
+
+        agg[name].significant_terms.min_doc_count = num;
+        return this;
+      }
+
+    });
+  };
+
+  /**
+    @class
+    <p>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.</p>
+
+    <p>The stats that are returned consist of: min, max, sum, count and avg.</p>
+
+    @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
+    <p>Aggregation that computes stats over numeric values extracted from the
+    aggregated documents.</p>
+
+    @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
+    <p>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.</p>
+
+    @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
+
+    @desc
+    <p>Aggregation that sums up numeric values that are extracted from the
+    aggregated documents.</p>
+
+    @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
+    <p>A multi-bucket value source based aggregation where buckets are dynamically
+    built - one per unique value.</p>
+
+    @name ejs.TermsAggregation
+    @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
+    <p>Defines an aggregation of unique values/terms.</p>
+
+    @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 <code>this</code> so that calls can be chained.
+      */
+      format: function (f) {
+        if (f == null) {
+          return agg[name].terms.format;
+        }
+
+        agg[name].terms.format = f;
+        return this;
+      },
+
+      /**
+      <p>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.</p>
+
+      @member ejs.TermsAggregation
+      @param {String} include A regular expression include string
+      @param {String} flags Optional regular expression flags..
+      @returns {Object} returns <code>this</code> 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;
+      },
+
+      /**
+      <p>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.</p>
+
+      @member ejs.TermsAggregation
+      @param {String} exclude A regular expression exclude string
+      @param {String} flags Optional regular expression flags..
+      @returns {Object} returns <code>this</code> 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 <code>this</code> 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 <code>this</code> 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 <code>this</code> 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 <code>this</code> 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.
+      @param {String} direction The sort direction, asc or desc.
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      order: function (order, direction) {
+        if (order == null) {
+          return agg[name].terms.order;
+        }
+
+        if (direction == null) {
+          direction = 'desc';
+        }
+
+        direction = direction.toLowerCase();
+        if (direction !== 'asc' && direction !== 'desc') {
+          direction = 'desc';
+        }
+
+        agg[name].terms.order = {};
+        agg[name].terms.order[order] = direction;
+        return this;
+      }
+
+    });
+  };
+
+  /**
+    @class
+    <p>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. </p>
+
+    @name ejs.TopHitsAggregation
+    @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
+    <p>top_hits metric aggregator keeps track of the most relevant document being
+    aggregated.</p>
+
+    @param {String} name The name which be used to refer to this aggregation.
+
+    */
+  ejs.TopHitsAggregation = function (name) {
+
+    var
+    _common = ejs.MetricsAggregationMixin(name, 'top_hits'),
+    agg = _common.toJSON();
+
+    return extend(_common, {
+      /**
+      <p> The offset from the first result you want to fetch. </p>
+
+      @member ejs.TopHitsAggregation
+      @param {Integer} from The offset from the first result you want to fetch.
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      from: function (from) {
+        if (from === null) {
+          return agg[name].top_hits.from;
+        }
+
+        agg[name].top_hits.from = from;
+        return this;
+      },
+
+      /**
+      <p> Sets the maximum number of top matching hits to return per bucket. </p>
+
+      @member ejs.TopHitsAggregation
+      @param {Integer} size The numer of aggregation entries to be returned per bucket.
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      size: function (size) {
+        if (size === null) {
+          return agg[name].top_hits.size;
+        }
+
+        agg[name].top_hits.size = size;
+        return this;
+      },
+
+      /**
+      <p>The maximum number of top matching hits to return per bucket.</p>
+
+      @member ejs.TopHitsAggregation
+      @param {Array} sort How to sort the the top matching hits
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      sort: function (sort) {
+        if (sort === null) {
+          return agg[name].top_hits.sort;
+        }
+
+        agg[name].top_hits.sort = sort;
+        return this;
+      },
+
+      /**
+      <p>Enables score computation and tracking during sorting.
+      By default, sorting scores are not computed. <p/>
+
+      @member ejs.TopHitsAggregation
+      @param {Boolean} trueFalse If scores should be computed and tracked.
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      trackScores: function (trueFalse) {
+        if (trueFalse === null) {
+          return agg[name].top_hits.track_scores;
+        }
+
+        agg[name].top_hits.track_scores = trueFalse;
+        return this;
+      },
+
+      /**
+      <p>Enable/Disable returning version number for each hit.</p>
+
+      @member ejs.TopHitsAggregation
+      @param {Boolean} trueFalse true to enable, false to disable
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      version: function (trueFalse) {
+        if (trueFalse === null) {
+          return agg[name].top_hits.version;
+        }
+
+        agg[name].top_hits.version = trueFalse;
+        return this;
+      },
+
+      /**
+      <p>Enable/Disable explanation of score for each hi.</p>
+
+      @member ejs.TopHitsAggregation
+      @param {Boolean} trueFalse true to enable, false to disable
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      explain: function (trueFalse) {
+        if (trueFalse === null) {
+          return agg[name].top_hits.explain;
+        }
+
+        agg[name].top_hits.explain = trueFalse;
+        return this;
+      },
+
+      /**
+      <p>Performs highlighting based on the <code>Highlight</code> settings.</p>
+
+      @member ejs.TopHitsAggregation
+      @param {Highlight} h A valid Highlight object
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      highlight: function (h) {
+        if (h === null) {
+          return agg[name].top_hits.highlight;
+        }
+
+        if (!isHighlight(h)) {
+          throw new TypeError('Argument must be a Highlight object');
+        }
+
+        agg[name].top_hits.highlight = h.toJSON();
+        return this;
+      },
+
+      /**
+      <p>Computes a document property dynamically based on the supplied <code>ScriptField</code>.</p>
+
+      @member ejs.TopHitsAggregation
+      @param {ScriptField} oScriptField A valid <code>ScriptField</code>.
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      scriptField: function (oScriptField) {
+        if (oScriptField === null) {
+          return agg[name].top_hits.script_fields;
+        }
+
+        if (agg[name].top_hits.script_fields === undefined) {
+          agg[name].top_hits.script_fields = {};
+        }
+
+        if (!isScriptField(oScriptField)) {
+          throw new TypeError('Argument must be a ScriptField');
+        }
+
+        extend(agg[name].top_hits.script_fields, oScriptField.toJSON());
+        return this;
+      },
+
+    /**
+      <p>Allows to return the field data representation of a field for each hit.</p>
+
+      @member ejs.TopHitsAggregation
+      @param {Array} Fields to return field data representation for.
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      fieldDataFields: function (fielddata_fields) {
+        if (fielddata_fields === null) {
+          return agg[name].top_hits.fielddata_fields;
+        }
+
+        agg[name].top_hits.fielddata_fields = fielddata_fields;
+        return this;
+      },
+
+      /**
+      <p> 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. </p>
+
+       @member ejs.TopHitsAggregation
+       @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 <code>this</code> so that calls can be chained.
+       */
+      source: function (includes, excludes) {
+        if (includes === undefined && excludes === undefined) {
+          return agg[name].top_hits._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)) {
+          agg[name].top_hits._source = includes;
+        } else {
+          agg[name].top_hits._source = {
+            includes: includes
+          };
+
+          if (excludes != null) {
+            agg[name].top_hits._source.excludes = excludes;
+          }
+        }
+
+        return this;
+      }
+    });
+  };
+
+  /**
+    @class
+    <p>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.</p>
+
+    @name ejs.ValueCountAggregation
+    @ejs aggregation
+    @borrows ejs.MetricsAggregationMixin.field as field
+    @borrows ejs.MetricsAggregationMixin.script as script
+    @borrows ejs.MetricsAggregationMixin.lang asr  lang
+    @borrows ejs.MetricsAggregationMixin.params as params
+    @borrows ejs.AggregationMixin._type as _type
+    @borrows ejs.AggregationMixin.toJSON as toJSON
+
+    @desc
+    <p>Aggregation that counts the number of values that are extracted from the
+    aggregated documents.</p>
+
+    @param {String} name The name which be used to refer to this aggregation.
+
+    */
+  ejs.ValueCountAggregation = function (name) {
+
+    var
+      _common = ejs.MetricsAggregationMixin(name, 'value_count'),
+      agg = _common.toJSON();
+
+    return _common;
+
+  };
+
+  /**
+    @class
+    A container Filter that allows Boolean AND composition of Filters.
+
+    @name ejs.AndFilter
+    @ejs filter
+    @borrows ejs.FilterMixin.name as name
+    @borrows ejs.FilterMixin.cache as cache
+    @borrows ejs.FilterMixin.cacheKey as cacheKey
+    @borrows ejs.FilterMixin._type as _type
+    @borrows ejs.FilterMixin.toJSON as toJSON
+
+    @desc
+    A container Filter that allows Boolean AND composition of Filters.
+
+    @param {(Filter|Filter[])} f A single Filter object or an array of valid 
+      Filter objects.
+    */
+  ejs.AndFilter = function (f) {
+
+    var
+      i,
+      len,
+      _common = ejs.FilterMixin('and'),
+      filter = _common.toJSON();
+    
+    filter.and.filters = [];
+    
+    if (isFilter(f)) {
+      filter.and.filters.push(f.toJSON());
+    } else if (isArray(f)) {
+      for (i = 0, len = f.length; i < len; i++) {
+        if (!isFilter(f[i])) {
+          throw new TypeError('Array must contain only Filter objects');
+        }
+        
+        filter.and.filters.push(f[i].toJSON());
+      }
+    } else {
+      throw new TypeError('Argument must be a Filter or Array of Filters');
+    }
+
+    return extend(_common, {
+
+      /**
+             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.
+
+             @member ejs.AndFilter
+             @param {(Filter|Filter[])} fltr A valid filter object or an array of filters.
+             @returns {Object} returns <code>this</code> so that calls can be chained.
+             */
+      filters: function (fltr) {
+        var i,
+          len;
+          
+        if (fltr == null) {
+          return filter.and.filters;
+        }
+      
+        if (isFilter(fltr)) {
+          filter.and.filters.push(fltr.toJSON());
+        } else if (isArray(fltr)) {
+          filter.and.filters = [];
+          for (i = 0, len = fltr.length; i < len; i++) {
+            if (!isFilter(fltr[i])) {
+              throw new TypeError('Array must contain only Filter objects');
+            }
+            
+            filter.and.filters.push(fltr[i].toJSON());
+          }
+        } else {
+          throw new TypeError('Argument must be a Filter or an Array of Filters');
+        }
+        
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>A <code>BoolFilter</code> allows you to build <em>Boolean</em> 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.
+  
+    @name ejs.BoolFilter
+    @ejs filter
+    @borrows ejs.FilterMixin.name as name
+    @borrows ejs.FilterMixin.cache as cache
+    @borrows ejs.FilterMixin.cacheKey as cacheKey
+    @borrows ejs.FilterMixin._type as _type
+    @borrows ejs.FilterMixin.toJSON as toJSON
+
+    @desc
+    A Filter that matches documents matching boolean combinations of other
+    filters.
+
+    */
+  ejs.BoolFilter = function () {
+
+    var
+      _common = ejs.FilterMixin('bool'),
+      filter = _common.toJSON();
+
+    return extend(_common, {
+
+      /**
+             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.
+
+             @member ejs.BoolFilter
+             @param {(Filter|Filter[])} oFilter A valid Filter or array of
+              Filter objects.
+             @returns {Object} returns <code>this</code> so that calls can be chained.
+             */
+      must: function (oFilter) {
+        var i, len;
+        
+        if (filter.bool.must == null) {
+          filter.bool.must = [];
+        }
+    
+        if (oFilter == null) {
+          return filter.bool.must;
+        }
+
+        if (isFilter(oFilter)) {
+          filter.bool.must.push(oFilter.toJSON());
+        } else if (isArray(oFilter)) {
+          filter.bool.must = [];
+          for (i = 0, len = oFilter.length; i < len; i++) {
+            if (!isFilter(oFilter[i])) {
+              throw new TypeError('Argument must be an array of Filters');
+            }
+            
+            filter.bool.must.push(oFilter[i].toJSON());
+          }
+        } else {
+          throw new TypeError('Argument must be a Filter or array of Filters');
+        }
+        
+        return this;
+      },
+
+      /**
+             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.
+
+             @member ejs.BoolFilter
+             @param {(Filter|Filter[])} oFilter A valid Filter or array of
+               Filter objects.
+             @returns {Object} returns <code>this</code> so that calls can be chained.
+             */
+      mustNot: function (oFilter) {
+        var i, len;
+        
+        if (filter.bool.must_not == null) {
+          filter.bool.must_not = [];
+        }
+
+        if (oFilter == null) {
+          return filter.bool.must_not;
+        }
+    
+        if (isFilter(oFilter)) {
+          filter.bool.must_not.push(oFilter.toJSON());
+        } else if (isArray(oFilter)) {
+          filter.bool.must_not = [];
+          for (i = 0, len = oFilter.length; i < len; i++) {
+            if (!isFilter(oFilter[i])) {
+              throw new TypeError('Argument must be an array of Filters');
+            }
+            
+            filter.bool.must_not.push(oFilter[i].toJSON());
+          }
+        } else {
+          throw new TypeError('Argument must be a Filter or array of Filters');
+        }
+        
+        return this;
+      },
+
+      /**
+             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.
+
+             @member ejs.BoolFilter
+             @param {(Filter|Filter[])} oFilter A valid Filter or array of
+                Filter objects.
+             @returns {Object} returns <code>this</code> so that calls can be chained.
+             */
+      should: function (oFilter) {
+        var i, len;
+        
+        if (filter.bool.should == null) {
+          filter.bool.should = [];
+        }
+
+        if (oFilter == null) {
+          return filter.bool.should;
+        }
+    
+        if (isFilter(oFilter)) {
+          filter.bool.should.push(oFilter.toJSON());
+        } else if (isArray(oFilter)) {
+          filter.bool.should = [];
+          for (i = 0, len = oFilter.length; i < len; i++) {
+            if (!isFilter(oFilter[i])) {
+              throw new TypeError('Argument must be an array of Filters');
+            }
+            
+            filter.bool.should.push(oFilter[i].toJSON());
+          }
+        } else {
+          throw new TypeError('Argument must be a Filter or array of Filters');
+        }
+        
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>An existsFilter matches documents where the specified field is present
+    and the field contains a legitimate value.</p>
+
+    @name ejs.ExistsFilter
+    @ejs filter
+    @borrows ejs.FilterMixin.name as name
+    @borrows ejs.FilterMixin.cache as cache
+    @borrows ejs.FilterMixin.cacheKey as cacheKey
+    @borrows ejs.FilterMixin._type as _type
+    @borrows ejs.FilterMixin.toJSON as toJSON
+
+    @desc
+    Filters documents where a specified field exists and contains a value.
+
+    @param {String} fieldName the field name that must exists and contain a value.
+    */
+  ejs.ExistsFilter = function (fieldName) {
+
+    var 
+      _common = ejs.FilterMixin('exists'),
+      filter = _common.toJSON();
+    
+    filter.exists.field = fieldName;
+
+    return extend(_common, {
+
+      /**
+            Sets the field to check for missing values.
+
+            @member ejs.ExistsFilter
+            @param {String} name A name of the field.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      field: function (name) {
+        if (name == null) {
+          return filter.exists.field;
+        }
+
+        filter.exists.field = name;
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>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.</p>
+
+    @name ejs.GeoBboxFilter
+    @ejs filter
+    @borrows ejs.FilterMixin.name as name
+    @borrows ejs.FilterMixin.cache as cache
+    @borrows ejs.FilterMixin.cacheKey as cacheKey
+    @borrows ejs.FilterMixin._type as _type
+    @borrows ejs.FilterMixin.toJSON as toJSON
+
+    @desc
+    Filter results to those which are contained within the defined bounding box.
+
+    @param {String} fieldName the document property/field containing the Geo Point (lon/lat).
+
+    */
+  ejs.GeoBboxFilter = function (fieldName) {
+
+    var
+      _common = ejs.FilterMixin('geo_bounding_box'),
+      filter = _common.toJSON();
+    
+    filter.geo_bounding_box[fieldName] = {};
+
+    return extend(_common, {
+
+      /**
+            Sets the fields to filter against.
+
+            @member ejs.GeoBboxFilter
+            @param {String} f A valid field name.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      field: function (f) {
+        var oldValue = filter.geo_bounding_box[fieldName];
+    
+        if (f == null) {
+          return fieldName;
+        }
+
+        delete filter.geo_bounding_box[fieldName];
+        fieldName = f;
+        filter.geo_bounding_box[f] = oldValue;
+    
+        return this;
+      },
+      
+      /**
+             Sets the top-left coordinate of the bounding box
+
+             @member ejs.GeoBboxFilter
+             @param {GeoPoint} p A valid GeoPoint object
+             @returns {Object} returns <code>this</code> so that calls can be chained.
+             */
+      topLeft: function (p) {
+        if (p == null) {
+          return filter.geo_bounding_box[fieldName].top_left;
+        }
+      
+        if (isGeoPoint(p)) {
+          filter.geo_bounding_box[fieldName].top_left = p.toJSON();
+        } else {
+          throw new TypeError('Argument must be a GeoPoint');
+        }
+        
+        return this;
+      },
+
+      /**
+             Sets the bottom-right coordinate of the bounding box
+
+             @member ejs.GeoBboxFilter
+             @param {GeoPoint} p A valid GeoPoint object
+             @returns {Object} returns <code>this</code> so that calls can be chained.
+             */
+      bottomRight: function (p) {
+        if (p == null) {
+          return filter.geo_bounding_box[fieldName].bottom_right;
+        }
+      
+        if (isGeoPoint(p)) {
+          filter.geo_bounding_box[fieldName].bottom_right = p.toJSON();
+        } else {
+          throw new TypeError('Argument must be a GeoPoint');
+        }
+        
+        return this;
+      },
+
+      /**
+            Sets the type of the bounding box execution. Valid values are
+            "memory" and "indexed".  Default is memory.
+
+            @member ejs.GeoBboxFilter
+            @param {String} type The execution type as a string.  
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      type: function (type) {
+        if (type == null) {
+          return filter.geo_bounding_box.type;
+        }
+
+        type = type.toLowerCase();
+        if (type === 'memory' || type === 'indexed') {
+          filter.geo_bounding_box.type = type;
+        }
+        
+        return this;
+      },
+      
+      /**
+            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
+
+            @member ejs.GeoBboxFilter
+            @param {String} trueFalse True if the coordinates should be normalized. False otherwise.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      normalize: function (trueFalse) {
+        if (trueFalse == null) {
+          return filter.geo_bounding_box.normalize;
+        }
+
+        filter.geo_bounding_box.normalize = trueFalse;
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>A filter that restricts matched results/docs to a given distance from the
+    point of origin. The format conforms with the GeoJSON specification.</p>
+
+    @name ejs.GeoDistanceFilter
+    @ejs filter
+    @borrows ejs.FilterMixin.name as name
+    @borrows ejs.FilterMixin.cache as cache
+    @borrows ejs.FilterMixin.cacheKey as cacheKey
+    @borrows ejs.FilterMixin._type as _type
+    @borrows ejs.FilterMixin.toJSON as toJSON
+
+    @desc
+    Filter results to those which fall within the given distance of the point of origin.
+
+    @param {String} fieldName the document property/field containing the Geo Point (lon/lat).
+
+    */
+  ejs.GeoDistanceFilter = function (fieldName) {
+
+    var
+      _common = ejs.FilterMixin('geo_distance'),
+      filter = _common.toJSON();
+
+    filter.geo_distance[fieldName] = [0, 0];
+    
+    return extend(_common, {
+
+      /**
+            Sets the fields to filter against.
+
+            @member ejs.GeoDistanceFilter
+            @param {String} f A valid field name.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      field: function (f) {
+        var oldValue = filter.geo_distance[fieldName];
+    
+        if (f == null) {
+          return fieldName;
+        }
+
+        delete filter.geo_distance[fieldName];
+        fieldName = f;
+        filter.geo_distance[f] = oldValue;
+    
+        return this;
+      },
+      
+      /**
+             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.
+
+             @member ejs.GeoDistanceFilter
+             @param {Number} numericDistance the numeric distance
+             @returns {Object} returns <code>this</code> so that calls can be chained.
+             */
+      distance: function (numericDistance) {
+        if (numericDistance == null) {
+          return filter.geo_distance.distance;
+        }
+      
+        if (!isNumber(numericDistance)) {
+          throw new TypeError('Argument must be a numeric value');
+        }
+        
+        filter.geo_distance.distance = numericDistance;
+        return this;
+      },
+
+      /**
+             Sets the distance unit.  Valid values are "mi" for miles or "km"
+             for kilometers. Defaults to "km".
+
+             @member ejs.GeoDistanceFilter
+             @param {Number} unit the unit of distance measure.
+             @returns {Object} returns <code>this</code> so that calls can be chained.
+             */
+      unit: function (unit) {
+        if (unit == null) {
+          return filter.geo_distance.unit;
+        }
+      
+        unit = unit.toLowerCase();
+        if (unit === 'mi' || unit === 'km') {
+          filter.geo_distance.unit = unit;
+        }
+        
+        return this;
+      },
+
+      /**
+             Sets the point of origin in which distance will be measured from
+
+             @member ejs.GeoDistanceFilter
+             @param {GeoPoint} p A valid GeoPoint object.
+             @returns {Object} returns <code>this</code> so that calls can be chained.
+             */
+      point: function (p) {
+        if (p == null) {
+          return filter.geo_distance[fieldName];
+        }
+      
+        if (isGeoPoint(p)) {
+          filter.geo_distance[fieldName] = p.toJSON();
+        } else {
+          throw new TypeError('Argument must be a GeoPoint');
+        }
+        
+        return this;
+      },
+
+
+      /**
+            How to compute the distance. Can either be arc (better precision) 
+            or plane (faster). Defaults to arc.
+
+            @member ejs.GeoDistanceFilter
+            @param {String} type The execution type as a string.  
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      distanceType: function (type) {
+        if (type == null) {
+          return filter.geo_distance.distance_type;
+        }
+
+        type = type.toLowerCase();
+        if (type === 'arc' || type === 'plane') {
+          filter.geo_distance.distance_type = type;
+        }
+        
+        return this;
+      },
+      
+      /**
+            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
+
+            @member ejs.GeoDistanceFilter
+            @param {String} trueFalse True if the coordinates should be normalized. False otherwise.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      normalize: function (trueFalse) {
+        if (trueFalse == null) {
+          return filter.geo_distance.normalize;
+        }
+
+        filter.geo_distance.normalize = trueFalse;
+        return this;
+      },
+      
+      /**
+            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.
+
+            @member ejs.GeoDistanceFilter
+            @param {String} t optimization type of memory, indexed, or none.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      optimizeBbox: function (t) {
+        if (t == null) {
+          return filter.geo_distance.optimize_bbox;
+        }
+
+        t = t.toLowerCase();
+        if (t === 'memory' || t === 'indexed' || t === 'none') {
+          filter.geo_distance.optimize_bbox = t;
+        }
+        
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>A filter that restricts matched results/docs to a given distance range from the
+    point of origin. The format conforms with the GeoJSON specification.</p>
+
+    @name ejs.GeoDistanceRangeFilter
+    @ejs filter
+    @borrows ejs.FilterMixin.name as name
+    @borrows ejs.FilterMixin.cache as cache
+    @borrows ejs.FilterMixin.cacheKey as cacheKey
+    @borrows ejs.FilterMixin._type as _type
+    @borrows ejs.FilterMixin.toJSON as toJSON
+
+    @desc
+    Filter results to those which fall within the given distance range of the point of origin.
+
+    @param {String} fieldName the document property/field containing the Geo Point (lon/lat).
+
+    */
+  ejs.GeoDistanceRangeFilter = function (fieldName) {
+
+    var
+      _common = ejs.FilterMixin('geo_distance_range'),
+      filter = _common.toJSON();
+
+    filter.geo_distance_range[fieldName] = [0, 0];
+    
+    return extend(_common, {
+
+     /**
+            Sets the fields to filter against.
+
+            @member ejs.GeoDistanceRangeFilter
+            @param {String} f A valid field name.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      field: function (f) {
+        var oldValue = filter.geo_distance_range[fieldName];
+
+        if (f == null) {
+          return fieldName;
+        }
+
+        delete filter.geo_distance_range[fieldName];
+        fieldName = f;
+        filter.geo_distance_range[f] = oldValue;
+
+        return this;
+      },
+      
+      /**
+             * Sets the start point of the distance range
+
+             @member ejs.GeoDistanceRangeFilter
+             @param {Number} numericDistance the numeric distance
+             @returns {Object} returns <code>this</code> so that calls can be chained.
+             */
+      from: function (numericDistance) {
+        if (numericDistance == null) {
+          return filter.geo_distance_range.from;
+        }
+      
+        if (!isNumber(numericDistance)) {
+          throw new TypeError('Argument must be a numeric value');
+        }
+        
+        filter.geo_distance_range.from = numericDistance;
+        return this;
+      },
+
+      /**
+             * Sets the end point of the distance range
+
+             @member ejs.GeoDistanceRangeFilter
+             @param {Number} numericDistance the numeric distance
+             @returns {Object} returns <code>this</code> so that calls can be chained.
+             */
+      to: function (numericDistance) {
+        if (numericDistance == null) {
+          return filter.geo_distance_range.to;
+        }
+
+        if (!isNumber(numericDistance)) {
+          throw new TypeError('Argument must be a numeric value');
+        }
+            
+        filter.geo_distance_range.to = numericDistance;
+        return this;
+      },
+
+      /**
+            Should the first from (if set) be inclusive or not. 
+            Defaults to true
+
+            @member ejs.GeoDistanceRangeFilter
+            @param {Boolean} trueFalse true to include, false to exclude 
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      includeLower: function (trueFalse) {
+        if (trueFalse == null) {
+          return filter.geo_distance_range.include_lower;
+        }
+
+        filter.geo_distance_range.include_lower = trueFalse;
+        return this;
+      },
+
+      /**
+            Should the last to (if set) be inclusive or not. Defaults to true.
+
+            @member ejs.GeoDistanceRangeFilter
+            @param {Boolean} trueFalse true to include, false to exclude 
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      includeUpper: function (trueFalse) {
+        if (trueFalse == null) {
+          return filter.geo_distance_range.include_upper;
+        }
+
+        filter.geo_distance_range.include_upper = trueFalse;
+        return this;
+      },
+
+      /**
+            Greater than value.  Same as setting from to the value, and 
+            include_lower to false,
+
+            @member ejs.GeoDistanceRangeFilter
+            @param {Number} val the numeric distance
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      gt: function (val) {
+        if (val == null) {
+          return filter.geo_distance_range.gt;
+        }
+
+        if (!isNumber(val)) {
+          throw new TypeError('Argument must be a numeric value');
+        }
+        
+        filter.geo_distance_range.gt = val;
+        return this;
+      },
+
+      /**
+            Greater than or equal to value.  Same as setting from to the value,
+            and include_lower to true.
+
+            @member ejs.GeoDistanceRangeFilter
+            @param {Number} val the numeric distance
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      gte: function (val) {
+        if (val == null) {
+          return filter.geo_distance_range.gte;
+        }
+
+        if (!isNumber(val)) {
+          throw new TypeError('Argument must be a numeric value');
+        }
+        
+        filter.geo_distance_range.gte = val;
+        return this;
+      },
+
+      /**
+            Less than value.  Same as setting to to the value, and include_upper 
+            to false.
+
+            @member ejs.GeoDistanceRangeFilter
+            @param {Number} val the numeric distance
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      lt: function (val) {
+        if (val == null) {
+          return filter.geo_distance_range.lt;
+        }
+
+        if (!isNumber(val)) {
+          throw new TypeError('Argument must be a numeric value');
+        }
+        
+        filter.geo_distance_range.lt = val;
+        return this;
+      },
+
+      /**
+            Less than or equal to value.  Same as setting to to the value, 
+            and include_upper to true.
+
+            @member ejs.GeoDistanceRangeFilter
+            @param {Number} val the numeric distance
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      lte: function (val) {
+        if (val == null) {
+          return filter.geo_distance_range.lte;
+        }
+
+        if (!isNumber(val)) {
+          throw new TypeError('Argument must be a numeric value');
+        }
+        
+        filter.geo_distance_range.lte = val;
+        return this;
+      },
+      
+      /**
+             Sets the distance unit.  Valid values are "mi" for miles or "km"
+             for kilometers. Defaults to "km".
+
+             @member ejs.GeoDistanceRangeFilter
+             @param {Number} unit the unit of distance measure.
+             @returns {Object} returns <code>this</code> so that calls can be chained.
+             */
+      unit: function (unit) {
+        if (unit == null) {
+          return filter.geo_distance_range.unit;
+        }
+      
+        unit = unit.toLowerCase();
+        if (unit === 'mi' || unit === 'km') {
+          filter.geo_distance_range.unit = unit;
+        }
+        
+        return this;
+      },
+
+      /**
+             Sets the point of origin in which distance will be measured from
+
+             @member ejs.GeoDistanceRangeFilter
+             @param {GeoPoint} p A valid GeoPoint object.
+             @returns {Object} returns <code>this</code> so that calls can be chained.
+             */
+      point: function (p) {
+        if (p == null) {
+          return filter.geo_distance_range[fieldName];
+        }
+      
+        if (isGeoPoint(p)) {
+          filter.geo_distance_range[fieldName] = p.toJSON();
+        } else {
+          throw new TypeError('Argument must be a GeoPoint');
+        }
+        
+        return this;
+      },
+
+
+      /**
+            How to compute the distance. Can either be arc (better precision) 
+            or plane (faster). Defaults to arc.
+
+            @member ejs.GeoDistanceRangeFilter
+            @param {String} type The execution type as a string.  
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      distanceType: function (type) {
+        if (type == null) {
+          return filter.geo_distance_range.distance_type;
+        }
+
+        type = type.toLowerCase();
+        if (type === 'arc' || type === 'plane') {
+          filter.geo_distance_range.distance_type = type;
+        }
+        
+        return this;
+      },
+      
+      /**
+            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
+
+            @member ejs.GeoDistanceRangeFilter
+            @param {String} trueFalse True if the coordinates should be normalized. False otherwise.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      normalize: function (trueFalse) {
+        if (trueFalse == null) {
+          return filter.geo_distance_range.normalize;
+        }
+
+        filter.geo_distance_range.normalize = trueFalse;
+        return this;
+      },
+      
+      /**
+            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.
+
+            @member ejs.GeoDistanceRangeFilter
+            @param {String} t optimization type of memory, indexed, or none.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      optimizeBbox: function (t) {
+        if (t == null) {
+          return filter.geo_distance_range.optimize_bbox;
+        }
+
+        t = t.toLowerCase();
+        if (t === 'memory' || t === 'indexed' || t === 'none') {
+          filter.geo_distance_range.optimize_bbox = t;
+        }
+        
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>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.</p>
+
+    @name ejs.GeoPolygonFilter
+    @ejs filter
+    @borrows ejs.FilterMixin.name as name
+    @borrows ejs.FilterMixin.cache as cache
+    @borrows ejs.FilterMixin.cacheKey as cacheKey
+    @borrows ejs.FilterMixin._type as _type
+    @borrows ejs.FilterMixin.toJSON as toJSON
+
+    @desc
+    Filter results to those which are contained within the polygon of points.
+
+    @param {String} fieldName the document property/field containing the Geo Point (lon/lat).
+    */
+  ejs.GeoPolygonFilter = function (fieldName) {
+
+    var
+      _common = ejs.FilterMixin('geo_polygon'),
+      filter = _common.toJSON(); 
+
+    filter.geo_polygon[fieldName] = {
+      points: []
+    };
+
+    return extend(_common, {
+
+      /**
+           Sets the fields to filter against.
+
+           @member ejs.GeoPolygonFilter
+           @param {String} f A valid field name.
+           @returns {Object} returns <code>this</code> so that calls can be chained.
+           */
+      field: function (f) {
+        var oldValue = filter.geo_polygon[fieldName];
+
+        if (f == null) {
+          return fieldName;
+        }
+
+        delete filter.geo_polygon[fieldName];
+        fieldName = f;
+        filter.geo_polygon[f] = oldValue;
+
+        return this;
+      },
+       
+      /**
+             Sets a series of points that represent a polygon.  If passed a 
+             single <code>GeoPoint</code> object, it is added to the current 
+             list of points.  If passed an array of <code>GeoPoint</code> 
+             objects it replaces all current values. 
+
+             @member ejs.GeoPolygonFilter
+             @param {Array} pointsArray the array of points that represent the polygon
+             @returns {Object} returns <code>this</code> so that calls can be chained.
+             */
+      points: function (p) {
+        var i, len;
+        
+        if (p == null) {
+          return filter.geo_polygon[fieldName].points;
+        }
+      
+        if (isGeoPoint(p)) {
+          filter.geo_polygon[fieldName].points.push(p.toJSON());
+        } else if (isArray(p)) {
+          filter.geo_polygon[fieldName].points = [];
+          for (i = 0, len = p.length; i < len; i++) {
+            if (!isGeoPoint(p[i])) {
+              throw new TypeError('Argument must be Array of GeoPoints');
+            }
+            
+            filter.geo_polygon[fieldName].points.push(p[i].toJSON());
+          }
+        } else {
+          throw new TypeError('Argument must be a GeoPoint or Array of GeoPoints');
+        }
+        
+        return this;
+      },
+
+      /**
+            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
+
+            @member ejs.GeoPolygonFilter
+            @param {String} trueFalse True if the coordinates should be normalized. False otherwise.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      normalize: function (trueFalse) {
+        if (trueFalse == null) {
+          return filter.geo_polygon.normalize;
+        }
+
+        filter.geo_polygon.normalize = trueFalse;
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>Efficient filtering of documents containing shapes indexed using the 
+    geo_shape type.</p>
+
+    <p>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.</p>
+
+    @name ejs.GeoShapeFilter
+    @ejs filter
+    @borrows ejs.FilterMixin.name as name
+    @borrows ejs.FilterMixin.cache as cache
+    @borrows ejs.FilterMixin.cacheKey as cacheKey
+    @borrows ejs.FilterMixin._type as _type
+    @borrows ejs.FilterMixin.toJSON as toJSON
+
+    @desc
+    A Filter to find documents with a geo_shapes matching a specific shape.
+
+    */
+  ejs.GeoShapeFilter = function (field) {
+
+    var
+      _common = ejs.FilterMixin('geo_shape'),
+      filter = _common.toJSON();
+    
+    filter.geo_shape[field] = {};
+
+    return extend(_common, {
+
+      /**
+            Sets the field to filter against.
+
+            @member ejs.GeoShapeFilter
+            @param {String} f A valid field name.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      field: function (f) {
+        var oldValue = filter.geo_shape[field];
+  
+        if (f == null) {
+          return field;
+        }
+
+        delete filter.geo_shape[field];
+        field = f;
+        filter.geo_shape[f] = oldValue;
+  
+        return this;
+      },
+
+      /**
+            Sets the shape
+
+            @member ejs.GeoShapeFilter
+            @param {String} shape A valid <code>Shape</code> object.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      shape: function (shape) {
+        if (shape == null) {
+          return filter.geo_shape[field].shape;
+        }
+
+        if (filter.geo_shape[field].indexed_shape != null) {
+          delete filter.geo_shape[field].indexed_shape;
+        }
+      
+        filter.geo_shape[field].shape = shape.toJSON();
+        return this;
+      },
+
+      /**
+            Sets the indexed shape.  Use this if you already have shape definitions
+            already indexed.
+
+            @member ejs.GeoShapeFilter
+            @param {String} indexedShape A valid <code>IndexedShape</code> object.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      indexedShape: function (indexedShape) {
+        if (indexedShape == null) {
+          return filter.geo_shape[field].indexed_shape;
+        }
+
+        if (filter.geo_shape[field].shape != null) {
+          delete filter.geo_shape[field].shape;
+        }
+      
+        filter.geo_shape[field].indexed_shape = indexedShape.toJSON();
+        return this;
+      },
+
+      /**
+            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.
+
+            @member ejs.GeoShapeFilter
+            @param {String} indexedShape A valid <code>IndexedShape</code> object.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      relation: function (relation) {
+        if (relation == null) {
+          return filter.geo_shape[field].relation;
+        }
+
+        relation = relation.toLowerCase();
+        if (relation === 'intersects' || relation === 'disjoint' || relation === 'within') {
+          filter.geo_shape[field].relation = relation;
+        }
+    
+        return this;
+      },
+
+      /**
+            <p>Sets the spatial strategy.</p>  
+            <p>Valid values are:</p>
+            
+            <dl>
+                <dd><code>recursive</code> - default, recursively traverse nodes in
+                  the spatial prefix tree.  This strategy has support for 
+                  searching non-point shapes.</dd>
+                <dd><code>term</code> - uses a large TermsFilter on each node
+                  in the spatial prefix tree.  It only supports the search of 
+                  indexed Point shapes.</dd>
+            </dl>
+
+            <p>This is an advanced setting, use with care.</p>
+            
+            @since elasticsearch 0.90
+            @member ejs.GeoShapeFilter
+            @param {String} strategy The strategy as a string.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      strategy: function (strategy) {
+        if (strategy == null) {
+          return filter.geo_shape[field].strategy;
+        }
+
+        strategy = strategy.toLowerCase();
+        if (strategy === 'recursive' || strategy === 'term') {
+          filter.geo_shape[field].strategy = strategy;
+        }
+        
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>The has_child filter results in parent documents that have child docs
+    matching the query being returned.</p>
+
+    @name ejs.HasChildFilter
+    @ejs filter
+    @borrows ejs.FilterMixin.name as name
+    @borrows ejs.FilterMixin.cache as cache
+    @borrows ejs.FilterMixin.cacheKey as cacheKey
+    @borrows ejs.FilterMixin._type as _type
+    @borrows ejs.FilterMixin.toJSON as toJSON
+
+    @desc
+    Returns results that have child documents matching the filter.
+
+    @param {Object} qryOrFltr A valid query or filter object.
+    @param {String} type The child type
+    */
+  ejs.HasChildFilter = function (qryOrFltr, type) {
+
+    var
+      _common = ejs.FilterMixin('has_child'),
+      filter = _common.toJSON();
+
+    if (isQuery(qryOrFltr)) {
+      filter.has_child.query = qryOrFltr.toJSON();
+    } else if (isFilter(qryOrFltr)) {
+      filter.has_child.filter = qryOrFltr.toJSON();
+    } else if (qryOrFltr != null) {
+      throw new TypeError('Argument must be query or filter');
+    }
+
+    filter.has_child.type = type;
+
+    return extend(_common, {
+
+      /**
+            Sets the query
+
+            @member ejs.HasChildFilter
+            @param {Query} q A valid Query object
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      query: function (q) {
+        if (q == null) {
+          return filter.has_child.query;
+        }
+
+        if (!isQuery(q)) {
+          throw new TypeError('Argument must be a Query object');
+        }
+
+        filter.has_child.query = q.toJSON();
+        return this;
+      },
+
+      /**
+            Sets the filter
+
+            @since elasticsearch 0.90
+            @member ejs.HasChildFilter
+            @param {Query} f A valid Filter object
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      filter: function (f) {
+        if (f == null) {
+          return filter.has_child.filter;
+        }
+
+        if (!isFilter(f)) {
+          throw new TypeError('Argument must be a Filter object');
+        }
+
+        filter.has_child.filter = f.toJSON();
+        return this;
+      },
+
+      /**
+            Sets the child document type to search against
+
+            @member ejs.HasChildFilter
+            @param {String} t A valid type name
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      type: function (t) {
+        if (t == null) {
+          return filter.has_child.type;
+        }
+
+        filter.has_child.type = t;
+        return this;
+      },
+
+      /**
+            Sets the cutoff value to short circuit processing.
+
+            @member ejs.HasChildFilter
+            @param {Integer} cutoff A positive <code>integer</code> value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      shortCircuitCutoff: function (cutoff) {
+        if (cutoff == null) {
+          return filter.has_child.short_circuit_cutoff;
+        }
+
+        filter.has_child.short_circuit_cutoff = cutoff;
+        return this;
+      },
+
+      /**
+            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
+            @member ejs.HasChildFilter
+            @param {String} s The scope name as a string.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      scope: function (s) {
+        return this;
+      }
+
+    });
+  };
+
+  /**
+    @class
+    <p>The has_parent results in child documents that have parent docs matching
+    the query being returned.</p>
+
+    @name ejs.HasParentFilter
+    @ejs filter
+    @borrows ejs.FilterMixin.name as name
+    @borrows ejs.FilterMixin.cache as cache
+    @borrows ejs.FilterMixin.cacheKey as cacheKey
+    @borrows ejs.FilterMixin._type as _type
+    @borrows ejs.FilterMixin.toJSON as toJSON
+
+    @desc
+    Returns results that have parent documents matching the filter.
+
+    @param {Object} qryOrFltr A valid query or filter object.
+    @param {String} parentType The child type
+    */
+  ejs.HasParentFilter = function (qryOrFltr, parentType) {
+
+    var
+      _common = ejs.FilterMixin('has_parent'),
+      filter = _common.toJSON();
+
+    if (isQuery(qryOrFltr)) {
+      filter.has_parent.query = qryOrFltr.toJSON();
+    } else if (isFilter(qryOrFltr)) {
+      filter.has_parent.filter = qryOrFltr.toJSON();
+    } else if (qryOrFltr != null) {
+      throw new TypeError('Argument must be query or filter');
+    }
+
+    filter.has_parent.parent_type = parentType;
+
+    return extend(_common, {
+
+      /**
+            Sets the query
+
+            @member ejs.HasParentFilter
+            @param {Object} q A valid Query object
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      query: function (q) {
+        if (q == null) {
+          return filter.has_parent.query;
+        }
+
+        if (!isQuery(q)) {
+          throw new TypeError('Argument must be a Query object');
+        }
+
+        filter.has_parent.query = q.toJSON();
+        return this;
+      },
+
+      /**
+            Sets the filter
+
+            @since elasticsearch 0.90
+            @member ejs.HasParentFilter
+            @param {Object} f A valid Filter object
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      filter: function (f) {
+        if (f == null) {
+          return filter.has_parent.filter;
+        }
+
+        if (!isFilter(f)) {
+          throw new TypeError('Argument must be a Filter object');
+        }
+
+        filter.has_parent.filter = f.toJSON();
+        return this;
+      },
+
+      /**
+            Sets the child document type to search against
+
+            @member ejs.HasParentFilter
+            @param {String} t A valid type name
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      parentType: function (t) {
+        if (t == null) {
+          return filter.has_parent.parent_type;
+        }
+
+        filter.has_parent.parent_type = t;
+        return this;
+      },
+
+      /**
+            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
+            @member ejs.HasParentFilter
+            @param {String} s The scope name as a string.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      scope: function (s) {
+        return this;
+      }
+
+    });
+  };
+
+  /**
+    @class
+    <p>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.</p>
+
+    @name ejs.IdsFilter
+    @ejs filter
+    @borrows ejs.FilterMixin.name as name
+    @borrows ejs.FilterMixin.cache as cache
+    @borrows ejs.FilterMixin.cacheKey as cacheKey
+    @borrows ejs.FilterMixin._type as _type
+    @borrows ejs.FilterMixin.toJSON as toJSON
+
+    @desc
+    Matches documents with the specified id(s).
+
+    @param {(String|String[])} ids A single document id or a list of document ids.
+    */
+  ejs.IdsFilter = function (ids) {
+
+    var
+      _common = ejs.FilterMixin('ids'),
+      filter = _common.toJSON(); 
+  
+    if (isString(ids)) {
+      filter.ids.values = [ids];
+    } else if (isArray(ids)) {
+      filter.ids.values = ids;
+    } else {
+      throw new TypeError('Argument must be a string or an array');
+    }
+
+    return extend(_common, {
+
+      /**
+            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.
+
+            @member ejs.IdsFilter
+            @param {(String|String[])} val An single document id or an array of document ids.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      values: function (val) {
+        if (val == null) {
+          return filter.ids.values;
+        }
+  
+        if (isString(val)) {
+          filter.ids.values.push(val);
+        } else if (isArray(val)) {
+          filter.ids.values = val;
+        } else {
+          throw new TypeError('Argument must be a string or an array');
+        }
+      
+        return this;
+      },
+
+      /**
+            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.
+
+            @member ejs.IdsFilter
+            @param {(String|String[])} type A type or a list of types
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      type: function (type) {
+        if (filter.ids.type == null) {
+          filter.ids.type = [];
+        }
+      
+        if (type == null) {
+          return filter.ids.type;
+        }
+      
+        if (isString(type)) {
+          filter.ids.type.push(type);
+        } else if (isArray(type)) {
+          filter.ids.type = type;
+        } else {
+          throw new TypeError('Argument must be a string or an array');
+        }
+      
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>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.</p>
+
+    @name ejs.IndicesFilter
+    @ejs filter
+    @borrows ejs.FilterMixin.name as name
+    @borrows ejs.FilterMixin.cache as cache
+    @borrows ejs.FilterMixin.cacheKey as cacheKey
+    @borrows ejs.FilterMixin._type as _type
+    @borrows ejs.FilterMixin.toJSON as toJSON
+
+    @desc
+    A configurable filter that is dependent on the index name.
+
+    @param {Object} fltr A valid filter object.
+    @param {(String|String[])} indices a single index name or an array of index 
+      names.
+    */
+  ejs.IndicesFilter = function (fltr, indices) {
+
+    if (!isFilter(fltr)) {
+      throw new TypeError('Argument must be a Filter');
+    }
+  
+    var 
+      _common = ejs.FilterMixin('indices'),
+      filter = _common.toJSON();
+    
+    filter.indices.filter = fltr.toJSON();
+
+    if (isString(indices)) {
+      filter.indices.indices = [indices];
+    } else if (isArray(indices)) {
+      filter.indices.indices = indices;
+    } else {
+      throw new TypeError('Argument must be a string or array');
+    }
+
+    return extend(_common, {
+
+      /**
+            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.
+
+            @member ejs.IndicesFilter
+            @param {(String|String[])} i A single index name or an array of index names.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      indices: function (i) {
+        if (i == null) {
+          return filter.indices.indices;
+        }
+
+        if (isString(i)) {
+          filter.indices.indices.push(i);
+        } else if (isArray(i)) {
+          filter.indices.indices = i;
+        } else {
+          throw new TypeError('Argument must be a string or array');
+        }
+
+        return this;
+      },
+  
+      /**
+            Sets the filter to be used when executing on one of the indicies 
+            specified.
+
+            @member ejs.IndicesFilter
+            @param {Object} f A valid Filter object
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      filter: function (f) {
+        if (f == null) {
+          return filter.indices.filter;
+        }
+
+        if (!isFilter(f)) {
+          throw new TypeError('Argument must be a Filter');
+        }
+      
+        filter.indices.filter = f.toJSON();
+        return this;
+      },
+
+      /**
+            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.
+
+            @member ejs.IndicesFilter
+            @param {(Filter|String)} f A valid Filter object or "none" or "all"
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      noMatchFilter: function (f) {
+        if (f == null) {
+          return filter.indices.no_match_filter;
+        }
+
+        if (isString(f)) {
+          f = f.toLowerCase();
+          if (f === 'none' || f === 'all') {
+            filter.indices.no_match_filter = f;
+          }
+        } else if (isFilter(f)) {
+          filter.indices.no_match_filter = f.toJSON();
+        } else {
+          throw new TypeError('Argument must be string or Filter');
+        }
+    
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>A limit filter limits the number of documents (per shard) to execute on.</p>
+
+    @name ejs.LimitFilter
+    @ejs filter
+    @borrows ejs.FilterMixin.name as name
+    @borrows ejs.FilterMixin.cache as cache
+    @borrows ejs.FilterMixin.cacheKey as cacheKey
+    @borrows ejs.FilterMixin._type as _type
+    @borrows ejs.FilterMixin.toJSON as toJSON
+
+    @desc
+    Limits the number of documents to execute on.
+
+    @param {Integer} limit The number of documents to execute on.
+    */
+  ejs.LimitFilter = function (limit) {
+
+    var 
+      _common = ejs.FilterMixin('limit'),
+      filter = _common.toJSON();
+    
+    filter.limit.value = limit;
+
+    return extend(_common, {
+
+      /**
+            Sets the limit value.
+
+            @member ejs.LimitFilter
+            @param {Integer} val An The number of documents to execute on.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      value: function (val) {
+        if (val == null) {
+          return filter.limit.value;
+        }
+
+        if (!isNumber(val)) {
+          throw new TypeError('Argument must be a numeric value');
+        }
+            
+        filter.limit.value = val;
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>This filter can be used to match on all the documents
+    in a given set of collections and/or types.</p>
+
+    @name ejs.MatchAllFilter
+    @ejs filter
+    @borrows ejs.FilterMixin.name as name
+    @borrows ejs.FilterMixin.cache as cache
+    @borrows ejs.FilterMixin.cacheKey as cacheKey
+    @borrows ejs.FilterMixin._type as _type
+    @borrows ejs.FilterMixin.toJSON as toJSON
+
+    @desc
+    <p>A filter that matches on all documents</p>
+
+     */
+  ejs.MatchAllFilter = function () {
+    return ejs.FilterMixin('match_all');
+  };
+
+  /**
+    @class
+    <p>An missingFilter matches documents where the specified field contains no legitimate value.</p>
+
+    @name ejs.MissingFilter
+    @ejs filter
+    @borrows ejs.FilterMixin.name as name
+    @borrows ejs.FilterMixin.cache as cache
+    @borrows ejs.FilterMixin.cacheKey as cacheKey
+    @borrows ejs.FilterMixin._type as _type
+    @borrows ejs.FilterMixin.toJSON as toJSON
+
+    @desc
+    Filters documents where a specific field has no value present.
+
+    @param {String} fieldName the field name to check for missing values.
+    */
+  ejs.MissingFilter = function (fieldName) {
+
+    
+    var 
+      _common = ejs.FilterMixin('missing'),
+      filter = _common.toJSON();
+    
+    filter.missing.field = fieldName;
+
+    return extend(_common, {
+
+      /**
+            Sets the field to check for missing values.
+
+            @member ejs.MissingFilter
+            @param {String} name A name of the field.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      field: function (name) {
+        if (name == null) {
+          return filter.missing.field;
+        }
+
+        filter.missing.field = name;
+        return this;
+      },
+      
+      /**
+            Checks if the field doesn't exist.
+
+            @member ejs.MissingFilter
+            @param {Boolean} trueFalse True to check if the field doesn't exist.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      existence: function (trueFalse) {
+        if (trueFalse == null) {
+          return filter.missing.existence;
+        }
+
+        filter.missing.existence = trueFalse;
+        return this;
+      },
+
+      /**
+            Checks if the field has null values.
+
+            @member ejs.MissingFilter
+            @param {Boolean} trueFalse True to check if the field has nulls.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      nullValue: function (trueFalse) {
+        if (trueFalse == null) {
+          return filter.missing.null_value;
+        }
+
+        filter.missing.null_value = trueFalse;
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>Nested filters allow you to search against content within objects that are
+       embedded inside of other objects. It is similar to <code>XPath</code> 
+       expressions in <code>XML</code> both conceptually and syntactically.</p>
+
+    <p>
+    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).</p>
+  
+    @name ejs.NestedFilter
+    @ejs filter
+    @borrows ejs.FilterMixin.name as name
+    @borrows ejs.FilterMixin.cache as cache
+    @borrows ejs.FilterMixin.cacheKey as cacheKey
+    @borrows ejs.FilterMixin._type as _type
+    @borrows ejs.FilterMixin.toJSON as toJSON
+
+    @desc
+    <p>Constructs a filter that is capable of executing a filter against objects
+       nested within a document.</p>
+
+    @param {String} path The nested object path.
+
+     */
+  ejs.NestedFilter = function (path) {
+
+    var 
+      _common = ejs.FilterMixin('nested'),
+      filter = _common.toJSON();
+    
+    filter.nested.path = path;
+
+    return extend(_common, {
+    
+      /**
+             Sets the root context for the nested filter.
+             @member ejs.NestedFilter
+             @param {String} p The path defining the root for the nested filter.
+             @returns {Object} returns <code>this</code> so that calls can be chained.
+             */
+      path: function (p) {
+        if (p == null) {
+          return filter.nested.path;
+        }
+    
+        filter.nested.path = p;
+        return this;
+      },
+
+      /**
+             Sets the nested query to be executed.
+             @member ejs.NestedFilter
+             @param {Query} oQuery A valid Query object
+             @returns {Object} returns <code>this</code> so that calls can be chained.
+             */
+      query: function (oQuery) {
+        if (oQuery == null) {
+          return filter.nested.query;
+        }
+    
+        if (!isQuery(oQuery)) {
+          throw new TypeError('Argument must be a Query object');
+        }
+        
+        filter.nested.query = oQuery.toJSON();
+        return this;
+      },
+
+
+      /**
+             Sets the nested filter to be executed.
+             @member ejs.NestedFilter
+             @param {Object} oFilter A valid Filter object
+             @returns {Object} returns <code>this</code> so that calls can be chained.
+             */
+      filter: function (oFilter) {
+        if (oFilter == null) {
+          return filter.nested.filter;
+        }
+    
+        if (!isFilter(oFilter)) {
+          throw new TypeError('Argument must be a Filter object');
+        }
+        
+        filter.nested.filter = oFilter.toJSON();
+        return this;
+      },
+
+      /**
+            Sets the boost value of the nested <code>Query</code>.
+
+            @member ejs.NestedFilter
+            @param {Double} boost A positive <code>double</code> value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      boost: function (boost) {
+        if (boost == null) {
+          return filter.nested.boost;
+        }
+
+        filter.nested.boost = boost;
+        return this;
+      },
+    
+      /**
+            If the nested query should be "joined" with the parent document.
+            Defaults to false.
+
+            @member ejs.NestedFilter
+            @param {Boolean} trueFalse If the query should be joined or not.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      join: function (trueFalse) {
+        if (trueFalse == null) {
+          return filter.nested.join;
+        }
+
+        filter.nested.join = trueFalse;
+        return this;
+      },
+    
+      /**
+            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
+            @member ejs.NestedFilter
+            @param {String} s The scope name as a string.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      scope: function (s) {
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>A container Filter that excludes the documents matched by the
+    contained filter.</p>
+
+    @name ejs.NotFilter
+    @ejs filter
+    @borrows ejs.FilterMixin.name as name
+    @borrows ejs.FilterMixin.cache as cache
+    @borrows ejs.FilterMixin.cacheKey as cacheKey
+    @borrows ejs.FilterMixin._type as _type
+    @borrows ejs.FilterMixin.toJSON as toJSON
+
+    @desc
+    Container filter that excludes the matched documents of the contained filter.
+
+    @param {Object} oFilter a valid Filter object such as a termFilter, etc.
+    */
+  ejs.NotFilter = function (oFilter) {
+
+    if (!isFilter(oFilter)) {
+      throw new TypeError('Argument must be a Filter');
+    }
+    
+    var 
+      _common = ejs.FilterMixin('not'),
+      filter = _common.toJSON();
+    
+    filter.not = oFilter.toJSON();
+
+    return extend(_common, {
+
+      /**
+             Sets the filter
+
+             @member ejs.NotFilter
+             @param {Object} fltr A valid filter object such as a termFilter, etc.
+             @returns {Object} returns <code>this</code> so that calls can be chained.
+             */
+      filter: function (fltr) {
+        if (fltr == null) {
+          return filter.not;
+        }
+      
+        if (!isFilter(fltr)) {
+          throw new TypeError('Argument must be a Filter');
+        }
+        
+        filter.not = fltr.toJSON();
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>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.</p>
+    
+    <p>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.</p> 
+    
+    <p>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.</p>
+
+    @name ejs.NumericRangeFilter
+    @ejs filter
+    @borrows ejs.FilterMixin.name as name
+    @borrows ejs.FilterMixin.cache as cache
+    @borrows ejs.FilterMixin.cacheKey as cacheKey
+    @borrows ejs.FilterMixin._type as _type
+    @borrows ejs.FilterMixin.toJSON as toJSON
+
+    @desc
+    A Filter that only accepts numeric values within a specified range.
+
+    @param {String} fieldName The name of the field to filter on.
+    */
+  ejs.NumericRangeFilter = function (fieldName) {
+
+    var
+      _common = ejs.FilterMixin('numeric_range'),
+      filter = _common.toJSON();
+
+    filter.numeric_range[fieldName] = {};
+
+    return extend(_common, {
+
+      /**
+             Returns the field name used to create this object.
+
+             @member ejs.NumericRangeFilter
+             @param {String} field the field name
+             @returns {Object} returns <code>this</code> so that calls can be 
+              chained. Returns {String}, field name when field is not specified.
+             */
+      field: function (field) {
+        var oldValue = filter.numeric_range[fieldName];
+      
+        if (field == null) {
+          return fieldName;
+        }
+      
+        delete filter.numeric_range[fieldName];
+        fieldName = field;
+        filter.numeric_range[fieldName] = oldValue;
+      
+        return this;
+      },
+      
+      /**
+             Sets the endpoint for the current range.
+
+             @member ejs.NumericRangeFilter
+             @param {Number} startPoint A numeric value representing the start of the range
+             @returns {Object} returns <code>this</code> so that calls can be chained.
+             */
+      from: function (from) {
+        if (from == null) {
+          return filter.numeric_range[fieldName].from;
+        }
+        
+        if (!isNumber(from)) {
+          throw new TypeError('Argument must be a numeric value');
+        }
+        
+        filter.numeric_range[fieldName].from = from;
+        return this;
+      },
+
+      /**
+             Sets the endpoint for the current range.
+
+             @member ejs.NumericRangeFilter
+             @param {Number} endPoint A numeric value representing the end of the range
+             @returns {Object} returns <code>this</code> so that calls can be chained.
+             */
+      to: function (to) {
+        if (to == null) {
+          return filter.numeric_range[fieldName].to;
+        }
+
+        if (!isNumber(to)) {
+          throw new TypeError('Argument must be a numeric value');
+        }
+        
+        filter.numeric_range[fieldName].to = to;
+        return this;
+      },
+
+      /**
+            Should the first from (if set) be inclusive or not. 
+            Defaults to true
+
+            @member ejs.NumericRangeFilter
+            @param {Boolean} trueFalse true to include, false to exclude 
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      includeLower: function (trueFalse) {
+        if (trueFalse == null) {
+          return filter.numeric_range[fieldName].include_lower;
+        }
+
+        filter.numeric_range[fieldName].include_lower = trueFalse;
+        return this;
+      },
+
+      /**
+            Should the last to (if set) be inclusive or not. Defaults to true.
+
+            @member ejs.NumericRangeFilter
+            @param {Boolean} trueFalse true to include, false to exclude 
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      includeUpper: function (trueFalse) {
+        if (trueFalse == null) {
+          return filter.numeric_range[fieldName].include_upper;
+        }
+
+        filter.numeric_range[fieldName].include_upper = trueFalse;
+        return this;
+      },
+
+      /**
+            Greater than value.  Same as setting from to the value, and 
+            include_lower to false,
+
+            @member ejs.NumericRangeFilter
+            @param {*} val the value, type depends on field type
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      gt: function (val) {
+        if (val == null) {
+          return filter.numeric_range[fieldName].gt;
+        }
+
+        if (!isNumber(val)) {
+          throw new TypeError('Argument must be a numeric value');
+        }
+        
+        filter.numeric_range[fieldName].gt = val;
+        return this;
+      },
+
+      /**
+            Greater than or equal to value.  Same as setting from to the value,
+            and include_lower to true.
+
+            @member ejs.NumericRangeFilter
+            @param {*} val the value, type depends on field type
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      gte: function (val) {
+        if (val == null) {
+          return filter.numeric_range[fieldName].gte;
+        }
+
+        if (!isNumber(val)) {
+          throw new TypeError('Argument must be a numeric value');
+        }
+        
+        filter.numeric_range[fieldName].gte = val;
+        return this;
+      },
+
+      /**
+            Less than value.  Same as setting to to the value, and include_upper 
+            to false.
+
+            @member ejs.NumericRangeFilter
+            @param {*} val the value, type depends on field type
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      lt: function (val) {
+        if (val == null) {
+          return filter.numeric_range[fieldName].lt;
+        }
+
+        if (!isNumber(val)) {
+          throw new TypeError('Argument must be a numeric value');
+        }
+        
+        filter.numeric_range[fieldName].lt = val;
+        return this;
+      },
+
+      /**
+            Less than or equal to value.  Same as setting to to the value, 
+            and include_upper to true.
+
+            @member ejs.NumericRangeFilter
+            @param {*} val the value, type depends on field type
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      lte: function (val) {
+        if (val == null) {
+          return filter.numeric_range[fieldName].lte;
+        }
+
+        if (!isNumber(val)) {
+          throw new TypeError('Argument must be a numeric value');
+        }
+        
+        filter.numeric_range[fieldName].lte = val;
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    A container filter that allows Boolean OR composition of filters.
+
+    @name ejs.OrFilter
+    @ejs filter
+    @borrows ejs.FilterMixin.name as name
+    @borrows ejs.FilterMixin.cache as cache
+    @borrows ejs.FilterMixin.cacheKey as cacheKey
+    @borrows ejs.FilterMixin._type as _type
+    @borrows ejs.FilterMixin.toJSON as toJSON
+
+    @desc
+    A container Filter that allows Boolean OR composition of filters.
+
+    @param {(Filter|Filter[])} filters A valid Filter or array of Filters.
+    */
+  ejs.OrFilter = function (filters) {
+
+    var
+      i, 
+      len,
+      _common = ejs.FilterMixin('or'),
+      filter = _common.toJSON();
+
+    filter.or.filters = [];
+
+    if (isFilter(filters)) {
+      filter.or.filters.push(filters.toJSON());
+    } else if (isArray(filters)) {
+      for (i = 0, len = filters.length; i < len; i++) {
+        if (!isFilter(filters[i])) {
+          throw new TypeError('Argument must be array of Filters');
+        }
+        
+        filter.or.filters.push(filters[i].toJSON());
+      }
+    } else {
+      throw new TypeError('Argument must be a Filter or array of Filters');
+    }
+
+    return extend(_common, {
+
+      /**
+             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.
+
+             @member ejs.OrFilter
+             @param {(Filter|Filter[])} fltr A Filter or array of Filters
+             @returns {Object} returns <code>this</code> so that calls can be chained.
+             */
+      filters: function (fltr) {
+        var i, len;
+        
+        if (fltr == null) {
+          return filter.or.filters;
+        }
+      
+        if (isFilter(fltr)) {
+          filter.or.filters.push(fltr.toJSON());
+        } else if (isArray(fltr)) {
+          filter.or.filters = [];
+          for (i = 0, len = fltr.length; i < len; i++) {
+            if (!isFilter(fltr[i])) {
+              throw new TypeError('Argument must be an array of Filters');
+            }
+            
+            filter.or.filters.push(fltr[i].toJSON());
+          }
+        } else {
+          throw new TypeError('Argument must be a Filter or array of Filters');
+        }
+        
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>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.</p>
+
+    @name ejs.PrefixFilter
+    @ejs filter
+    @borrows ejs.FilterMixin.name as name
+    @borrows ejs.FilterMixin.cache as cache
+    @borrows ejs.FilterMixin.cacheKey as cacheKey
+    @borrows ejs.FilterMixin._type as _type
+    @borrows ejs.FilterMixin.toJSON as toJSON
+
+    @desc
+    Filters documents that have fields containing terms with a specified prefix.
+
+    @param {String} fieldName the field name to be used during matching.
+    @param {String} prefix the prefix value.
+    */
+  ejs.PrefixFilter = function (fieldName, prefix) {
+
+    var
+      _common = ejs.FilterMixin('prefix'),
+      filter = _common.toJSON();
+
+    filter.prefix[fieldName] = prefix;
+    
+    return extend(_common, {
+
+      /**
+             Returns the field name used to create this object.
+
+             @member ejs.PrefixFilter
+             @param {String} field the field name
+             @returns {Object} returns <code>this</code> so that calls can be 
+              chained. Returns {String}, field name when field is not specified.
+             */
+      field: function (field) {
+        var oldValue = filter.prefix[fieldName];
+      
+        if (field == null) {
+          return fieldName;
+        }
+      
+        delete filter.prefix[fieldName];
+        fieldName = field;
+        filter.prefix[fieldName] = oldValue;
+      
+        return this;
+      },
+      
+      /**
+             Sets the prefix to search for.
+
+             @member ejs.PrefixFilter
+             @param {String} value the prefix value to match
+             @returns {Object} returns <code>this</code> so that calls can be chained.
+             */
+      prefix: function (value) {
+        if (value == null) {
+          return filter.prefix[fieldName];
+        }
+      
+        filter.prefix[fieldName] = value;
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>Wraps any query to be used as a filter. Can be placed within queries 
+    that accept a filter.</p>
+
+    <p>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.</p> 
+  
+    <p>Note, the process of caching the first execution is higher when not 
+    caching (since it needs to satisfy different queries).</p>
+  
+    @name ejs.QueryFilter
+    @ejs filter
+    @borrows ejs.FilterMixin.name as name
+    @borrows ejs.FilterMixin.cache as cache
+    @borrows ejs.FilterMixin.cacheKey as cacheKey
+    @borrows ejs.FilterMixin._type as _type
+    @borrows ejs.FilterMixin.toJSON as toJSON
+
+    @desc
+    Filters documents matching the wrapped query.
+
+    @param {Object} qry A valid query object.
+    */
+  ejs.QueryFilter = function (qry) {
+
+    if (!isQuery(qry)) {
+      throw new TypeError('Argument must be a Query');
+    }
+    
+    var
+      _common = ejs.FilterMixin('fquery'),
+      filter = _common.toJSON();
+    
+    filter.fquery.query = qry.toJSON();
+
+    return extend(_common, {
+
+      /**
+            Sets the query
+
+            @member ejs.QueryFilter
+            @param {Object} q A valid Query object
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      query: function (q) {
+        if (q == null) {
+          return filter.fquery.query;
+        }
+
+        if (!isQuery(q)) {
+          throw new TypeError('Argument must be a Query');
+        }
+        
+        filter.fquery.query = q.toJSON();
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>Matches documents with fields that have terms within a certain range.</p>
+
+    @name ejs.RangeFilter
+    @ejs filter
+    @borrows ejs.FilterMixin.name as name
+    @borrows ejs.FilterMixin.cache as cache
+    @borrows ejs.FilterMixin.cacheKey as cacheKey
+    @borrows ejs.FilterMixin._type as _type
+    @borrows ejs.FilterMixin.toJSON as toJSON
+
+    @desc
+    Filters documents with fields that have terms within a certain range.
+
+    @param {String} field A valid field name.
+    */
+  ejs.RangeFilter = function (field) {
+
+    var
+      _common = ejs.FilterMixin('range'),
+      filter = _common.toJSON();
+
+    filter.range[field] = {};
+
+    return extend(_common, {
+
+      /**
+             The field to run the filter against.
+
+             @member ejs.RangeFilter
+             @param {String} f A single field name.
+             @returns {Object} returns <code>this</code> so that calls can be chained.
+             */
+      field: function (f) {
+        var oldValue = filter.range[field];
+
+        if (f == null) {
+          return field;
+        }
+
+        delete filter.range[field];
+        field = f;
+        filter.range[f] = oldValue;
+
+        return this;
+      },
+
+      /**
+            The lower bound. Defaults to start from the first.
+
+            @member ejs.RangeFilter
+            @param {*} f the lower bound value, type depends on field type
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      from: function (f) {
+        if (f == null) {
+          return filter.range[field].from;
+        }
+
+        filter.range[field].from = f;
+        return this;
+      },
+
+      /**
+            The upper bound. Defaults to unbounded.
+
+            @member ejs.RangeFilter
+            @param {*} t the upper bound value, type depends on field type
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      to: function (t) {
+        if (t == null) {
+          return filter.range[field].to;
+        }
+
+        filter.range[field].to = t;
+        return this;
+      },
+
+      /**
+            Should the first from (if set) be inclusive or not. 
+            Defaults to true
+
+            @member ejs.RangeFilter
+            @param {Boolean} trueFalse true to include, false to exclude 
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      includeLower: function (trueFalse) {
+        if (trueFalse == null) {
+          return filter.range[field].include_lower;
+        }
+
+        filter.range[field].include_lower = trueFalse;
+        return this;
+      },
+
+      /**
+            Should the last to (if set) be inclusive or not. Defaults to true.
+
+            @member ejs.RangeFilter
+            @param {Boolean} trueFalse true to include, false to exclude 
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      includeUpper: function (trueFalse) {
+        if (trueFalse == null) {
+          return filter.range[field].include_upper;
+        }
+
+        filter.range[field].include_upper = trueFalse;
+        return this;
+      },
+
+      /**
+            Greater than value.  Same as setting from to the value, and 
+            include_lower to false,
+
+            @member ejs.RangeFilter
+            @param {*} val the value, type depends on field type
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      gt: function (val) {
+        if (val == null) {
+          return filter.range[field].gt;
+        }
+
+        filter.range[field].gt = val;
+        return this;
+      },
+
+      /**
+            Greater than or equal to value.  Same as setting from to the value,
+            and include_lower to true.
+
+            @member ejs.RangeFilter
+            @param {*} val the value, type depends on field type
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      gte: function (val) {
+        if (val == null) {
+          return filter.range[field].gte;
+        }
+
+        filter.range[field].gte = val;
+        return this;
+      },
+
+      /**
+            Less than value.  Same as setting to to the value, and include_upper 
+            to false.
+
+            @member ejs.RangeFilter
+            @param {*} val the value, type depends on field type
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      lt: function (val) {
+        if (val == null) {
+          return filter.range[field].lt;
+        }
+
+        filter.range[field].lt = val;
+        return this;
+      },
+
+      /**
+            Less than or equal to value.  Same as setting to to the value, 
+            and include_upper to true.
+
+            @member ejs.RangeFilter
+            @param {*} val the value, type depends on field type
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      lte: function (val) {
+        if (val == null) {
+          return filter.range[field].lte;
+        }
+
+        filter.range[field].lte = val;
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>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.</p>
+
+    @name ejs.RegexpFilter
+    @ejs filter
+    @borrows ejs.FilterMixin.name as name
+    @borrows ejs.FilterMixin.cache as cache
+    @borrows ejs.FilterMixin.cacheKey as cacheKey
+    @borrows ejs.FilterMixin._type as _type
+    @borrows ejs.FilterMixin.toJSON as toJSON
+
+    @desc
+    Matches documents that have fields matching a regular expression.
+
+    @param {String} field A valid field name.
+    @param {String} value A regex pattern.
+    */
+  ejs.RegexpFilter = function (field, value) {
+
+    var
+    _common = ejs.FilterMixin('regexp'),
+    filter = _common.toJSON();
+
+    filter.regexp[field] = {
+      value: value
+    };
+
+    return extend(_common, {
+
+      /**
+             The field to run the filter against.
+
+             @member ejs.RegexpFilter
+             @param {String} f A single field name.
+             @returns {Object} returns <code>this</code> so that calls can be chained.
+             */
+      field: function (f) {
+        var oldValue = filter.regexp[field];
+
+        if (f == null) {
+          return field;
+        }
+
+        delete filter.regexp[field];
+        field = f;
+        filter.regexp[f] = oldValue;
+
+        return this;
+      },
+
+      /**
+            The regexp value.
+
+            @member ejs.RegexpFilter
+            @param {String} p A string regexp
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      value: function (p) {
+        if (p == null) {
+          return filter.regexp[field].value;
+        }
+
+        filter.regexp[field].value = p;
+        return this;
+      },
+
+      /**
+            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: <n-m>
+            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
+
+            @member ejs.RegexpFilter
+            @param {String} f The flags as a string, separate multiple flags with "|".
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      flags: function (f) {
+        if (f == null) {
+          return filter.regexp[field].flags;
+        }
+
+        filter.regexp[field].flags = f;
+        return this;
+      },
+  
+      /**
+            The regex flags to use as a numeric value.  Advanced use only,
+            it is probably better to stick with the <code>flags</code> option.
+        
+            @member ejs.RegexpFilter
+            @param {String} v The flags as a numeric value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      flagsValue: function (v) {
+        if (v == null) {
+          return filter.regexp[field].flags_value;
+        }
+
+        filter.regexp[field].flags_value = v;
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>A filter allowing to define scripts as filters</p>
+
+    @name ejs.ScriptFilter
+    @ejs filter
+    @borrows ejs.FilterMixin.name as name
+    @borrows ejs.FilterMixin.cache as cache
+    @borrows ejs.FilterMixin.cacheKey as cacheKey
+    @borrows ejs.FilterMixin._type as _type
+    @borrows ejs.FilterMixin.toJSON as toJSON
+
+    @desc
+    A filter allowing to define scripts as filters.
+
+    @param {String} script The script as a string.
+    */
+  ejs.ScriptFilter = function (script) {
+
+    var
+      _common = ejs.FilterMixin('script'),
+      filter = _common.toJSON();
+    
+    filter.script.script = script;
+
+    return extend(_common, {
+
+      /**
+            Sets the script.
+
+            @member ejs.ScriptFilter
+            @param {String} s The script as a string.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      script: function (s) {
+        if (s == null) {
+          return filter.script.script;
+        }
+  
+        filter.script.script = s;
+        return this;
+      },
+
+      /**
+            Sets parameters that will be applied to the script.  Overwrites 
+            any existing params.
+
+            @member ejs.ScriptFilter
+            @param {Object} p An object where the keys are the parameter name and 
+              values are the parameter value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      params: function (p) {
+        if (p == null) {
+          return filter.script.params;
+        }
+    
+        filter.script.params = p;
+        return this;
+      },
+    
+      /**
+            Sets the script language.
+
+            @member ejs.ScriptFilter
+            @param {String} lang The script language, default mvel.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      lang: function (lang) {
+        if (lang == null) {
+          return filter.script.lang;
+        }
+  
+        filter.script.lang = lang;
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>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.</p>
+
+    @name ejs.TermFilter
+    @ejs filter
+    @borrows ejs.FilterMixin.name as name
+    @borrows ejs.FilterMixin.cache as cache
+    @borrows ejs.FilterMixin.cacheKey as cacheKey
+    @borrows ejs.FilterMixin._type as _type
+    @borrows ejs.FilterMixin.toJSON as toJSON
+
+    @desc
+    Constructs a filter for docs matching the term added to this object.
+
+    @param {string} fieldName The document field/fieldName to execute the filter against.
+    @param {string} term The literal term used to filter the results.
+    */
+  ejs.TermFilter = function (fieldName, term) {
+
+    var
+      _common = ejs.FilterMixin('term'),
+      filter = _common.toJSON();
+
+    filter.term[fieldName] = term;
+
+    return extend(_common, {
+
+      /**
+             Provides access to the filter fieldName used to construct the 
+             termFilter object.
+             
+             @member ejs.TermFilter
+             @param {String} f the fieldName term
+             @returns {Object} returns <code>this</code> so that calls can be chained.
+              When k is not specified, Returns {String}, the filter fieldName used to construct 
+              the termFilter object.
+             */
+      field: function (f) {
+        var oldValue = filter.term[fieldName];
+      
+        if (f == null) {
+          return fieldName;
+        }
+      
+        delete filter.term[fieldName];
+        fieldName = f;
+        filter.term[fieldName] = oldValue;
+      
+        return this;
+      },
+
+      /**
+             Provides access to the filter term used to construct the 
+             termFilter object.
+             
+             @member ejs.TermFilter
+             @returns {Object} returns <code>this</code> so that calls can be chained.
+              When k is not specified, Returns {String}, the filter term used 
+              to construct the termFilter object.
+             */
+      term: function (v) {
+        if (v == null) {
+          return filter.term[fieldName];
+        }
+      
+        filter.term[fieldName] = v;
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>Filters documents that have fields that match any of the provided 
+    terms (not analyzed)</p>
+
+    @name ejs.TermsFilter
+    @ejs filter
+    @borrows ejs.FilterMixin.name as name
+    @borrows ejs.FilterMixin.cache as cache
+    @borrows ejs.FilterMixin.cacheKey as cacheKey
+    @borrows ejs.FilterMixin._type as _type
+    @borrows ejs.FilterMixin.toJSON as toJSON
+
+    @desc
+    A Filter that matches documents containing provided terms. 
+
+    @param {String} field the document field/key to filter against
+    @param {(String|String[])} terms a single term or an array of terms.
+    */
+  ejs.TermsFilter = function (field, terms) {
+
+    var
+      _common = ejs.FilterMixin('terms'),
+      filter = _common.toJSON(),
+    
+      // make sure we are setup for a list of terms
+      setupTerms = function () {
+        if (!isArray(filter.terms[field])) {
+          filter.terms[field] = [];
+        }
+      },
+    
+      // make sure we are setup for a terms lookup
+      setupLookup = function () {
+        if (isArray(filter.terms[field])) {
+          filter.terms[field] = {};
+        }
+      };
+   
+    if (isArray(terms)) {
+      filter.terms[field] = terms;
+    } else {
+      filter.terms[field] = [terms];
+    }
+
+    return extend(_common, {
+
+      /**
+            Sets the fields to filter against.
+
+            @member ejs.TermsFilter
+            @param {String} f A valid field name.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      field: function (f) {
+        var oldValue = filter.terms[field];
+    
+        if (f == null) {
+          return field;
+        }
+
+        delete filter.terms[field];
+        field = f;
+        filter.terms[f] = oldValue;
+    
+        return this;
+      },
+  
+      /**
+            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.
+
+            @member ejs.TermsFilter
+            @param {(String|String[])} t A single term or an array or terms.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      terms: function (t) {
+        setupTerms();
+        if (t == null) {
+          return filter.terms[field];
+        }
+        
+        if (isArray(t)) {
+          filter.terms[field] = t;
+        } else {
+          filter.terms[field].push(t);
+        }
+    
+        return this;
+      },
+
+      /**
+            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
+            @member ejs.TermsFilter
+            @param {String} idx A valid index name.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      index: function (idx) {
+        setupLookup();
+        if (idx == null) {
+          return filter.terms[field].index;
+        }
+        
+        filter.terms[field].index = idx;
+        return this;
+      },
+
+      /**
+            Sets the type the document containing the terms when performing a 
+            terms lookup.
+
+            @since elasticsearch 0.90
+            @member ejs.TermsFilter
+            @param {String} type A valid type name.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      type: function (type) {
+        setupLookup();
+        if (type == null) {
+          return filter.terms[field].type;
+        }
+        
+        filter.terms[field].type = type;
+        return this;
+      },
+
+
+      /**
+            Sets the document id of the document containing the terms to use
+            when performing a terms lookup.
+
+            @since elasticsearch 0.90
+            @member ejs.TermsFilter
+            @param {String} id A valid index name.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      id: function (id) {
+        setupLookup();
+        if (id == null) {
+          return filter.terms[field].id;
+        }
+        
+        filter.terms[field].id = id;
+        return this;
+      },
+      
+      /**
+            Sets the path/field name where the terms in the source document
+            are located when performing a terms lookup.
+
+            @since elasticsearch 0.90
+            @member ejs.TermsFilter
+            @param {String} path A valid index name.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      path: function (path) {
+        setupLookup();
+        if (path == null) {
+          return filter.terms[field].path;
+        }
+        
+        filter.terms[field].path = path;
+        return this;
+      },
+      
+      /**
+            Sets the routing value for the source document when performing a 
+            terms lookup.
+
+            @since elasticsearch 0.90.2
+            @member ejs.TermsFilter
+            @param {String} path A valid index name.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      routing: function (r) {
+        setupLookup();
+        if (r == null) {
+          return filter.terms[field].routing;
+        }
+        
+        filter.terms[field].routing = r;
+        return this;
+      },
+      
+      /**
+            Enable or disable caching of the lookup
+
+            @member ejs.TermsFilter
+            @param {Boolean} trueFalse True to cache the lookup, false otherwise.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      cacheLookup: function (trueFalse) {
+        setupLookup();
+        if (trueFalse == null) {
+          return filter.terms[field].cache;
+        }
+
+        filter.terms[field].cache = trueFalse;
+        return this;
+      },
+      
+      /**
+            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.
+
+            @member ejs.TermsFilter
+            @param {String} e A valid execution method.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      execution: function (e) {
+        if (e == null) {
+          return filter.terms.execution;
+        }
+      
+        e = e.toLowerCase();
+        if (e === 'plain' || e === 'bool' || e === 'bool_nocache' || 
+          e === 'and' || e === 'and_nocache' || e === 'or' || e === 'or_nocache') {
+          filter.terms.execution = e;
+        }
+      
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>A Filter that filters results by a specified index type.</p>
+
+    @name ejs.TypeFilter
+    @ejs filter
+    @borrows ejs.FilterMixin.name as name
+    @borrows ejs.FilterMixin.cache as cache
+    @borrows ejs.FilterMixin.cacheKey as cacheKey
+    @borrows ejs.FilterMixin._type as _type
+    @borrows ejs.FilterMixin.toJSON as toJSON
+
+    @desc
+    Filter results by a specified index type.
+
+    @param {String} type the index type to filter on.
+    */
+  ejs.TypeFilter = function (type) {
+
+    var 
+    _common = ejs.FilterMixin('type'),
+    filter = _common.toJSON();
+    
+    filter.type.value = type;
+
+    return extend(_common, {
+
+      /**
+             Sets the type
+
+             @member ejs.TypeFilter
+             @param {String} type the index type to filter on
+             @returns {Object} returns <code>this</code> so that calls can be chained.
+             */
+      type: function (type) {
+        if (type == null) {
+          return filter.type.value;
+        }
+      
+        filter.type.value = type;
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>A <code>boolQuery</code> allows you to build <em>Boolean</em> query constructs
+    from individual term or phrase queries. For example you might want to search
+    for documents containing the terms <code>javascript</code> and <code>python</code>.</p>
+
+    @name ejs.BoolQuery
+    @ejs query
+    @borrows ejs.QueryMixin.boost as boost
+    @borrows ejs.QueryMixin._type as _type
+    @borrows ejs.QueryMixin.toJSON as toJSON
+
+    @desc
+    A Query that matches documents matching boolean combinations of other
+    queries, e.g. <code>termQuerys, phraseQuerys</code> or other <code>boolQuerys</code>.
+
+    */
+  ejs.BoolQuery = function () {
+
+    var
+      _common = ejs.QueryMixin('bool'),
+      query = _common.toJSON();
+
+    return extend(_common, {
+
+      /**
+             Adds query to boolean container. Given query "must" appear in matching documents.
+
+             @member ejs.BoolQuery
+             @param {Object} oQuery A valid <code>Query</code> object
+             @returns {Object} returns <code>this</code> so that calls can be chained.
+             */
+      must: function (oQuery) {
+        var i, len;
+        
+        if (query.bool.must == null) {
+          query.bool.must = [];
+        }
+    
+        if (oQuery == null) {
+          return query.bool.must;
+        }
+
+        if (isQuery(oQuery)) {
+          query.bool.must.push(oQuery.toJSON());
+        } else if (isArray(oQuery)) {
+          query.bool.must = [];
+          for (i = 0, len = oQuery.length; i < len; i++) {
+            if (!isQuery(oQuery[i])) {
+              throw new TypeError('Argument must be an array of Queries');
+            }
+            
+            query.bool.must.push(oQuery[i].toJSON());
+          }
+        } else {
+          throw new TypeError('Argument must be a Query or array of Queries');
+        }
+        
+        return this;
+      },
+
+      /**
+             Adds query to boolean container. Given query "must not" appear in matching documents.
+
+             @member ejs.BoolQuery
+             @param {Object} oQuery A valid query object
+             @returns {Object} returns <code>this</code> so that calls can be chained.
+             */
+      mustNot: function (oQuery) {
+        var i, len;
+        
+        if (query.bool.must_not == null) {
+          query.bool.must_not = [];
+        }
+
+        if (oQuery == null) {
+          return query.bool.must_not;
+        }
+    
+        if (isQuery(oQuery)) {
+          query.bool.must_not.push(oQuery.toJSON());
+        } else if (isArray(oQuery)) {
+          query.bool.must_not = [];
+          for (i = 0, len = oQuery.length; i < len; i++) {
+            if (!isQuery(oQuery[i])) {
+              throw new TypeError('Argument must be an array of Queries');
+            }
+            
+            query.bool.must_not.push(oQuery[i].toJSON());
+          }
+        } else {
+          throw new TypeError('Argument must be a Query or array of Queries');
+        }
+        
+        return this;
+      },
+
+      /**
+             Adds query to boolean container. Given query "should" appear in matching documents.
+
+             @member ejs.BoolQuery
+             @param {Object} oQuery A valid query object
+             @returns {Object} returns <code>this</code> so that calls can be chained.
+             */
+      should: function (oQuery) {
+        var i, len;
+        
+        if (query.bool.should == null) {
+          query.bool.should = [];
+        }
+
+        if (oQuery == null) {
+          return query.bool.should;
+        }
+    
+        if (isQuery(oQuery)) {
+          query.bool.should.push(oQuery.toJSON());
+        } else if (isArray(oQuery)) {
+          query.bool.should = [];
+          for (i = 0, len = oQuery.length; i < len; i++) {
+            if (!isQuery(oQuery[i])) {
+              throw new TypeError('Argument must be an array of Queries');
+            }
+            
+            query.bool.should.push(oQuery[i].toJSON());
+          }
+        } else {
+          throw new TypeError('Argument must be a Query or array of Queries');
+        }
+        
+        return this;
+      },
+
+      /**
+            Sets if the <code>Query</code> should be enhanced with a
+            <code>MatchAllQuery</code> in order to act as a pure exclude when
+            only negative (mustNot) clauses exist. Default: true.
+
+            @member ejs.BoolQuery
+            @param {String} trueFalse A <code>true/false</code value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      adjustPureNegative: function (trueFalse) {
+        if (trueFalse == null) {
+          return query.bool.adjust_pure_negative;
+        }
+
+        query.bool.adjust_pure_negative = trueFalse;
+        return this;
+      },
+      
+      /**
+            Enables or disables similarity coordinate scoring of documents
+            matching the <code>Query</code>. Default: false.
+
+            @member ejs.BoolQuery
+            @param {String} trueFalse A <code>true/false</code value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      disableCoord: function (trueFalse) {
+        if (trueFalse == null) {
+          return query.bool.disable_coord;
+        }
+
+        query.bool.disable_coord = trueFalse;
+        return this;
+      },
+
+      /**
+            <p>Sets the number of optional clauses that must match.</p>
+      
+            <p>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.</p>
+
+            <p>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.</p>
+   
+            @member ejs.BoolQuery
+            @param {Integer} minMatch A positive <code>integer</code> value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      minimumNumberShouldMatch: function (minMatch) {
+        if (minMatch == null) {
+          return query.bool.minimum_number_should_match;
+        }
+
+        query.bool.minimum_number_should_match = minMatch;
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>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.</p>
+
+    @name ejs.BoostingQuery
+    @ejs query
+    @borrows ejs.QueryMixin.boost as boost
+    @borrows ejs.QueryMixin._type as _type
+    @borrows ejs.QueryMixin.toJSON as toJSON
+
+    @desc
+    <p>Constructs a query that can demote search results.  A negative boost.</p>
+
+    @param {Object} positiveQry Valid query object used to select all matching docs.
+    @param {Object} negativeQry Valid query object to match the undesirable docs 
+      returned within the positiveQry result set.
+    @param {Double} negativeBoost A double value where 0 < n < 1.
+     */
+  ejs.BoostingQuery = function (positiveQry, negativeQry, negativeBoost) {
+
+    if (!isQuery(positiveQry) || !isQuery(negativeQry)) {
+      throw new TypeError('Arguments must be Queries');
+    }
+    
+    var 
+      _common = ejs.QueryMixin('boosting'),
+      query = _common.toJSON();
+    
+    query.boosting.positive = positiveQry.toJSON();
+    query.boosting.negative = negativeQry.toJSON();
+    query.boosting.negative_boost = negativeBoost;
+
+    return extend(_common, {
+    
+      /**
+             Sets the "master" query that determines which results are returned.
+
+             @member ejs.BoostingQuery
+             @param {Object} oQuery A valid <code>Query</code> object
+             @returns {Object} returns <code>this</code> so that calls can be 
+              chained. Returns {Object} current positive query if oQuery is
+              not specified.
+             */
+      positive: function (oQuery) {
+        if (oQuery == null) {
+          return query.boosting.positive;
+        }
+    
+        if (!isQuery(oQuery)) {
+          throw new TypeError('Argument must be a Query');
+        }
+        
+        query.boosting.positive = oQuery.toJSON();
+        return this;
+      },
+
+      /**
+             Sets the query used to match documents in the <code>positive</code>
+             query that will be negatively boosted.
+
+             @member ejs.BoostingQuery
+             @param {Object} oQuery A valid <code>Query</code> object
+             @returns {Object} returns <code>this</code> so that calls can be 
+              chained. Returns {Object} current negative query if oQuery is
+              not specified.
+             */
+      negative: function (oQuery) {
+        if (oQuery == null) {
+          return query.boosting.negative;
+        }
+    
+        if (!isQuery(oQuery)) {
+          throw new TypeError('Argument must be a Query');
+        }
+        
+        query.boosting.negative = oQuery.toJSON();
+        return this;
+      },
+   
+      /**
+            Sets the negative boost value.
+
+            @member ejs.BoostingQuery
+            @param {Double} boost A positive <code>double</code> value where 0 < n < 1.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      negativeBoost: function (negBoost) {
+        if (negBoost == null) {
+          return query.boosting.negative_boost;
+        }
+
+        query.boosting.negative_boost = negBoost;
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>A query that executes high-frequency terms in a optional sub-query to 
+    prevent slow queries due to "common" terms like stopwords.</p>
+  
+    <p>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.</p>
+  
+    <p><code>CommonTermsQuery</code> 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.</p>
+  
+    @name ejs.CommonTermsQuery
+    @ejs query
+    @borrows ejs.QueryMixin._type as _type
+    @borrows ejs.QueryMixin.toJSON as toJSON
+  
+    @desc
+    A query that executes high-frequency terms in a optional sub-query.
+
+    @param {String} field the document field/key to query against
+    @param {String} qstr the query string
+    */
+  ejs.CommonTermsQuery = function (field, qstr) {
+
+    var
+      _common = ejs.QueryMixin('common'),
+      query = _common.toJSON();
+  
+    // support for full Builder functionality where no constructor is used
+    // use dummy field until one is set
+    if (field == null) {
+      field = 'no_field_set';
+    }
+  
+    query.common[field] = {};
+  
+    // only set the query is one is passed in
+    if (qstr != null) {
+      query.common[field].query = qstr;
+    }
+  
+    return extend(_common, {
+
+      /**
+            Sets the field to query against.
+
+            @member ejs.CommonTermsQuery
+            @param {String} f A valid field name.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      field: function (f) {
+        var oldValue = query.common[field];
+    
+        if (f == null) {
+          return field;
+        }
+
+        delete query.common[field];
+        field = f;
+        query.common[f] = oldValue;
+    
+        return this;
+      },
+  
+      /**
+            Sets the query string.
+
+            @member ejs.CommonTermsQuery
+            @param {String} qstr The query string.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      query: function (qstr) {
+        if (qstr == null) {
+          return query.common[field].query;
+        }
+
+        query.common[field].query = qstr;
+        return this;
+      },
+
+      /**
+            Sets the analyzer name used to analyze the <code>Query</code> object.
+
+            @member ejs.CommonTermsQuery
+            @param {String} analyzer A valid analyzer name.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      analyzer: function (analyzer) {
+        if (analyzer == null) {
+          return query.common[field].analyzer;
+        }
+
+        query.common[field].analyzer = analyzer;
+        return this;
+      },
+    
+      /**
+            Enables or disables similarity coordinate scoring of documents
+            commoning the <code>Query</code>. Default: false.
+
+            @member ejs.CommonTermsQuery
+            @param {String} trueFalse A <code>true/false</code value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      disableCoord: function (trueFalse) {
+        if (trueFalse == null) {
+          return query.common[field].disable_coord;
+        }
+
+        query.common[field].disable_coord = trueFalse;
+        return this;
+      },
+          
+      /**
+            Sets the maximum threshold/frequency to be considered a low 
+            frequency term.  Set to a value between 0 and 1.
+
+            @member ejs.CommonTermsQuery
+            @param {Number} freq A positive <code>double</code> value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      cutoffFrequency: function (freq) {
+        if (freq == null) {
+          return query.common[field].cutoff_frequency;
+        }
+
+        query.common[field].cutoff_frequency = freq;
+        return this;
+      },
+
+      /**
+            Sets the boolean operator to be used for high frequency terms.
+            Default: AND
+
+            @member ejs.CommonTermsQuery
+            @param {String} op Any of "and" or "or", no quote characters.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      highFreqOperator: function (op) {
+        if (op == null) {
+          return query.common[field].high_freq_operator;
+        }
+
+        op = op.toLowerCase();
+        if (op === 'and' || op === 'or') {
+          query.common[field].high_freq_operator = op;
+        }
+
+        return this;
+      },
+    
+      /**
+            Sets the boolean operator to be used for low frequency terms.
+            Default: AND
+          
+            @member ejs.CommonTermsQuery
+            @param {String} op Any of "and" or "or", no quote characters.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      lowFreqOperator: function (op) {
+        if (op == null) {
+          return query.common[field].low_freq_operator;
+        }
+
+        op = op.toLowerCase();
+        if (op === 'and' || op === 'or') {
+          query.common[field].low_freq_operator = op;
+        }
+
+        return this;
+      },
+    
+      /**
+            Sets the minimum number of low freq matches that need to match in 
+            a document before that document is returned in the results.
+
+            @member ejs.CommonTermsQuery
+            @param {Integer} min A positive integer.
+            @returns {Object} returns <code>this</code> 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 = {};
+        }
+        
+        query.common[field].minimum_should_match.low_freq = min;
+        return this;
+      },
+
+      /**
+            Sets the minimum number of low freq matches that need to match in 
+            a document before that document is returned in the results.
+
+            @member ejs.CommonTermsQuery
+            @param {Integer} min A positive integer.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      minimumShouldMatchLowFreq: function (min) {
+        return this.minimumShouldMatch(min);
+      },
+      
+      /**
+            Sets the minimum number of high freq matches that need to match in 
+            a document before that document is returned in the results.
+
+            @member ejs.CommonTermsQuery
+            @param {Integer} min A positive integer.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      minimumShouldMatchHighFreq: function (min) {
+        if (min == null) {
+          return query.common[field].minimum_should_match.high_freq;
+        }
+    
+        if (query.common[field].minimum_should_match == null) {
+          query.common[field].minimum_should_match = {};
+        }
+        
+        query.common[field].minimum_should_match.high_freq = min;
+        return this;
+      },
+      
+      /**
+            Sets the boost value for documents commoning the <code>Query</code>.
+
+            @member ejs.CommonTermsQuery
+            @param {Number} boost A positive <code>double</code> value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      boost: function (boost) {
+        if (boost == null) {
+          return query.common[field].boost;
+        }
+
+        query.common[field].boost = boost;
+        return this;
+      }
+
+    });
+  };
+
+  /**
+    @class
+    <p>A constant score query wraps another <code>Query</code> or
+    <code>Filter</code> and returns a constant score for each
+    result that is equal to the query boost.</p>
+
+    <p>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.</p>
+
+    @name ejs.ConstantScoreQuery
+    @ejs query
+    @borrows ejs.QueryMixin.boost as boost
+    @borrows ejs.QueryMixin._type as _type
+    @borrows ejs.QueryMixin.toJSON as toJSON
+
+    @desc
+    <p>Constructs a query where each documents returned by the internal
+    query or filter have a constant score equal to the boost factor.</p>
+
+     */
+  ejs.ConstantScoreQuery = function () {
+
+    var
+      _common = ejs.QueryMixin('constant_score'),
+      query = _common.toJSON();
+
+    return extend(_common, {
+      /**
+             Adds the query to apply a constant score to.
+
+             @member ejs.ConstantScoreQuery
+             @param {Object} oQuery A valid <code>Query</code> object
+             @returns {Object} returns <code>this</code> so that calls can be chained.
+             */
+      query: function (oQuery) {
+        if (oQuery == null) {
+          return query.constant_score.query;
+        }
+      
+        if (!isQuery(oQuery)) {
+          throw new TypeError('Argument must be a Query');
+        }
+        
+        query.constant_score.query = oQuery.toJSON();
+        return this;
+      },
+
+      /**
+             Adds the filter to apply a constant score to.
+
+             @member ejs.ConstantScoreQuery
+             @param {Object} oFilter A valid <code>Filter</code> object
+             @returns {Object} returns <code>this</code> so that calls can be chained.
+             */
+      filter: function (oFilter) {
+        if (oFilter == null) {
+          return query.constant_score.filter;
+        }
+      
+        if (!isFilter(oFilter)) {
+          throw new TypeError('Argument must be a Filter');
+        }
+        
+        query.constant_score.filter = oFilter.toJSON();
+        return this;
+      },
+
+      /**
+            Enables caching of the filter.
+
+            @member ejs.ConstantScoreQuery
+            @param {Boolean} trueFalse A boolean value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      cache: function (trueFalse) {
+        if (trueFalse == null) {
+          return query.constant_score._cache;
+        }
+
+        query.constant_score._cache = trueFalse;
+        return this;
+      },
+      
+      /**
+            Set the cache key.
+
+            @member ejs.ConstantScoreQuery
+            @param {String} k A string cache key.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      cacheKey: function (k) {
+        if (k == null) {
+          return query.constant_score._cache_key;
+        }
+
+        query.constant_score._cache_key = k;
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    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.
+
+    @name ejs.DisMaxQuery
+    @ejs query
+    @borrows ejs.QueryMixin.boost as boost
+    @borrows ejs.QueryMixin._type as _type
+    @borrows ejs.QueryMixin.toJSON as toJSON
+
+    @desc
+    A query that generates the union of documents produced by its subqueries such
+    as <code>termQuerys, phraseQuerys</code>, <code>boolQuerys</code>, etc.
+
+    */
+  ejs.DisMaxQuery = function () {
+
+    var
+      _common = ejs.QueryMixin('dis_max'),
+      query = _common.toJSON();
+
+    return extend(_common, {
+
+      /**
+            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.
+
+            @member ejs.DisMaxQuery
+            @param {(Query|Query[])} qs A single Query or an array of Queries
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      queries: function (qs) {
+        var i, len;
+        
+        if (qs == null) {
+          return query.dis_max.queries;
+        }
+      
+        if (query.dis_max.queries == null) {
+          query.dis_max.queries = [];
+        }
+        
+        if (isQuery(qs)) {
+          query.dis_max.queries.push(qs.toJSON());
+        } else if (isArray(qs)) {
+          query.dis_max.queries = [];
+          for (i = 0, len = qs.length; i < len; i++) {
+            if (!isQuery(qs[i])) {
+              throw new TypeError('Argument must be array of Queries');
+            }
+            
+            query.dis_max.queries.push(qs[i].toJSON());
+          }
+        } else {
+          throw new TypeError('Argument must be a Query or array of Queries');
+        }
+
+        return this;
+      },
+
+      /**
+            <p>The tie breaker value.</p>  
+
+            <p>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.</p>  
+
+            <p>Default: 0.0.</p>
+
+            @member ejs.DisMaxQuery
+            @param {Double} tieBreaker A positive <code>double</code> value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      tieBreaker: function (tieBreaker) {
+        if (tieBreaker == null) {
+          return query.dis_max.tie_breaker;
+        }
+
+        query.dis_max.tie_breaker = tieBreaker;
+        return this;
+      }
+      
+    });
+  };
+  
+
+  /**
+    @class
+    <p>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.</p>
+
+    @name ejs.FieldMaskingSpanQuery
+    @ejs query
+    @borrows ejs.QueryMixin.boost as boost
+    @borrows ejs.QueryMixin._type as _type
+    @borrows ejs.QueryMixin.toJSON as toJSON
+
+    @desc
+    Wraps a SpanQuery and hides the real field being searched across.
+
+    @param {Query} spanQry A valid SpanQuery
+    @param {Integer} field the maximum field position in a match.
+  
+    */
+  ejs.FieldMaskingSpanQuery = function (spanQry, field) {
+
+    if (!isQuery(spanQry)) {
+      throw new TypeError('Argument must be a SpanQuery');
+    }
+  
+    var 
+      _common = ejs.QueryMixin('field_masking_span'),
+      query = _common.toJSON();
+    
+    query.field_masking_span.query = spanQry.toJSON();
+    query.field_masking_span.field = field;
+
+    return extend(_common, {
+
+      /**
+            Sets the span query to wrap.
+
+            @member ejs.FieldMaskingSpanQuery
+            @param {Query} spanQuery Any valid span type query.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      query: function (spanQuery) {
+        if (spanQuery == null) {
+          return query.field_masking_span.query;
+        }
+    
+        if (!isQuery(spanQuery)) {
+          throw new TypeError('Argument must be a SpanQuery');
+        }
+      
+        query.field_masking_span.query = spanQuery.toJSON();
+        return this;
+      },
+
+      /**
+            Sets the value of the "masked" field.  
+
+            @member ejs.FieldMaskingSpanQuery
+            @param {String} f A field name the wrapped span query should use
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      field: function (f) {
+        if (f == null) {
+          return query.field_masking_span.field;
+        }
+    
+        query.field_masking_span.field = f;
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>Filter queries allow you to restrict the results returned by a query. There are
+    several different types of filters that can be applied
+    (see <a href="/jsdocs/ejs.filter.html">filter</a> module). A <code>filterQuery</code>
+    takes a <code>Query</code> and a <code>Filter</code> object as arguments and constructs
+    a new <code>Query</code> that is then used for the search.</p>
+
+    @name ejs.FilteredQuery
+    @ejs query
+    @borrows ejs.QueryMixin.boost as boost
+    @borrows ejs.QueryMixin._type as _type
+    @borrows ejs.QueryMixin.toJSON as toJSON
+
+    @desc
+    <p>A query that applies a filter to the results of another query.</p>
+
+    @param {Object} someQuery a valid <code>Query</code> object
+    @param {Object} someFilter a valid <code>Filter</code> object.  This parameter
+      is optional.
+
+     */
+  ejs.FilteredQuery = function (someQuery, someFilter) {
+
+    if (!isQuery(someQuery)) {
+      throw new TypeError('Argument must be a Query');
+    }
+    
+    if (someFilter != null && !isFilter(someFilter)) {
+      throw new TypeError('Argument must be a Filter');
+    }
+    
+    var 
+      _common = ejs.QueryMixin('filtered'),
+      query = _common.toJSON();
+    
+    query.filtered.query = someQuery.toJSON();
+
+    if (someFilter != null) {
+      query.filtered.filter = someFilter.toJSON();
+    }
+    
+    return extend(_common, {
+
+      /**
+             <p>Adds the query to apply a constant score to.</p>
+
+             @member ejs.FilteredQuery
+             @param {Object} oQuery A valid <code>Query</code> object
+             @returns {Object} returns <code>this</code> so that calls can be chained.
+             */
+      query: function (oQuery) {
+        if (oQuery == null) {
+          return query.filtered.query;
+        }
+      
+        if (!isQuery(oQuery)) {
+          throw new TypeError('Argument must be a Query');
+        }
+        
+        query.filtered.query = oQuery.toJSON();
+        return this;
+      },
+
+      /**
+             <p>Adds the filter to apply a constant score to.</p>
+
+             @member ejs.FilteredQuery
+             @param {Object} oFilter A valid <code>Filter</code> object
+             @returns {Object} returns <code>this</code> so that calls can be chained.
+             */
+      filter: function (oFilter) {
+        if (oFilter == null) {
+          return query.filtered.filter;
+        }
+      
+        if (!isFilter(oFilter)) {
+          throw new TypeError('Argument must be a Filter');
+        }
+        
+        query.filtered.filter = oFilter.toJSON();
+        return this;
+      },
+
+      /**
+            <p>Sets the filter strategy.</p>  
+
+            <p>The strategy defines how the filter is applied during document collection.  
+            Valid values are:</p>
+            
+            <dl>
+                <dd><code>query_first</code> - advance query scorer first then filter</dd>
+                <dd><code>random_access_random</code> - random access filter</dd>
+                <dd><code>leap_frog</code> - query scorer and filter "leap-frog", query goes first</dd>
+                <dd><code>leap_frog_filter_first</code> - same as <code>leap_frog</code>, but filter goes first</dd>
+                <dd><code>random_access_N</code> - replace <code>N</code> with integer, same as random access 
+                 except you can specify a custom threshold</dd>
+            </dl>
+
+            <p>This is an advanced setting, use with care.</p>
+            
+            @member ejs.FilteredQuery
+            @param {String} strategy The strategy as a string.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      strategy: function (strategy) {
+        if (strategy == null) {
+          return query.filtered.strategy;
+        }
+
+        strategy = strategy.toLowerCase();
+        if (strategy === 'query_first' || strategy === 'random_access_always' ||
+          strategy === 'leap_frog' || strategy === 'leap_frog_filter_first' ||
+          strategy.indexOf('random_access_') === 0) {
+            
+          query.filtered.strategy = strategy;
+        }
+        
+        return this;
+      },
+      
+      /**
+            <p>Enables caching of the filter.</p>
+
+            @member ejs.FilteredQuery
+            @param {Boolean} trueFalse A boolean value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      cache: function (trueFalse) {
+        if (trueFalse == null) {
+          return query.filtered._cache;
+        }
+
+        query.filtered._cache = trueFalse;
+        return this;
+      },
+      
+      /**
+            <p>Set the cache key.</p>
+
+            @member ejs.FilteredQuery
+            @param {String} k A string cache key.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      cacheKey: function (k) {
+        if (k == null) {
+          return query.filtered._cache_key;
+        }
+
+        query.filtered._cache_key = k;
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>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.</p>
+
+    @name ejs.FunctionScoreQuery
+    @ejs query
+    @borrows ejs.QueryMixin.boost as boost
+    @borrows ejs.QueryMixin._type as _type
+    @borrows ejs.QueryMixin.toJSON as toJSON
+
+    @desc
+    <p>A query that allows you to modify the score of matching documents.</p>
+
+     */
+  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 <code>Query</code> object
+      @returns {Object} returns <code>this</code> 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 <code>Filter</code> object
+      @returns {Object} returns <code>this</code> 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 <code>this</code> 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 <code>this</code> 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 <code>float</code> value.
+      @returns {Object} returns <code>this</code> 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 <code>float</code> value.
+      @returns {Object} returns <code>this</code> 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 <code>float</code> value.
+      @returns {Object} returns <code>this</code> 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 <code>ScoreFunction</code> object.
+      @returns {Object} returns <code>this</code> 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 <code>ScoreFunctions</code>.
+      @returns {Object} returns <code>this</code> 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
+    <p>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).</p>
+
+    <p>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.</p>
+
+    <p>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.</p>
+
+    @name ejs.FuzzyLikeThisFieldQuery
+    @ejs query
+    @borrows ejs.QueryMixin._type as _type
+    @borrows ejs.QueryMixin.toJSON as toJSON
+
+    @desc
+    <p>Constructs a query where each documents returned are “like” provided text</p>
+
+    @param {String} field The field to run the query against.
+    @param {String} likeText The text to find documents like it.
+    */
+  ejs.FuzzyLikeThisFieldQuery = function (field, likeText) {
+
+    var
+      _common = ejs.QueryMixin('flt_field'),
+      query = _common.toJSON();
+
+    query.flt_field[field] = {
+      like_text: likeText
+    };
+  
+    return extend(_common, {
+  
+      /**
+             The field to run the query against.
+
+             @member ejs.FuzzyLikeThisFieldQuery
+             @param {String} f A single field name.
+             @returns {Object} returns <code>this</code> so that calls can be chained.
+             */
+      field: function (f) {
+        var oldValue = query.flt_field[field];
+      
+        if (f == null) {
+          return field;
+        }
+    
+        delete query.flt_field[field];
+        field = f;
+        query.flt_field[f] = oldValue;
+    
+        return this;
+      },
+  
+      /**
+            The text to find documents like
+
+            @member ejs.FuzzyLikeThisFieldQuery
+            @param {String} s A text string.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      likeText: function (txt) {
+        if (txt == null) {
+          return query.flt_field[field].like_text;
+        }
+  
+        query.flt_field[field].like_text = txt;
+        return this;
+      },
+
+      /**
+            Should term frequency be ignored. Defaults to false.
+
+            @member ejs.FuzzyLikeThisFieldQuery
+            @param {Boolean} trueFalse A boolean value
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      ignoreTf: function (trueFalse) {
+        if (trueFalse == null) {
+          return query.flt_field[field].ignore_tf;
+        }
+  
+        query.flt_field[field].ignore_tf = trueFalse;
+        return this;
+      },
+
+      /**
+            The maximum number of query terms that will be included in any 
+            generated query. Defaults to 25.
+
+            @member ejs.FuzzyLikeThisFieldQuery
+            @param {Integer} max A positive integer value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      maxQueryTerms: function (max) {
+        if (max == null) {
+          return query.flt_field[field].max_query_terms;
+        }
+  
+        query.flt_field[field].max_query_terms = max;
+        return this;
+      },
+
+      /**
+            The minimum similarity of the term variants. Defaults to 0.5.
+
+            @member ejs.FuzzyLikeThisFieldQuery
+            @param {Double} min A positive double value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      minSimilarity: function (min) {
+        if (min == null) {
+          return query.flt_field[field].min_similarity;
+        }
+  
+        query.flt_field[field].min_similarity = min;
+        return this;
+      },
+
+      /**
+            Length of required common prefix on variant terms. Defaults to 0..
+
+            @member ejs.FuzzyLikeThisFieldQuery
+            @param {Integer} len A positive integer value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      prefixLength: function (len) {
+        if (len == null) {
+          return query.flt_field[field].prefix_length;
+        }
+  
+        query.flt_field[field].prefix_length = len;
+        return this;
+      },
+
+      /**
+            The analyzer that will be used to analyze the text. Defaults to the 
+            analyzer associated with the field.
+
+            @member ejs.FuzzyLikeThisFieldQuery
+            @param {String} analyzerName The name of the analyzer.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      analyzer: function (analyzerName) {
+        if (analyzerName == null) {
+          return query.flt_field[field].analyzer;
+        }
+  
+        query.flt_field[field].analyzer = analyzerName;
+        return this;
+      },
+      
+      /**
+            Should the <code>Query</code> fail when an unsupported field
+            is specified. Defaults to true.
+
+            @member ejs.FuzzyLikeThisFieldQuery
+            @param {Boolean} trueFalse A boolean value
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      failOnUnsupportedField: function (trueFalse) {
+        if (trueFalse == null) {
+          return query.flt_field[field].fail_on_unsupported_field;
+        }
+  
+        query.flt_field[field].fail_on_unsupported_field = trueFalse;
+        return this;
+      },
+                     
+      /**
+            Sets the boost value of the <code>Query</code>.
+
+            @member ejs.FuzzyLikeThisFieldQuery
+            @param {Double} boost A positive <code>double</code> value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      boost: function (boost) {
+        if (boost == null) {
+          return query.flt_field[field].boost;
+        }
+
+        query.flt_field[field].boost = boost;
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>Fuzzy like this query find documents that are “like” provided text by 
+    running it against one or more fields.</p>
+
+    <p>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.</p>
+  
+    <p>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.</p>
+
+    @name ejs.FuzzyLikeThisQuery
+    @ejs query
+    @borrows ejs.QueryMixin.boost as boost
+    @borrows ejs.QueryMixin._type as _type
+    @borrows ejs.QueryMixin.toJSON as toJSON
+
+    @desc
+    <p>Constructs a query where each documents returned are “like” provided text</p>
+
+    @param {String} likeText The text to find documents like it.
+    */
+  ejs.FuzzyLikeThisQuery = function (likeText) {
+
+    var 
+      _common = ejs.QueryMixin('flt'),
+      query = _common.toJSON();
+    
+    query.flt.like_text = likeText;
+
+    return extend(_common, {
+    
+      /**
+             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.
+
+             @member ejs.FuzzyLikeThisQuery
+             @param {(String|String[])} f A single field name or a list of field names.
+             @returns {Object} returns <code>this</code> so that calls can be chained.
+             */
+      fields: function (f) {
+        if (query.flt.fields == null) {
+          query.flt.fields = [];
+        }
+      
+        if (f == null) {
+          return query.flt.fields;
+        }
+      
+        if (isString(f)) {
+          query.flt.fields.push(f);
+        } else if (isArray(f)) {
+          query.flt.fields = f;
+        } else {
+          throw new TypeError('Argument must be a string or array');
+        }
+      
+        return this;
+      },
+    
+      /**
+            The text to find documents like
+
+            @member ejs.FuzzyLikeThisQuery
+            @param {String} s A text string.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      likeText: function (txt) {
+        if (txt == null) {
+          return query.flt.like_text;
+        }
+    
+        query.flt.like_text = txt;
+        return this;
+      },
+
+      /**
+            Should term frequency be ignored. Defaults to false.
+
+            @member ejs.FuzzyLikeThisQuery
+            @param {Boolean} trueFalse A boolean value
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      ignoreTf: function (trueFalse) {
+        if (trueFalse == null) {
+          return query.flt.ignore_tf;
+        }
+    
+        query.flt.ignore_tf = trueFalse;
+        return this;
+      },
+
+      /**
+            The maximum number of query terms that will be included in any 
+            generated query. Defaults to 25.
+
+            @member ejs.FuzzyLikeThisQuery
+            @param {Integer} max A positive integer value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      maxQueryTerms: function (max) {
+        if (max == null) {
+          return query.flt.max_query_terms;
+        }
+    
+        query.flt.max_query_terms = max;
+        return this;
+      },
+
+      /**
+            The minimum similarity of the term variants. Defaults to 0.5.
+
+            @member ejs.FuzzyLikeThisQuery
+            @param {Double} min A positive double value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      minSimilarity: function (min) {
+        if (min == null) {
+          return query.flt.min_similarity;
+        }
+    
+        query.flt.min_similarity = min;
+        return this;
+      },
+
+      /**
+            Length of required common prefix on variant terms. Defaults to 0..
+
+            @member ejs.FuzzyLikeThisQuery
+            @param {Integer} len A positive integer value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      prefixLength: function (len) {
+        if (len == null) {
+          return query.flt.prefix_length;
+        }
+    
+        query.flt.prefix_length = len;
+        return this;
+      },
+
+      /**
+            The analyzer that will be used to analyze the text. Defaults to the 
+            analyzer associated with the field.
+
+            @member ejs.FuzzyLikeThisQuery
+            @param {String} analyzerName The name of the analyzer.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      analyzer: function (analyzerName) {
+        if (analyzerName == null) {
+          return query.flt.analyzer;
+        }
+    
+        query.flt.analyzer = analyzerName;
+        return this;
+      },
+      
+      /**
+            Should the <code>Query</code> fail when an unsupported field
+            is specified. Defaults to true.
+
+            @member ejs.FuzzyLikeThisQuery
+            @param {Boolean} trueFalse A boolean value
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      failOnUnsupportedField: function (trueFalse) {
+        if (trueFalse == null) {
+          return query.flt.fail_on_unsupported_field;
+        }
+  
+        query.flt.fail_on_unsupported_field = trueFalse;
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>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>
+  
+    <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".</p>
+
+    @name ejs.FuzzyQuery
+    @ejs query
+    @borrows ejs.QueryMixin._type as _type
+    @borrows ejs.QueryMixin.toJSON as toJSON
+
+    @desc
+    <p>Constructs a query where each documents returned are “like” provided text</p>
+    
+    @param {String} field The field to run the fuzzy query against.
+    @param {String} value The value to fuzzify.
+    
+     */
+  ejs.FuzzyQuery = function (field, value) {
+
+    var
+      _common = ejs.QueryMixin('fuzzy'),
+      query = _common.toJSON();
+
+    query.fuzzy[field] = {
+      value: value
+    };
+
+    return extend(_common, {
+
+      /**
+             <p>The field to run the query against.</p>
+
+             @member ejs.FuzzyQuery
+             @param {String} f A single field name.
+             @returns {Object} returns <code>this</code> so that calls can be chained.
+             */
+      field: function (f) {
+        var oldValue = query.fuzzy[field];
+    
+        if (f == null) {
+          return field;
+        }
+  
+        delete query.fuzzy[field];
+        field = f;
+        query.fuzzy[f] = oldValue;
+  
+        return this;
+      },
+
+      /**
+            <p>The query text to fuzzify.</p>
+
+            @member ejs.FuzzyQuery
+            @param {String} s A text string.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      value: function (txt) {
+        if (txt == null) {
+          return query.fuzzy[field].value;
+        }
+
+        query.fuzzy[field].value = txt;
+        return this;
+      },
+
+      /**
+            <p>Set to false to use classic Levenshtein edit distance.</p>
+
+            @member ejs.FuzzyQuery
+            @param {Boolean} trueFalse A boolean value
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      transpositions: function (trueFalse) {
+        if (trueFalse == null) {
+          return query.fuzzy[field].transpositions;
+        }
+
+        query.fuzzy[field].transpositions = trueFalse;
+        return this;
+      },
+
+      /**
+            <p>The maximum number of query terms that will be included in any 
+            generated query. Defaults to <code>50</code>.<p>
+
+            @member ejs.FuzzyQuery
+            @param {Integer} max A positive integer value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      maxExpansions: function (max) {
+        if (max == null) {
+          return query.fuzzy[field].max_expansions;
+        }
+
+        query.fuzzy[field].max_expansions = max;
+        return this;
+      },
+
+      /**
+            <p>The minimum similarity of the term variants. Defaults to <code>0.5</code>.</p>
+
+            @member ejs.FuzzyQuery
+            @param {Double} min A positive double value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      minSimilarity: function (min) {
+        if (min == null) {
+          return query.fuzzy[field].min_similarity;
+        }
+
+        query.fuzzy[field].min_similarity = min;
+        return this;
+      },
+
+      /**
+            <p>Length of required common prefix on variant terms. Defaults to <code>0</code>.</p>
+
+            @member ejs.FuzzyQuery
+            @param {Integer} len A positive integer value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      prefixLength: function (len) {
+        if (len == null) {
+          return query.fuzzy[field].prefix_length;
+        }
+
+        query.fuzzy[field].prefix_length = len;
+        return this;
+      },
+      
+      /**
+            <p>Sets rewrite method.  Valid values are:</p> 
+            
+            <dl>
+                <dd><code>constant_score_auto</code> - tries to pick the best constant-score rewrite 
+                 method based on term and document counts from the query</dd>
+              
+                <dd><code>scoring_boolean</code> - translates each term into boolean should and 
+                 keeps the scores as computed by the query</dd>
+              
+                <dd><code>constant_score_boolean</code> - same as scoring_boolean, expect no scores
+                 are computed.</dd>
+              
+                <dd><code>constant_score_filter</code> - first creates a private Filter, by visiting 
+                 each term in sequence and marking all docs for that term</dd>
+              
+                <dd><code>top_terms_boost_N</code> - first translates each term into boolean should
+                 and scores are only computed as the boost using the top <code>N</code>
+                 scoring terms.  Replace <code>N</code> with an integer value.</dd>
+              
+                <dd><code>top_terms_N</code> - first translates each term into boolean should
+                 and keeps the scores as computed by the query. Only the top <code>N</code>
+                 scoring terms are used.  Replace <code>N</code> with an integer value.</dd>
+            </dl>
+            
+            <p>Default is <code>constant_score_auto</code>.</p>
+
+            <p>This is an advanced option, use with care.</p>
+
+            @member ejs.FuzzyQuery
+            @param {String} m The rewrite method as a string.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      rewrite: function (m) {
+        if (m == null) {
+          return query.fuzzy[field].rewrite;
+        }
+        
+        m = m.toLowerCase();
+        if (m === 'constant_score_auto' || m === 'scoring_boolean' ||
+          m === 'constant_score_boolean' || m === 'constant_score_filter' ||
+          m.indexOf('top_terms_boost_') === 0 || 
+          m.indexOf('top_terms_') === 0) {
+            
+          query.fuzzy[field].rewrite = m;
+        }
+        
+        return this;
+      },
+      
+                    
+      /**
+            <p>Sets the boost value of the <code>Query</code>.</p>
+
+            @member ejs.FuzzyQuery
+            @param {Double} boost A positive <code>double</code> value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      boost: function (boost) {
+        if (boost == null) {
+          return query.fuzzy[field].boost;
+        }
+
+        query.fuzzy[field].boost = boost;
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>Efficient querying of documents containing shapes indexed using the 
+    geo_shape type.</p>
+
+    <p>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.</p>
+  
+    @name ejs.GeoShapeQuery
+    @ejs query
+    @borrows ejs.QueryMixin._type as _type
+    @borrows ejs.QueryMixin.toJSON as toJSON
+
+    @desc
+    A Query to find documents with a geo_shapes matching a specific shape.
+
+    */
+  ejs.GeoShapeQuery = function (field) {
+
+    var
+      _common = ejs.QueryMixin('geo_shape'),
+      query = _common.toJSON();
+
+    query.geo_shape[field] = {};
+
+    return extend(_common, {
+
+      /**
+            Sets the field to query against.
+
+            @member ejs.GeoShapeQuery
+            @param {String} f A valid field name.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      field: function (f) {
+        var oldValue = query.geo_shape[field];
+    
+        if (f == null) {
+          return field;
+        }
+
+        delete query.geo_shape[field];
+        field = f;
+        query.geo_shape[f] = oldValue;
+    
+        return this;
+      },
+
+      /**
+            Sets the shape
+
+            @member ejs.GeoShapeQuery
+            @param {String} shape A valid <code>Shape</code> object.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      shape: function (shape) {
+        if (shape == null) {
+          return query.geo_shape[field].shape;
+        }
+
+        if (query.geo_shape[field].indexed_shape != null) {
+          delete query.geo_shape[field].indexed_shape;
+        }
+        
+        query.geo_shape[field].shape = shape.toJSON();
+        return this;
+      },
+
+      /**
+            Sets the indexed shape.  Use this if you already have shape definitions
+            already indexed.
+
+            @member ejs.GeoShapeQuery
+            @param {String} indexedShape A valid <code>IndexedShape</code> object.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      indexedShape: function (indexedShape) {
+        if (indexedShape == null) {
+          return query.geo_shape[field].indexed_shape;
+        }
+
+        if (query.geo_shape[field].shape != null) {
+          delete query.geo_shape[field].shape;
+        }
+        
+        query.geo_shape[field].indexed_shape = indexedShape.toJSON();
+        return this;
+      },
+
+      /**
+            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.
+
+            @member ejs.GeoShapeQuery
+            @param {String} indexedShape A valid <code>IndexedShape</code> object.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      relation: function (relation) {
+        if (relation == null) {
+          return query.geo_shape[field].relation;
+        }
+
+        relation = relation.toLowerCase();
+        if (relation === 'intersects' || relation === 'disjoint' || relation === 'within') {
+          query.geo_shape[field].relation = relation;
+        }
+      
+        return this;
+      },
+
+      /**
+            <p>Sets the spatial strategy.</p>  
+            <p>Valid values are:</p>
+            
+            <dl>
+                <dd><code>recursive</code> - default, recursively traverse nodes in
+                  the spatial prefix tree.  This strategy has support for 
+                  searching non-point shapes.</dd>
+                <dd><code>term</code> - uses a large TermsFilter on each node
+                  in the spatial prefix tree.  It only supports the search of 
+                  indexed Point shapes.</dd>
+            </dl>
+
+            <p>This is an advanced setting, use with care.</p>
+            
+            @since elasticsearch 0.90
+            @member ejs.GeoShapeQuery
+            @param {String} strategy The strategy as a string.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      strategy: function (strategy) {
+        if (strategy == null) {
+          return query.geo_shape[field].strategy;
+        }
+
+        strategy = strategy.toLowerCase();
+        if (strategy === 'recursive' || strategy === 'term') {
+          query.geo_shape[field].strategy = strategy;
+        }
+        
+        return this;
+      },
+             
+      /**
+            Sets the boost value for documents matching the <code>Query</code>.
+
+            @member ejs.GeoShapeQuery
+            @param {Number} boost A positive <code>double</code> value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      boost: function (boost) {
+        if (boost == null) {
+          return query.geo_shape[field].boost;
+        }
+
+        query.geo_shape[field].boost = boost;
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>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.</p>
+  
+    @name ejs.HasChildQuery
+    @ejs query
+    @borrows ejs.QueryMixin.boost as boost
+    @borrows ejs.QueryMixin._type as _type
+    @borrows ejs.QueryMixin.toJSON as toJSON
+
+    @desc
+    Returns results that have child documents matching the query.
+
+    @param {Object} qry A valid query object.
+    @param {String} type The child type
+    */
+  ejs.HasChildQuery = function (qry, type) {
+
+    if (!isQuery(qry)) {
+      throw new TypeError('Argument must be a valid Query');
+    }
+    
+    var 
+      _common = ejs.QueryMixin('has_child'),
+      query = _common.toJSON();
+    
+    query.has_child.query = qry.toJSON();
+    query.has_child.type = type;
+
+    return extend(_common, {
+
+      /**
+            Sets the query
+
+            @member ejs.HasChildQuery
+            @param {Object} q A valid Query object
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      query: function (q) {
+        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;
+      },
+
+      /**
+            Sets the child document type to search against
+
+            @member ejs.HasChildQuery
+            @param {String} t A valid type name
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      type: function (t) {
+        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. 
+
+            @deprecated since elasticsearch 0.90
+            @member ejs.HasChildQuery
+            @param {String} s The scope name as a string.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      scope: function (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
+            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 <code>this</code> so that calls can be chained.
+            */
+      scoreType: function (s) {
+        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
+            avg - the average of all matched child documents is used
+
+            @member ejs.HasChildQuery
+            @param {String} s The score type as a string.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      scoreMode: function (s) {
+        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.
+
+            @member ejs.HasChildQuery
+            @param {Integer} cutoff A positive <code>integer</code> value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      shortCircuitCutoff: function (cutoff) {
+        if (cutoff == null) {
+          return query.has_child.short_circuit_cutoff;
+        }
+
+        query.has_child.short_circuit_cutoff = cutoff;
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>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.</p>
+
+    @name ejs.HasParentQuery
+    @ejs query
+    @borrows ejs.QueryMixin.boost as boost
+    @borrows ejs.QueryMixin._type as _type
+    @borrows ejs.QueryMixin.toJSON as toJSON
+
+    @desc
+    Returns results that have parent documents matching the query.
+
+    @param {Object} qry A valid query object.
+    @param {String} parentType The child type
+    */
+  ejs.HasParentQuery = function (qry, parentType) {
+
+    if (!isQuery(qry)) {
+      throw new TypeError('Argument must be a Query');
+    }
+    
+    var 
+      _common = ejs.QueryMixin('has_parent'),
+      query = _common.toJSON();
+    
+    query.has_parent.query = qry.toJSON();
+    query.has_parent.parent_type = parentType;
+
+    return extend(_common, {
+
+      /**
+            Sets the query
+
+            @member ejs.HasParentQuery
+            @param {Object} q A valid Query object
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      query: function (q) {
+        if (q == null) {
+          return query.has_parent.query;
+        }
+  
+        if (!isQuery(q)) {
+          throw new TypeError('Argument must be a Query');
+        }
+        
+        query.has_parent.query = q.toJSON();
+        return this;
+      },
+
+      /**
+            Sets the child document type to search against
+
+            @member ejs.HasParentQuery
+            @param {String} t A valid type name
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      parentType: function (t) {
+        if (t == null) {
+          return query.has_parent.parent_type;
+        }
+  
+        query.has_parent.parent_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 parent documents. 
+
+            @deprecated since elasticsearch 0.90
+            @member ejs.HasParentQuery
+            @param {String} s The scope name as a string.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      scope: function (s) {
+        return this;
+      },
+
+      /**
+            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
+            
+            @member ejs.HasParentQuery
+            @param {String} s The score type as a string.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      scoreType: function (s) {
+        if (s == null) {
+          return query.has_parent.score_type;
+        }
+    
+        s = s.toLowerCase();
+        if (s === 'none' || s === 'score') {
+          query.has_parent.score_type = s;
+        }
+        
+        return this;
+      },
+      
+      /**
+            Sets the scoring method.  Valid values are:
+            
+            none - the default, no scoring
+            score - the score of the parent is used in all child documents.
+            
+            @member ejs.HasParentQuery
+            @param {String} s The score type as a string.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      scoreMode: function (s) {
+        if (s == null) {
+          return query.has_parent.score_mode;
+        }
+    
+        s = s.toLowerCase();
+        if (s === 'none' || s === 'score') {
+          query.has_parent.score_mode = s;
+        }
+        
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>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.</p>
+
+    @name ejs.IdsQuery
+    @ejs query
+    @borrows ejs.QueryMixin.boost as boost
+    @borrows ejs.QueryMixin._type as _type
+    @borrows ejs.QueryMixin.toJSON as toJSON
+
+    @desc
+    Matches documents with the specified id(s).
+
+    @param {(String|String[])} ids A single document id or a list of document ids.
+    */
+  ejs.IdsQuery = function (ids) {
+
+    var
+      _common = ejs.QueryMixin('ids'),
+      query = _common.toJSON();
+    
+    if (isString(ids)) {
+      query.ids.values = [ids];
+    } else if (isArray(ids)) {
+      query.ids.values = ids;
+    } else {
+      throw new TypeError('Argument must be string or array');
+    }
+
+    return extend(_common, {
+
+      /**
+            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.
+
+            @member ejs.IdsQuery
+            @param {(String|String[])} val An single document id or an array of document ids.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      values: function (val) {
+        if (val == null) {
+          return query.ids.values;
+        }
+    
+        if (isString(val)) {
+          query.ids.values.push(val);
+        } else if (isArray(val)) {
+          query.ids.values = val;
+        } else {
+          throw new TypeError('Argument must be string or array');
+        }
+        
+        return this;
+      },
+
+      /**
+            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.
+
+            @member ejs.IdsQuery
+            @param {(String|String[])} type A type or a list of types
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      type: function (type) {
+        if (query.ids.type == null) {
+          query.ids.type = [];
+        }
+        
+        if (type == null) {
+          return query.ids.type;
+        }
+        
+        if (isString(type)) {
+          query.ids.type.push(type);
+        } else if (isArray(type)) {
+          query.ids.type = type;
+        } else {
+          throw new TypeError('Argument must be string or array');
+        }
+        
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>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.</p>
+
+    @name ejs.IndicesQuery
+    @ejs query
+    @borrows ejs.QueryMixin.boost as boost
+    @borrows ejs.QueryMixin._type as _type
+    @borrows ejs.QueryMixin.toJSON as toJSON
+
+    @desc
+    A configurable query that is dependent on the index name.
+
+    @param {Query} qry A valid query object.
+    @param {(String|String[])} indices a single index name or an array of index 
+      names.
+    */
+  ejs.IndicesQuery = function (qry, indices) {
+
+    if (!isQuery(qry)) {
+      throw new TypeError('Argument must be a Query');
+    }
+    
+    var 
+      _common = ejs.QueryMixin('indices'),
+      query = _common.toJSON();
+    
+    query.indices.query = qry.toJSON();
+
+    if (isString(indices)) {
+      query.indices.indices = [indices];
+    } else if (isArray(indices)) {
+      query.indices.indices = indices;
+    } else {
+      throw new TypeError('Argument must be a string or array');
+    }
+  
+    return extend(_common, {
+
+      /**
+            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.
+
+            @member ejs.IndicesQuery
+            @param {(String|String[])} i A single index name or an array of index names.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      indices: function (i) {
+        if (i == null) {
+          return query.indices.indices;
+        }
+  
+        if (isString(i)) {
+          query.indices.indices.push(i);
+        } else if (isArray(i)) {
+          query.indices.indices = i;
+        } else {
+          throw new TypeError('Argument must be a string or array');
+        }
+
+        return this;
+      },
+    
+      /**
+            Sets the query to be executed against the indices specified.
+
+            @member ejs.IndicesQuery
+            @param {Query} q A valid Query object
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      query: function (q) {
+        if (q == null) {
+          return query.indices.query;
+        }
+  
+        if (!isQuery(q)) {
+          throw new TypeError('Argument must be a Query');
+        }
+        
+        query.indices.query = q.toJSON();
+        return this;
+      },
+
+      /**
+            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.
+
+            @member ejs.IndicesQuery
+            @param {(Query|String)} q A valid Query object or "none" or "all"
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      noMatchQuery: function (q) {
+        if (q == null) {
+          return query.indices.no_match_query;
+        }
+  
+        if (isString(q)) {
+          q = q.toLowerCase();
+          if (q === 'none' || q === 'all') {
+            query.indices.no_match_query = q;
+          }
+        } else if (isQuery(q)) {
+          query.indices.no_match_query = q.toJSON();
+        } else {
+          throw new TypeError('Argument must be string or Query');
+        }
+      
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>This query can be used to match all the documents
+    in a given set of collections and/or types.</p>
+
+    @name ejs.MatchAllQuery
+    @ejs query
+    @borrows ejs.QueryMixin.boost as boost
+    @borrows ejs.QueryMixin._type as _type
+    @borrows ejs.QueryMixin.toJSON as toJSON
+
+    @desc
+    <p>A query that returns all documents.</p>
+
+     */
+  ejs.MatchAllQuery = function () {
+    return ejs.QueryMixin('match_all');
+  };
+
+  /**
+    @class
+    A <code>MatchQuery</code> is a type of <code>Query</code> that accepts 
+    text/numerics/dates, analyzes it, generates a query based on the
+    <code>MatchQuery</code> type.
+  
+    @name ejs.MatchQuery
+    @ejs query
+    @borrows ejs.QueryMixin._type as _type
+    @borrows ejs.QueryMixin.toJSON as toJSON
+
+    @desc
+    A Query that appects text, analyzes it, generates internal query based
+    on the MatchQuery type.
+
+    @param {String} field the document field/field to query against
+    @param {String} qstr the query string
+    */
+  ejs.MatchQuery = function (field, qstr) {
+
+    var
+      _common = ejs.QueryMixin('match'),
+      query = _common.toJSON();
+    
+    query.match[field] = {
+      query: qstr
+    };
+
+    return extend(_common, {
+
+      /**
+            Sets the query string for the <code>Query</code>.
+
+            @member ejs.MatchQuery
+            @param {String} qstr The query string to search for.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      query: function (qstr) {
+        if (qstr == null) {
+          return query.match[field].query;
+        }
+
+        query.match[field].query = qstr;
+        return this;
+      },
+
+      /**
+            Sets the type of the <code>MatchQuery</code>.  Valid values are
+            boolean, phrase, and phrase_prefix.
+
+            @member ejs.MatchQuery
+            @param {String} type Any of boolean, phrase, phrase_prefix.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      type: function (type) {
+        if (type == null) {
+          return query.match[field].type;
+        }
+
+        type = type.toLowerCase();
+        if (type === 'boolean' || type === 'phrase' || type === 'phrase_prefix') {
+          query.match[field].type = type;
+        }
+
+        return this;
+      },
+
+      /**
+            Sets the fuzziness value for the <code>Query</code>.
+
+            @member ejs.MatchQuery
+            @param {Double} fuzz A <code>double</code> value between 0.0 and 1.0.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      fuzziness: function (fuzz) {
+        if (fuzz == null) {
+          return query.match[field].fuzziness;
+        }
+
+        query.match[field].fuzziness = fuzz;
+        return this;
+      },
+
+      /**
+            Sets the maximum threshold/frequency to be considered a low 
+            frequency term in a <code>CommonTermsQuery</code>.  
+            Set to a value between 0 and 1.
+
+            @member ejs.MatchQuery
+            @param {Number} freq A positive <code>double</code> value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      cutoffFrequency: function (freq) {
+        if (freq == null) {
+          return query.match[field].cutoff_frequency;
+        }
+
+        query.match[field].cutoff_frequency = freq;
+        return this;
+      },
+      
+      /**
+            Sets the prefix length for a fuzzy prefix <code>MatchQuery</code>.
+
+            @member ejs.MatchQuery
+            @param {Integer} l A positive <code>integer</code> length value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      prefixLength: function (l) {
+        if (l == null) {
+          return query.match[field].prefix_length;
+        }
+
+        query.match[field].prefix_length = l;
+        return this;
+      },
+
+      /**
+            Sets the max expansions of a fuzzy <code>MatchQuery</code>.
+
+            @member ejs.MatchQuery
+            @param {Integer} e A positive <code>integer</code> value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      maxExpansions: function (e) {
+        if (e == null) {
+          return query.match[field].max_expansions;
+        }
+
+        query.match[field].max_expansions = e;
+        return this;
+      },
+
+      /**
+            Sets default operator of the <code>Query</code>.  Default: or.
+
+            @member ejs.MatchQuery
+            @param {String} op Any of "and" or "or", no quote characters.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      operator: function (op) {
+        if (op == null) {
+          return query.match[field].operator;
+        }
+
+        op = op.toLowerCase();
+        if (op === 'and' || op === 'or') {
+          query.match[field].operator = op;
+        }
+
+        return this;
+      },
+
+      /**
+            Sets the default slop for phrases. If zero, then exact phrase matches
+            are required.  Default: 0.
+
+            @member ejs.MatchQuery
+            @param {Integer} slop A positive <code>integer</code> value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      slop: function (slop) {
+        if (slop == null) {
+          return query.match[field].slop;
+        }
+
+        query.match[field].slop = slop;
+        return this;
+      },
+
+      /**
+            Sets the analyzer name used to analyze the <code>Query</code> object.
+
+            @member ejs.MatchQuery
+            @param {String} analyzer A valid analyzer name.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      analyzer: function (analyzer) {
+        if (analyzer == null) {
+          return query.match[field].analyzer;
+        }
+
+        query.match[field].analyzer = analyzer;
+        return this;
+      },
+
+      /**
+            Sets a percent value controlling how many "should" clauses in the
+            resulting <code>Query</code> should match.
+
+            @member ejs.MatchQuery
+            @param {Integer} minMatch An <code>integer</code> between 0 and 100.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      minimumShouldMatch: function (minMatch) {
+        if (minMatch == null) {
+          return query.match[field].minimum_should_match;
+        }
+
+        query.match[field].minimum_should_match = minMatch;
+        return this;
+      },
+      
+      /**
+            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.
+
+            @member ejs.MatchQuery
+            @param {String} m The rewrite method as a string.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      rewrite: function (m) {
+        if (m == null) {
+          return query.match[field].rewrite;
+        }
+        
+        m = m.toLowerCase();
+        if (m === 'constant_score_auto' || m === 'scoring_boolean' ||
+          m === 'constant_score_boolean' || m === 'constant_score_filter' ||
+          m.indexOf('top_terms_boost_') === 0 || 
+          m.indexOf('top_terms_') === 0) {
+            
+          query.match[field].rewrite = m;
+        }
+        
+        return this;
+      },
+      
+      /**
+            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.
+            
+            @member ejs.MatchQuery
+            @param {String} m The rewrite method as a string.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      fuzzyRewrite: function (m) {
+        if (m == null) {
+          return query.match[field].fuzzy_rewrite;
+        }
+
+        m = m.toLowerCase();
+        if (m === 'constant_score_auto' || m === 'scoring_boolean' ||
+          m === 'constant_score_boolean' || m === 'constant_score_filter' ||
+          m.indexOf('top_terms_boost_') === 0 || 
+          m.indexOf('top_terms_') === 0) {
+            
+          query.match[field].fuzzy_rewrite = m;
+        }
+        
+        return this;
+      },
+      
+      /**
+            Set to false to use classic Levenshtein edit distance in the 
+            fuzzy query.
+
+            @member ejs.MatchQuery
+            @param {Boolean} trueFalse A boolean value
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      fuzzyTranspositions: function (trueFalse) {
+        if (trueFalse == null) {
+          return query.match[field].fuzzy_transpositions;
+        }
+
+        query.match[field].fuzzy_transpositions = trueFalse;
+        return this;
+      },
+
+      /**
+            Enables lenient parsing of the query string.
+
+            @member ejs.MatchQuery
+            @param {Boolean} trueFalse A boolean value
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      lenient: function (trueFalse) {
+        if (trueFalse == null) {
+          return query.match[field].lenient;
+        }
+
+        query.match[field].lenient = trueFalse;
+        return this;
+      },
+    
+      /**
+            Sets what happens when no terms match.  Valid values are
+            "all" or "none".  
+
+            @member ejs.MatchQuery
+            @param {String} q A no match action, "all" or "none".
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      zeroTermsQuery: function (q) {
+        if (q == null) {
+          return query.match[field].zero_terms_query;
+        }
+
+        q = q.toLowerCase();
+        if (q === 'all' || q === 'none') {
+          query.match[field].zero_terms_query = q;
+        }
+        
+        return this;
+      },
+      
+      /**
+            Sets the boost value for documents matching the <code>Query</code>.
+
+            @member ejs.MatchQuery
+            @param {Number} boost A positive <code>double</code> value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      boost: function (boost) {
+        if (boost == null) {
+          return query.match[field].boost;
+        }
+
+        query.match[field].boost = boost;
+        return this;
+      },
+
+    });
+  };
+
+  /**
+    @class
+    <p>The more_like_this_field query is the same as the more_like_this query, 
+    except it runs against a single field.</p>
+
+    @name ejs.MoreLikeThisFieldQuery
+    @ejs query
+    @borrows ejs.QueryMixin._type as _type
+    @borrows ejs.QueryMixin.toJSON as toJSON
+
+    @desc
+    <p>Constructs a query where each documents returned are “like” provided text</p>
+
+    @param {String} field The field to run the query against.
+    @param {String} likeText The text to find documents like it.
+
+     */
+  ejs.MoreLikeThisFieldQuery = function (field, likeText) {
+
+    var
+      _common = ejs.QueryMixin('mlt_field'),
+      query = _common.toJSON();
+
+    query.mlt_field[field] = {
+      like_text: likeText
+    };
+  
+    return extend(_common, {
+
+      /**
+             The field to run the query against.
+
+             @member ejs.MoreLikeThisFieldQuery
+             @param {String} f A single field name.
+             @returns {Object} returns <code>this</code> so that calls can be chained.
+             */
+      field: function (f) {
+        var oldValue = query.mlt_field[field];
+    
+        if (f == null) {
+          return field;
+        }
+  
+        delete query.mlt_field[field];
+        field = f;
+        query.mlt_field[f] = oldValue;
+  
+        return this;
+      },
+
+      /**
+            The text to find documents like
+
+            @member ejs.MoreLikeThisFieldQuery
+            @param {String} s A text string.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      likeText: function (txt) {
+        if (txt == null) {
+          return query.mlt_field[field].like_text;
+        }
+
+        query.mlt_field[field].like_text = txt;
+        return this;
+      },
+
+      /**
+            The percentage of terms to match on (float value). 
+            Defaults to 0.3 (30 percent).
+
+            @member ejs.MoreLikeThisFieldQuery
+            @param {Double} percent A double value between 0 and 1.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      percentTermsToMatch: function (percent) {
+        if (percent == null) {
+          return query.mlt_field[field].percent_terms_to_match;
+        }
+
+        query.mlt_field[field].percent_terms_to_match = percent;
+        return this;
+      },
+
+      /**
+            The frequency below which terms will be ignored in the source doc. 
+            The default frequency is 2.
+
+            @member ejs.MoreLikeThisFieldQuery
+            @param {Integer} freq A positive integer value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      minTermFreq: function (freq) {
+        if (freq == null) {
+          return query.mlt_field[field].min_term_freq;
+        }
+
+        query.mlt_field[field].min_term_freq = freq;
+        return this;
+      },
+      
+      /**
+            The maximum number of query terms that will be included in any 
+            generated query. Defaults to 25.
+
+            @member ejs.MoreLikeThisFieldQuery
+            @param {Integer} max A positive integer value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      maxQueryTerms: function (max) {
+        if (max == null) {
+          return query.mlt_field[field].max_query_terms;
+        }
+
+        query.mlt_field[field].max_query_terms = max;
+        return this;
+      },
+
+      /**
+            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”.
+        
+            @member ejs.MoreLikeThisFieldQuery
+            @param {Array} stopWords An array of string stopwords
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      stopWords: function (stopWords) {
+        if (stopWords == null) {
+          return query.mlt_field[field].stop_words;
+        }
+
+        query.mlt_field[field].stop_words = stopWords;
+        return this;
+      },
+
+      /**
+            The frequency at which words will be ignored which do not occur in 
+            at least this many docs. Defaults to 5.
+
+            @member ejs.MoreLikeThisFieldQuery
+            @param {Integer} min A positive integer value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      minDocFreq: function (min) {
+        if (min == null) {
+          return query.mlt_field[field].min_doc_freq;
+        }
+
+        query.mlt_field[field].min_doc_freq = min;
+        return this;
+      },
+
+      /**
+            The maximum frequency in which words may still appear. Words that 
+            appear in more than this many docs will be ignored. 
+            Defaults to unbounded.
+
+            @member ejs.MoreLikeThisFieldQuery
+            @param {Integer} max A positive integer value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      maxDocFreq: function (max) {
+        if (max == null) {
+          return query.mlt_field[field].max_doc_freq;
+        }
+
+        query.mlt_field[field].max_doc_freq = max;
+        return this;
+      },
+
+      /**
+            The minimum word length below which words will be ignored. 
+            Defaults to 0.
+        
+            @member ejs.MoreLikeThisFieldQuery
+            @param {Integer} len A positive integer value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      minWordLen: function (len) {
+        if (len == null) {
+          return query.mlt_field[field].min_word_len;
+        }
+
+        query.mlt_field[field].min_word_len = len;
+        return this;
+      },
+
+      /**
+            The maximum word length above which words will be ignored. 
+            Defaults to unbounded (0).
+        
+            @member ejs.MoreLikeThisFieldQuery
+            @param {Integer} len A positive integer value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      maxWordLen: function (len) {
+        if (len == null) {
+          return query.mlt_field[field].max_word_len;
+        }
+
+        query.mlt_field[field].max_word_len = len;
+        return this;
+      },
+          
+      /**
+            The analyzer that will be used to analyze the text. Defaults to the 
+            analyzer associated with the field.
+
+            @member ejs.MoreLikeThisFieldQuery
+            @param {String} analyzerName The name of the analyzer.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      analyzer: function (analyzerName) {
+        if (analyzerName == null) {
+          return query.mlt_field[field].analyzer;
+        }
+
+        query.mlt_field[field].analyzer = analyzerName;
+        return this;
+      },
+  
+      /**
+            Sets the boost factor to use when boosting terms. 
+            Defaults to 1.
+
+            @member ejs.MoreLikeThisFieldQuery
+            @param {Double} boost A positive <code>double</code> value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      boostTerms: function (boost) {
+        if (boost == null) {
+          return query.mlt_field[field].boost_terms;
+        }
+
+        query.mlt_field[field].boost_terms = boost;
+        return this;
+      },
+      
+      /**
+            Should the <code>Query</code> fail when an unsupported field
+            is specified. Defaults to true.
+
+            @member ejs.MoreLikeThisFieldQuery
+            @param {Boolean} trueFalse A boolean value
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      failOnUnsupportedField: function (trueFalse) {
+        if (trueFalse == null) {
+          return query.mlt_field[field].fail_on_unsupported_field;
+        }
+  
+        query.mlt_field[field].fail_on_unsupported_field = trueFalse;
+        return this;
+      },
+                    
+      /**
+            Sets the boost value of the <code>Query</code>.
+
+            @member ejs.MoreLikeThisFieldQuery
+            @param {Double} boost A positive <code>double</code> value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      boost: function (boost) {
+        if (boost == null) {
+          return query.mlt_field[field].boost;
+        }
+
+        query.mlt_field[field].boost = boost;
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>More like this query find documents that are “like” provided text by 
+    running it against one or more fields.</p>
+
+    @name ejs.MoreLikeThisQuery
+    @ejs query
+    @borrows ejs.QueryMixin.boost as boost
+    @borrows ejs.QueryMixin._type as _type
+    @borrows ejs.QueryMixin.toJSON as toJSON
+
+    @desc
+    <p>Constructs a query where each documents returned are “like” provided text</p>
+
+    @param {(String|String[])} fields A single field or array of fields to run against.
+    @param {String} likeText The text to find documents like it.
+  
+     */
+  ejs.MoreLikeThisQuery = function (likeText) {
+
+    var 
+      _common = ejs.QueryMixin('mlt'),
+      query = _common.toJSON();
+    
+    query.mlt.like_text = likeText;
+
+    return extend(_common, {
+  
+      /**
+             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.
+
+             @member ejs.MoreLikeThisQuery
+             @param {(String|String[])} f A single field name or a list of field names.
+             @returns {Object} returns <code>this</code> so that calls can be chained.
+             */
+      fields: function (f) {
+        if (f == null) {
+          return this;
+        }
+    
+        if (isString(f)) {
+          query.mlt.fields = [f];
+        } else if (isArray(f)) {
+          query.mlt.fields = f;
+        } else {
+          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
+
+            @member ejs.MoreLikeThisQuery
+            @param {String} s A text string.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      likeText: function (txt) {
+        if (txt == null) {
+          return query.mlt.like_text;
+        }
+  
+        query.mlt.like_text = txt;
+        return this;
+      },
+
+      /**
+            The percentage of terms to match on (float value). 
+            Defaults to 0.3 (30 percent).
+
+            @member ejs.MoreLikeThisQuery
+            @param {Double} percent A double value between 0 and 1.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      percentTermsToMatch: function (percent) {
+        if (percent == null) {
+          return query.mlt.percent_terms_to_match;
+        }
+  
+        query.mlt.percent_terms_to_match = percent;
+        return this;
+      },
+
+      /**
+            The frequency below which terms will be ignored in the source doc. 
+            The default frequency is 2.
+
+            @member ejs.MoreLikeThisQuery
+            @param {Integer} freq A positive integer value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      minTermFreq: function (freq) {
+        if (freq == null) {
+          return query.mlt.min_term_freq;
+        }
+  
+        query.mlt.min_term_freq = freq;
+        return this;
+      },
+        
+      /**
+            The maximum number of query terms that will be included in any 
+            generated query. Defaults to 25.
+
+            @member ejs.MoreLikeThisQuery
+            @param {Integer} max A positive integer value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      maxQueryTerms: function (max) {
+        if (max == null) {
+          return query.mlt.max_query_terms;
+        }
+  
+        query.mlt.max_query_terms = max;
+        return this;
+      },
+
+      /**
+            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”.
+          
+            @member ejs.MoreLikeThisQuery
+            @param {Array} stopWords An array of string stopwords
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      stopWords: function (stopWords) {
+        if (stopWords == null) {
+          return query.mlt.stop_words;
+        }
+  
+        query.mlt.stop_words = stopWords;
+        return this;
+      },
+
+      /**
+            The frequency at which words will be ignored which do not occur in 
+            at least this many docs. Defaults to 5.
+
+            @member ejs.MoreLikeThisQuery
+            @param {Integer} min A positive integer value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      minDocFreq: function (min) {
+        if (min == null) {
+          return query.mlt.min_doc_freq;
+        }
+  
+        query.mlt.min_doc_freq = min;
+        return this;
+      },
+
+      /**
+            The maximum frequency in which words may still appear. Words that 
+            appear in more than this many docs will be ignored. 
+            Defaults to unbounded.
+
+            @member ejs.MoreLikeThisQuery
+            @param {Integer} max A positive integer value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      maxDocFreq: function (max) {
+        if (max == null) {
+          return query.mlt.max_doc_freq;
+        }
+  
+        query.mlt.max_doc_freq = max;
+        return this;
+      },
+
+      /**
+            The minimum word length below which words will be ignored. 
+            Defaults to 0.
+          
+            @member ejs.MoreLikeThisQuery
+            @param {Integer} len A positive integer value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      minWordLen: function (len) {
+        if (len == null) {
+          return query.mlt.min_word_len;
+        }
+  
+        query.mlt.min_word_len = len;
+        return this;
+      },
+
+      /**
+            The maximum word length above which words will be ignored. 
+            Defaults to unbounded (0).
+          
+            @member ejs.MoreLikeThisQuery
+            @param {Integer} len A positive integer value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      maxWordLen: function (len) {
+        if (len == null) {
+          return query.mlt.max_word_len;
+        }
+  
+        query.mlt.max_word_len = len;
+        return this;
+      },
+            
+      /**
+            The analyzer that will be used to analyze the text. Defaults to the 
+            analyzer associated with the field.
+
+            @member ejs.MoreLikeThisQuery
+            @param {String} analyzerName The name of the analyzer.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      analyzer: function (analyzerName) {
+        if (analyzerName == null) {
+          return query.mlt.analyzer;
+        }
+  
+        query.mlt.analyzer = analyzerName;
+        return this;
+      },
+    
+      /**
+            Sets the boost factor to use when boosting terms. 
+            Defaults to 1.
+
+            @member ejs.MoreLikeThisQuery
+            @param {Double} boost A positive <code>double</code> value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      boostTerms: function (boost) {
+        if (boost == null) {
+          return query.mlt.boost_terms;
+        }
+
+        query.mlt.boost_terms = boost;
+        return this;
+      },
+         
+      /**
+            Should the <code>Query</code> fail when an unsupported field
+            is specified. Defaults to true.
+
+            @member ejs.MoreLikeThisQuery
+            @param {Boolean} trueFalse A boolean value
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      failOnUnsupportedField: function (trueFalse) {
+        if (trueFalse == null) {
+          return query.mlt.fail_on_unsupported_field;
+        }
+  
+        query.mlt.fail_on_unsupported_field = trueFalse;
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    A <code>MultiMatchQuery</code> query builds further on top of the 
+    <code>MatchQuery</code> 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.
+  
+    @name ejs.MultiMatchQuery
+    @ejs query
+    @borrows ejs.QueryMixin.boost as boost
+    @borrows ejs.QueryMixin._type as _type
+    @borrows ejs.QueryMixin.toJSON as toJSON
+
+    @desc
+    A Query that allow to more easily build a MatchQuery 
+    over multiple fields
+
+    @param {(String|String[])} fields the single field or array of fields to search across
+    @param {String} qstr the query string
+    */
+  ejs.MultiMatchQuery = function (fields, qstr) {
+
+    var 
+      _common = ejs.QueryMixin('multi_match'),
+      query = _common.toJSON();
+    
+    query.multi_match.query = qstr;
+    query.multi_match.fields = [];
+
+    if (isString(fields)) {
+      query.multi_match.fields.push(fields);
+    } else if (isArray(fields)) {
+      query.multi_match.fields = fields;
+    } else {
+      throw new TypeError('Argument must be string or array');
+    }
+    
+    return extend(_common, {
+
+      /**
+            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.
+
+            @member ejs.MultiMatchQuery
+            @param {(String|String[])} f A single field or list of fields names to 
+              search across.
+            @returns {Object} returns <code>this</code> so that calls can be 
+              chained. Returns {Array} current value if `f` not specified.
+            */
+      fields: function (f) {
+        if (f == null) {
+          return query.multi_match.fields;
+        }
+
+        if (isString(f)) {
+          query.multi_match.fields.push(f);
+        } else if (isArray(f)) {
+          query.multi_match.fields = f;
+        } else {
+          throw new TypeError('Argument must be string or array');
+        }
+        
+        return this;
+      },
+
+      /**
+            Sets whether or not queries against multiple fields should be combined using Lucene's
+            <a href="http://lucene.apache.org/java/3_0_0/api/core/org/apache/lucene/search/DisjunctionMaxQuery.html">
+            DisjunctionMaxQuery</a>
+
+            @member ejs.MultiMatchQuery
+            @param {String} trueFalse A <code>true/false</code> value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      useDisMax: function (trueFalse) {
+        if (trueFalse == null) {
+          return query.multi_match.use_dis_max;
+        }
+      
+        query.multi_match.use_dis_max = trueFalse;
+        return this;
+      },
+
+      /**
+            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.
+
+            @member ejs.MultiMatchQuery
+            @param {Double} tieBreaker A positive <code>double</code> value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      tieBreaker: function (tieBreaker) {
+        if (tieBreaker == null) {
+          return query.multi_match.tie_breaker;
+        }
+
+        query.multi_match.tie_breaker = tieBreaker;
+        return this;
+      },
+
+      /**
+            Sets the maximum threshold/frequency to be considered a low 
+            frequency term in a <code>CommonTermsQuery</code>.  
+            Set to a value between 0 and 1.
+
+            @member ejs.MultiMatchQuery
+            @param {Number} freq A positive <code>double</code> value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      cutoffFrequency: function (freq) {
+        if (freq == null) {
+          return query.multi_match.cutoff_frequency;
+        }
+
+        query.multi_match.cutoff_frequency = freq;
+        return this;
+      },
+      
+      /**
+            Sets a percent value controlling how many "should" clauses in the
+            resulting <code>Query</code> should match.
+
+            @member ejs.MultiMatchQuery
+            @param {Integer} minMatch An <code>integer</code> between 0 and 100.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      minimumShouldMatch: function (minMatch) {
+        if (minMatch == null) {
+          return query.multi_match.minimum_should_match;
+        }
+
+        query.multi_match.minimum_should_match = minMatch;
+        return this;
+      },
+      
+      /**
+            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.
+
+            @member ejs.MultiMatchQuery
+            @param {String} m The rewrite method as a string.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      rewrite: function (m) {
+        if (m == null) {
+          return query.multi_match.rewrite;
+        }
+        
+        m = m.toLowerCase();
+        if (m === 'constant_score_auto' || m === 'scoring_boolean' ||
+          m === 'constant_score_boolean' || m === 'constant_score_filter' ||
+          m.indexOf('top_terms_boost_') === 0 || 
+          m.indexOf('top_terms_') === 0) {
+            
+          query.multi_match.rewrite = m;
+        }
+        
+        return this;
+      },
+      
+      /**
+            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.
+            
+            @member ejs.MultiMatchQuery
+            @param {String} m The rewrite method as a string.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      fuzzyRewrite: function (m) {
+        if (m == null) {
+          return query.multi_match.fuzzy_rewrite;
+        }
+
+        m = m.toLowerCase();
+        if (m === 'constant_score_auto' || m === 'scoring_boolean' ||
+          m === 'constant_score_boolean' || m === 'constant_score_filter' ||
+          m.indexOf('top_terms_boost_') === 0 || 
+          m.indexOf('top_terms_') === 0) {
+            
+          query.multi_match.fuzzy_rewrite = m;
+        }
+        
+        return this;
+      },
+
+      /**
+            Enables lenient parsing of the query string.
+
+            @member ejs.MultiMatchQuery
+            @param {Boolean} trueFalse A boolean value
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      lenient: function (trueFalse) {
+        if (trueFalse == null) {
+          return query.multi_match.lenient;
+        }
+
+        query.multi_match.lenient = trueFalse;
+        return this;
+      },
+
+      /**
+            Sets the query string for the <code>Query</code>.
+
+            @member ejs.MultiMatchQuery
+            @param {String} qstr The query string to search for.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      query: function (qstr) {
+        if (qstr == null) {
+          return query.multi_match.query;
+        }
+
+        query.multi_match.query = qstr;
+        return this;
+      },
+
+      /**
+            Sets the type of the <code>MultiMatchQuery</code>.  Valid values are
+            boolean, phrase, and phrase_prefix or phrasePrefix.
+
+            @member ejs.MultiMatchQuery
+            @param {String} type Any of boolean, phrase, phrase_prefix or phrasePrefix.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      type: function (type) {
+        if (type == null) {
+          return query.multi_match.type;
+        }
+
+        type = type.toLowerCase();
+        if (type === 'best_fields' || type === 'most_fields' || type === 'cross_fields' || type === 'phrase' || type === 'phrase_prefix') {
+          query.multi_match.type = type;
+        }
+
+        return this;
+      },
+
+      /**
+            Sets the fuzziness value for the <code>Query</code>.
+
+            @member ejs.MultiMatchQuery
+            @param {Double} fuzz A <code>double</code> value between 0.0 and 1.0.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      fuzziness: function (fuzz) {
+        if (fuzz == null) {
+          return query.multi_match.fuzziness;
+        }
+
+        query.multi_match.fuzziness = fuzz;
+        return this;
+      },
+
+      /**
+            Sets the prefix length for a fuzzy prefix <code>Query</code>.
+
+            @member ejs.MultiMatchQuery
+            @param {Integer} l A positive <code>integer</code> length value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      prefixLength: function (l) {
+        if (l == null) {
+          return query.multi_match.prefix_length;
+        }
+
+        query.multi_match.prefix_length = l;
+        return this;
+      },
+
+      /**
+            Sets the max expansions of a fuzzy <code>Query</code>.
+
+            @member ejs.MultiMatchQuery
+            @param {Integer} e A positive <code>integer</code> value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      maxExpansions: function (e) {
+        if (e == null) {
+          return query.multi_match.max_expansions;
+        }
+
+        query.multi_match.max_expansions = e;
+        return this;
+      },
+
+      /**
+            Sets default operator of the <code>Query</code>.  Default: or.
+
+            @member ejs.MultiMatchQuery
+            @param {String} op Any of "and" or "or", no quote characters.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      operator: function (op) {
+        if (op == null) {
+          return query.multi_match.operator;
+        }
+
+        op = op.toLowerCase();
+        if (op === 'and' || op === 'or') {
+          query.multi_match.operator = op;
+        }
+
+        return this;
+      },
+
+      /**
+            Sets the default slop for phrases. If zero, then exact phrase matches
+            are required.  Default: 0.
+
+            @member ejs.MultiMatchQuery
+            @param {Integer} slop A positive <code>integer</code> value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      slop: function (slop) {
+        if (slop == null) {
+          return query.multi_match.slop;
+        }
+
+        query.multi_match.slop = slop;
+        return this;
+      },
+
+      /**
+            Sets the analyzer name used to analyze the <code>Query</code> object.
+
+            @member ejs.MultiMatchQuery
+            @param {String} analyzer A valid analyzer name.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      analyzer: function (analyzer) {
+        if (analyzer == null) {
+          return query.multi_match.analyzer;
+        }
+
+        query.multi_match.analyzer = analyzer;
+        return this;
+      },
+
+      /**
+            Sets what happens when no terms match.  Valid values are
+            "all" or "none".  
+
+            @member ejs.MultiMatchQuery
+            @param {String} q A no match action, "all" or "none".
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      zeroTermsQuery: function (q) {
+        if (q == null) {
+          return query.multi_match.zero_terms_query;
+        }
+
+        q = q.toLowerCase();
+        if (q === 'all' || q === 'none') {
+          query.multi_match.zero_terms_query = q;
+        }
+        
+        return this;
+      }
+
+    });
+  };
+
+  /**
+    @class
+    <p>Nested queries allow you to search against content within objects that are
+       embedded inside of other objects. It is similar to <code>XPath</code> expressions
+       in <code>XML</code> both conceptually and syntactically.</p>
+
+    <p>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).</p>
+    
+    @name ejs.NestedQuery
+    @ejs query
+    @borrows ejs.QueryMixin.boost as boost
+    @borrows ejs.QueryMixin._type as _type
+    @borrows ejs.QueryMixin.toJSON as toJSON
+
+    @desc
+    <p>Constructs a query that is capable of executing a search against objects
+       nested within a document.</p>
+
+    @param {String} path The nested object path.
+
+     */
+  ejs.NestedQuery = function (path) {
+
+    var 
+      _common = ejs.QueryMixin('nested'),
+      query = _common.toJSON();
+    
+    query.nested.path = path;
+
+    return extend(_common, {
+      
+      /**
+             Sets the root context for the nested query.
+             
+             @member ejs.NestedQuery
+             @param {String} path The path defining the root context for the nested query.
+             @returns {Object} returns <code>this</code> so that calls can be chained.
+             */
+      path: function (path) {
+        if (path == null) {
+          return query.nested.path;
+        }
+      
+        query.nested.path = path;
+        return this;
+      },
+
+      /**
+             Sets the nested query to be executed.
+             
+             @member ejs.NestedQuery
+             @param {Object} oQuery A valid Query object
+             @returns {Object} returns <code>this</code> so that calls can be chained.
+             */
+      query: function (oQuery) {
+        if (oQuery == null) {
+          return query.nested.query;
+        }
+    
+        if (!isQuery(oQuery)) {
+          throw new TypeError('Argument must be a Query');
+        }
+        
+        query.nested.query = oQuery.toJSON();
+        return this;
+      },
+
+
+      /**
+             Sets the nested filter to be executed.
+             
+             @member ejs.NestedQuery
+             @param {Object} oFilter A valid Filter object
+             @returns {Object} returns <code>this</code> so that calls can be chained.
+             */
+      filter: function (oFilter) {
+        if (oFilter == null) {
+          return query.nested.filter;
+        }
+    
+        if (!isFilter(oFilter)) {
+          throw new TypeError('Argument must be a Filter');
+        }
+        
+        query.nested.filter = oFilter.toJSON();
+        return this;
+      },
+
+      /**
+             Sets how the inner (nested) matches affect scoring on the parent document.
+             
+             @member ejs.NestedQuery
+             @param {String} mode The mode of scoring to be used for nested matches.
+                             Options are avg, total, max, none - defaults to avg
+             @returns {Object} returns <code>this</code> so that calls can be chained.
+             */
+      scoreMode: function (mode) {
+        if (mode == null) {
+          return query.nested.score_mode;
+        }
+      
+        mode = mode.toLowerCase();
+        if (mode === 'avg' || mode === 'total' || mode === 'max' || 
+          mode === 'none' || mode === 'sum') {
+            
+          query.nested.score_mode = mode;
+        }
+        
+        return this;
+      },
+
+      /**
+            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
+            @member ejs.NestedQuery
+            @param {String} s The scope name as a string.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      scope: function (s) {
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>Matches documents that have fields containing terms with a specified 
+    prefix (not analyzed). The prefix query maps to Lucene PrefixQuery.</p>
+
+    @name ejs.PrefixQuery
+    @ejs query
+    @borrows ejs.QueryMixin._type as _type
+    @borrows ejs.QueryMixin.toJSON as toJSON
+
+    @desc
+    Matches documents containing the specified un-analyzed prefix.
+
+    @param {String} field A valid field name.
+    @param {String} value A string prefix.
+    */
+  ejs.PrefixQuery = function (field, value) {
+
+    var
+      _common = ejs.QueryMixin('prefix'),
+      query = _common.toJSON();
+
+    query.prefix[field] = {
+      value: value
+    };
+  
+    return extend(_common, {
+
+      /**
+             The field to run the query against.
+
+             @member ejs.PrefixQuery
+             @param {String} f A single field name.
+             @returns {Object} returns <code>this</code> so that calls can be chained.
+             */
+      field: function (f) {
+        var oldValue = query.prefix[field];
+  
+        if (f == null) {
+          return field;
+        }
+
+        delete query.prefix[field];
+        field = f;
+        query.prefix[f] = oldValue;
+
+        return this;
+      },
+
+      /**
+            The prefix value.
+
+            @member ejs.PrefixQuery
+            @param {String} p A string prefix
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      value: function (p) {
+        if (p == null) {
+          return query.prefix[field].value;
+        }
+
+        query.prefix[field].value = p;
+        return this;
+      },
+
+      /**
+            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.
+
+            @member ejs.PrefixQuery
+            @param {String} m The rewrite method as a string.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      rewrite: function (m) {
+        if (m == null) {
+          return query.prefix[field].rewrite;
+        }
+        
+        m = m.toLowerCase();
+        if (m === 'constant_score_auto' || m === 'scoring_boolean' ||
+          m === 'constant_score_boolean' || m === 'constant_score_filter' ||
+          m.indexOf('top_terms_boost_') === 0 || 
+          m.indexOf('top_terms_') === 0) {
+            
+          query.prefix[field].rewrite = m;
+        }
+        
+        return this;
+      },
+      
+      /**
+            Sets the boost value of the <code>Query</code>.
+
+            @member ejs.PrefixQuery
+            @param {Double} boost A positive <code>double</code> value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      boost: function (boost) {
+        if (boost == null) {
+          return query.prefix[field].boost;
+        }
+
+        query.prefix[field].boost = boost;
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>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.</p>
+
+    </p>See the Lucene <a href="http://lucene.apache.org/java/2_9_1/queryparsersyntax.html">Query Parser Syntax</a>
+    for more information.</p>
+
+    @name ejs.QueryStringQuery
+    @ejs query
+    @borrows ejs.QueryMixin.boost as boost
+    @borrows ejs.QueryMixin._type as _type
+    @borrows ejs.QueryMixin.toJSON as toJSON
+
+    @desc
+    A query that is parsed using Lucene's default query parser.
+
+    @param {String} qstr A valid Lucene query string.
+    */
+  ejs.QueryStringQuery = function (qstr) {
+
+    var
+      _common = ejs.QueryMixin('query_string'),
+      query = _common.toJSON();
+
+    query.query_string.query = qstr;
+
+    return extend(_common, {
+
+      /**
+            Sets the query string on this <code>Query</code> object.
+
+            @member ejs.QueryStringQuery
+            @param {String} qstr A valid Lucene query string.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      query: function (qstr) {
+        if (qstr == null) {
+          return query.query_string.query;
+        }
+
+        query.query_string.query = qstr;
+        return this;
+      },
+
+      /**
+            Sets the default field/property this query should execute against.
+
+            @member ejs.QueryStringQuery
+            @param {String} fieldName The name of document field/property.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      defaultField: function (fieldName) {
+        if (fieldName == null) {
+          return query.query_string.default_field;
+        }
+      
+        query.query_string.default_field = fieldName;
+        return this;
+      },
+
+      /**
+            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.
+
+            @member ejs.QueryStringQuery
+            @param {Array} fieldNames A list of document fields/properties.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      fields: function (fieldNames) {
+        if (query.query_string.fields == null) {
+          query.query_string.fields = [];
+        }
+        
+        if (fieldNames == null) {
+          return query.query_string.fields;
+        }
+      
+        if (isString(fieldNames)) {
+          query.query_string.fields.push(fieldNames);
+        } else if (isArray(fieldNames)) {
+          query.query_string.fields = fieldNames;
+        } else {
+          throw new TypeError('Argument must be a string or array');
+        }
+        
+        return this;
+      },
+
+      /**
+            Sets whether or not queries against multiple fields should be combined using Lucene's
+            <a href="http://lucene.apache.org/java/3_0_0/api/core/org/apache/lucene/search/DisjunctionMaxQuery.html">
+            DisjunctionMaxQuery</a>
+
+            @member ejs.QueryStringQuery
+            @param {String} trueFalse A <code>true/false</code> value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      useDisMax: function (trueFalse) {
+        if (trueFalse == null) {
+          return query.query_string.use_dis_max;
+        }
+      
+        query.query_string.use_dis_max = trueFalse;
+        return this;
+      },
+
+      /**
+            Set the default <em>Boolean</em> operator. This operator is used to join individual query
+            terms when no operator is explicity used in the query string (i.e., <code>this AND that</code>).
+            Defaults to <code>OR</code>.
+
+            @member ejs.QueryStringQuery
+            @param {String} op The operator to use, AND or OR.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      defaultOperator: function (op) {
+        if (op == null) {
+          return query.query_string.default_operator;
+        }
+      
+        op = op.toUpperCase();
+        if (op === 'AND' || op === 'OR') {
+          query.query_string.default_operator = op;
+        }
+        
+        return this;
+      },
+
+      /**
+            Sets the analyzer name used to analyze the <code>Query</code> object.
+
+            @member ejs.QueryStringQuery
+            @param {String} analyzer A valid analyzer name.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      analyzer: function (analyzer) {
+        if (analyzer == null) {
+          return query.query_string.analyzer;
+        }
+
+        query.query_string.analyzer = analyzer;
+        return this;
+      },
+
+      /**
+            Sets the quote analyzer name used to analyze the <code>query</code>
+            when in quoted text.
+
+            @member ejs.QueryStringQuery
+            @param {String} analyzer A valid analyzer name.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      quoteAnalyzer: function (analyzer) {
+        if (analyzer == null) {
+          return query.query_string.quote_analyzer;
+        }
+
+        query.query_string.quote_analyzer = analyzer;
+        return this;
+      },
+      
+      /**
+            Sets whether or not wildcard characters (* and ?) are allowed as the
+            first character of the <code>Query</code>.  Default: true.
+
+            @member ejs.QueryStringQuery
+            @param {Boolean} trueFalse A <code>true/false</code> value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      allowLeadingWildcard: function (trueFalse) {
+        if (trueFalse == null) {
+          return query.query_string.allow_leading_wildcard;
+        }
+
+        query.query_string.allow_leading_wildcard = trueFalse;
+        return this;
+      },
+
+      /**
+            Sets whether or not terms from wildcard, prefix, fuzzy, and
+            range queries should automatically be lowercased in the <code>Query</code>
+            since they are not analyzed.  Default: true.
+
+            @member ejs.QueryStringQuery
+            @param {Boolean} trueFalse A <code>true/false</code> value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      lowercaseExpandedTerms: function (trueFalse) {
+        if (trueFalse == null) {
+          return query.query_string.lowercase_expanded_terms;
+        }
+
+        query.query_string.lowercase_expanded_terms = trueFalse;
+        return this;
+      },
+
+      /**
+            Sets whether or not position increments will be used in the
+            <code>Query</code>. Default: true.
+
+            @member ejs.QueryStringQuery
+            @param {Boolean} trueFalse A <code>true/false</code> value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      enablePositionIncrements: function (trueFalse) {
+        if (trueFalse == null) {
+          return query.query_string.enable_position_increments;
+        }
+
+        query.query_string.enable_position_increments = trueFalse;
+        return this;
+      },
+
+
+      /**
+            Sets the prefix length for fuzzy queries.  Default: 0.
+
+            @member ejs.QueryStringQuery
+            @param {Integer} fuzzLen A positive <code>integer</code> value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      fuzzyPrefixLength: function (fuzzLen) {
+        if (fuzzLen == null) {
+          return query.query_string.fuzzy_prefix_length;
+        }
+
+        query.query_string.fuzzy_prefix_length = fuzzLen;
+        return this;
+      },
+
+      /**
+            Set the minimum similarity for fuzzy queries.  Default: 0.5.
+
+            @member ejs.QueryStringQuery
+            @param {Double} minSim A <code>double</code> value between 0 and 1.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      fuzzyMinSim: function (minSim) {
+        if (minSim == null) {
+          return query.query_string.fuzzy_min_sim;
+        }
+
+        query.query_string.fuzzy_min_sim = minSim;
+        return this;
+      },
+
+      /**
+            Sets the default slop for phrases. If zero, then exact phrase matches
+            are required.  Default: 0.
+
+            @member ejs.QueryStringQuery
+            @param {Integer} slop A positive <code>integer</code> value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      phraseSlop: function (slop) {
+        if (slop == null) {
+          return query.query_string.phrase_slop;
+        }
+
+        query.query_string.phrase_slop = slop;
+        return this;
+      },
+
+      /**
+            Sets whether or not we should attempt to analyzed wilcard terms in the
+            <code>Query</code>. By default, wildcard terms are not analyzed.
+            Analysis of wildcard characters is not perfect.  Default: false.
+
+            @member ejs.QueryStringQuery
+            @param {Boolean} trueFalse A <code>true/false</code> value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      analyzeWildcard: function (trueFalse) {
+        if (trueFalse == null) {
+          return query.query_string.analyze_wildcard;
+        }
+
+        query.query_string.analyze_wildcard = trueFalse;
+        return this;
+      },
+
+      /**
+            Sets whether or not we should auto generate phrase queries *if* the
+            analyzer returns more than one term. Default: false.
+
+            @member ejs.QueryStringQuery
+            @param {Boolean} trueFalse A <code>true/false</code> value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      autoGeneratePhraseQueries: function (trueFalse) {
+        if (trueFalse == null) {
+          return query.query_string.auto_generate_phrase_queries;
+        }
+
+        query.query_string.auto_generate_phrase_queries = trueFalse;
+        return this;
+      },
+
+      /**
+            Sets a percent value controlling how many "should" clauses in the
+            resulting <code>Query</code> should match.
+
+            @member ejs.QueryStringQuery
+            @param {Integer} minMatch An <code>integer</code> between 0 and 100.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      minimumShouldMatch: function (minMatch) {
+        if (minMatch == null) {
+          return query.query_string.minimum_should_match;
+        }
+
+        query.query_string.minimum_should_match = minMatch;
+        return this;
+      },
+
+      /**
+            Sets the tie breaker value for a <code>Query</code> using
+            <code>DisMax</code>.  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.
+
+            @member ejs.QueryStringQuery
+            @param {Double} tieBreaker A positive <code>double</code> value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      tieBreaker: function (tieBreaker) {
+        if (tieBreaker == null) {
+          return query.query_string.tie_breaker;
+        }
+
+        query.query_string.tie_breaker = tieBreaker;
+        return this;
+      },
+
+      /**
+            If they query string should be escaped or not.
+
+            @member ejs.QueryStringQuery
+            @param {Boolean} trueFalse A <code>true/false</code> value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      escape: function (trueFalse) {
+        if (trueFalse == null) {
+          return query.query_string.escape;
+        }
+
+        query.query_string.escape = trueFalse;
+        return this;
+      },
+
+      /**
+            Sets the max number of term expansions for fuzzy queries.  
+
+            @member ejs.QueryStringQuery
+            @param {Integer} max A positive <code>integer</code> value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      fuzzyMaxExpansions: function (max) {
+        if (max == null) {
+          return query.query_string.fuzzy_max_expansions;
+        }
+
+        query.query_string.fuzzy_max_expansions = max;
+        return this;
+      },
+
+      /**
+            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.
+            
+            @member ejs.QueryStringQuery
+            @param {String} m The rewrite method as a string.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      fuzzyRewrite: function (m) {
+        if (m == null) {
+          return query.query_string.fuzzy_rewrite;
+        }
+
+        m = m.toLowerCase();
+        if (m === 'constant_score_auto' || m === 'scoring_boolean' ||
+          m === 'constant_score_boolean' || m === 'constant_score_filter' ||
+          m.indexOf('top_terms_boost_') === 0 || 
+          m.indexOf('top_terms_') === 0) {
+            
+          query.query_string.fuzzy_rewrite = m;
+        }
+        
+        return this;
+      },
+
+      /**
+            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.
+
+            @member ejs.QueryStringQuery
+            @param {String} m The rewrite method as a string.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      rewrite: function (m) {
+        if (m == null) {
+          return query.query_string.rewrite;
+        }
+        
+        m = m.toLowerCase();
+        if (m === 'constant_score_auto' || m === 'scoring_boolean' ||
+          m === 'constant_score_boolean' || m === 'constant_score_filter' ||
+          m.indexOf('top_terms_boost_') === 0 || 
+          m.indexOf('top_terms_') === 0) {
+            
+          query.query_string.rewrite = m;
+        }
+        
+        return this;
+      },
+
+      /**
+            Sets the suffix to automatically add to the field name when 
+            performing a quoted search.
+
+            @member ejs.QueryStringQuery
+            @param {String} s The suffix as a string.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      quoteFieldSuffix: function (s) {
+        if (s == null) {
+          return query.query_string.quote_field_suffix;
+        }
+
+        query.query_string.quote_field_suffix = s;
+        return this;
+      },
+      
+      /**
+            Enables lenient parsing of the query string.
+
+            @member ejs.QueryStringQuery
+            @param {Boolean} trueFalse A boolean value
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      lenient: function (trueFalse) {
+        if (trueFalse == null) {
+          return query.query_string.lenient;
+        }
+
+        query.query_string.lenient = trueFalse;
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>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.</p>
+
+    @name ejs.RangeQuery
+    @ejs query
+    @borrows ejs.QueryMixin._type as _type
+    @borrows ejs.QueryMixin.toJSON as toJSON
+
+    @desc
+    Matches documents with fields that have terms within a certain range.
+
+    @param {String} field A valid field name.
+    */
+  ejs.RangeQuery = function (field) {
+
+    var
+      _common = ejs.QueryMixin('range'),
+      query = _common.toJSON();
+
+    query.range[field] = {};
+
+    return extend(_common, {
+
+      /**
+             The field to run the query against.
+
+             @member ejs.RangeQuery
+             @param {String} f A single field name.
+             @returns {Object} returns <code>this</code> so that calls can be chained.
+             */
+      field: function (f) {
+        var oldValue = query.range[field];
+
+        if (f == null) {
+          return field;
+        }
+
+        delete query.range[field];
+        field = f;
+        query.range[f] = oldValue;
+
+        return this;
+      },
+
+      /**
+            The lower bound. Defaults to start from the first.
+
+            @member ejs.RangeQuery
+            @param {*} f the lower bound value, type depends on field type
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      from: function (f) {
+        if (f == null) {
+          return query.range[field].from;
+        }
+
+        query.range[field].from = f;
+        return this;
+      },
+
+      /**
+            The upper bound. Defaults to unbounded.
+
+            @member ejs.RangeQuery
+            @param {*} t the upper bound value, type depends on field type
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      to: function (t) {
+        if (t == null) {
+          return query.range[field].to;
+        }
+
+        query.range[field].to = t;
+        return this;
+      },
+
+      /**
+            Should the first from (if set) be inclusive or not. 
+            Defaults to true
+
+            @member ejs.RangeQuery
+            @param {Boolean} trueFalse true to include, false to exclude 
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      includeLower: function (trueFalse) {
+        if (trueFalse == null) {
+          return query.range[field].include_lower;
+        }
+
+        query.range[field].include_lower = trueFalse;
+        return this;
+      },
+
+      /**
+            Should the last to (if set) be inclusive or not. Defaults to true.
+
+            @member ejs.RangeQuery
+            @param {Boolean} trueFalse true to include, false to exclude 
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      includeUpper: function (trueFalse) {
+        if (trueFalse == null) {
+          return query.range[field].include_upper;
+        }
+
+        query.range[field].include_upper = trueFalse;
+        return this;
+      },
+
+      /**
+            Greater than value.  Same as setting from to the value, and 
+            include_lower to false,
+
+            @member ejs.RangeQuery
+            @param {*} val the value, type depends on field type
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      gt: function (val) {
+        if (val == null) {
+          return query.range[field].gt;
+        }
+
+        query.range[field].gt = val;
+        return this;
+      },
+
+      /**
+            Greater than or equal to value.  Same as setting from to the value,
+            and include_lower to true.
+
+            @member ejs.RangeQuery
+            @param {*} val the value, type depends on field type
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      gte: function (val) {
+        if (val == null) {
+          return query.range[field].gte;
+        }
+
+        query.range[field].gte = val;
+        return this;
+      },
+
+      /**
+            Less than value.  Same as setting to to the value, and include_upper 
+            to false.
+
+            @member ejs.RangeQuery
+            @param {*} val the value, type depends on field type
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      lt: function (val) {
+        if (val == null) {
+          return query.range[field].lt;
+        }
+
+        query.range[field].lt = val;
+        return this;
+      },
+
+      /**
+            Less than or equal to value.  Same as setting to to the value, 
+            and include_upper to true.
+
+            @member ejs.RangeQuery
+            @param {*} val the value, type depends on field type
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      lte: function (val) {
+        if (val == null) {
+          return query.range[field].lte;
+        }
+
+        query.range[field].lte = val;
+        return this;
+      },
+                            
+      /**
+            Sets the boost value of the <code>Query</code>.
+
+            @member ejs.RangeQuery
+            @param {Double} boost A positive <code>double</code> value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      boost: function (boost) {
+        if (boost == null) {
+          return query.range[field].boost;
+        }
+
+        query.range[field].boost = boost;
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>Matches documents that have fields matching a regular expression. Based 
+    on Lucene 4.0 RegexpQuery which uses automaton to efficiently iterate over 
+    index terms.</p>
+
+    @name ejs.RegexpQuery
+    @ejs query
+    @borrows ejs.QueryMixin._type as _type
+    @borrows ejs.QueryMixin.toJSON as toJSON
+
+    @desc
+    Matches documents that have fields matching a regular expression.
+
+    @param {String} field A valid field name.
+    @param {String} value A regex pattern.
+    */
+  ejs.RegexpQuery = function (field, value) {
+
+    var
+      _common = ejs.QueryMixin('regexp'),
+      query = _common.toJSON();
+
+    query.regexp[field] = {
+      value: value
+    };
+
+    return extend(_common, {
+
+      /**
+             The field to run the query against.
+
+             @member ejs.RegexpQuery
+             @param {String} f A single field name.
+             @returns {Object} returns <code>this</code> so that calls can be chained.
+             */
+      field: function (f) {
+        var oldValue = query.regexp[field];
+
+        if (f == null) {
+          return field;
+        }
+
+        delete query.regexp[field];
+        field = f;
+        query.regexp[f] = oldValue;
+
+        return this;
+      },
+
+      /**
+            The regexp value.
+
+            @member ejs.RegexpQuery
+            @param {String} p A string regexp
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      value: function (p) {
+        if (p == null) {
+          return query.regexp[field].value;
+        }
+
+        query.regexp[field].value = p;
+        return this;
+      },
+
+      /**
+            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: <n-m>
+            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
+
+            @member ejs.RegexpQuery
+            @param {String} f The flags as a string, separate multiple flags with "|".
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      flags: function (f) {
+        if (f == null) {
+          return query.regexp[field].flags;
+        }
+
+        query.regexp[field].flags = f;
+        return this;
+      },
+    
+      /**
+            The regex flags to use as a numeric value.  Advanced use only,
+            it is probably better to stick with the <code>flags</code> option.
+          
+            @member ejs.RegexpQuery
+            @param {String} v The flags as a numeric value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      flagsValue: function (v) {
+        if (v == null) {
+          return query.regexp[field].flags_value;
+        }
+
+        query.regexp[field].flags_value = v;
+        return this;
+      },
+    
+      /**
+            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.
+
+            @member ejs.RegexpQuery
+            @param {String} m The rewrite method as a string.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      rewrite: function (m) {
+        if (m == null) {
+          return query.regexp[field].rewrite;
+        }
+      
+        m = m.toLowerCase();
+        if (m === 'constant_score_auto' || m === 'scoring_boolean' ||
+          m === 'constant_score_boolean' || m === 'constant_score_filter' ||
+          m.indexOf('top_terms_boost_') === 0 || 
+          m.indexOf('top_terms_') === 0) {
+          
+          query.regexp[field].rewrite = m;
+        }
+      
+        return this;
+      },
+    
+      /**
+            Sets the boost value of the <code>Query</code>.
+
+            @member ejs.RegexpQuery
+            @param {Double} boost A positive <code>double</code> value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      boost: function (boost) {
+        if (boost == null) {
+          return query.regexp[field].boost;
+        }
+
+        query.regexp[field].boost = boost;
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>Matches spans near the beginning of a field. The spanFirstQuery allows you to search
+    for Spans that start and end within the first <code>n</code> positions of the document.
+    The span first query maps to Lucene SpanFirstQuery.</p>
+
+    @name ejs.SpanFirstQuery
+    @ejs query
+    @borrows ejs.QueryMixin.boost as boost
+    @borrows ejs.QueryMixin._type as _type
+    @borrows ejs.QueryMixin.toJSON as toJSON
+
+    @desc
+    Matches spans near the beginning of a field.
+
+    @param {Query} spanQry A valid SpanQuery
+    @param {Integer} end the maximum end position in a match.
+    
+    */
+  ejs.SpanFirstQuery = function (spanQry, end) {
+
+    if (!isQuery(spanQry)) {
+      throw new TypeError('Argument must be a SpanQuery');
+    }
+    
+    var 
+      _common = ejs.QueryMixin('span_first'),
+      query = _common.toJSON();
+    
+    query.span_first.match = spanQry.toJSON();
+    query.span_first.end = end;
+
+    return extend(_common, {
+
+      /**
+            Sets the span query to match on.
+
+            @member ejs.SpanFirstQuery
+            @param {Object} spanQuery Any valid span type query.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      match: function (spanQuery) {
+        if (spanQuery == null) {
+          return query.span_first.match;
+        }
+      
+        if (!isQuery(spanQuery)) {
+          throw new TypeError('Argument must be a SpanQuery');
+        }
+        
+        query.span_first.match = spanQuery.toJSON();
+        return this;
+      },
+
+      /**
+            Sets the maximum end position permitted in a match.
+
+            @member ejs.SpanFirstQuery
+            @param {Number} position The maximum position length to consider.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      end: function (position) {
+        if (position == null) {
+          return query.span_first.end;
+        }
+      
+        query.span_first.end = position;
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>Wraps lucene MultiTermQueries as a SpanQuery so it can be used in the
+    various Span* queries.  Examples of valid MultiTermQueries are
+    <code>Fuzzy, NumericRange, Prefix, Regex, Range, and Wildcard</code>.</p>
+
+    @name ejs.SpanMultiTermQuery
+    @ejs query
+    @borrows ejs.QueryMixin.boost as boost
+    @borrows ejs.QueryMixin._type as _type
+    @borrows ejs.QueryMixin.toJSON as toJSON
+
+    @desc
+    Use MultiTermQueries as a SpanQuery.
+
+    @param {Query} qry An optional multi-term query object.
+    */
+  ejs.SpanMultiTermQuery = function (qry) {
+
+    if (qry != null && !isQuery(qry)) {
+      throw new TypeError('Argument must be a MultiTermQuery');
+    }
+
+    var 
+      _common = ejs.QueryMixin('span_multi'),
+      query = _common.toJSON();
+    
+    query.span_multi.match = {};
+    
+    if (qry != null) {
+      query.span_multi.match = qry.toJSON();
+    }
+
+    return extend(_common, {
+
+      /**
+            Sets the span query to match on.
+
+            @member ejs.SpanMultiTermQuery
+            @param {Object} mtQuery Any valid multi-term query.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      match: function (mtQuery) {
+        if (mtQuery == null) {
+          return query.span_multi.match;
+        }
+  
+        if (!isQuery(mtQuery)) {
+          throw new TypeError('Argument must be a MultiTermQuery');
+        }
+    
+        query.span_multi.match = mtQuery.toJSON();
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>A spanNearQuery will look to find a number of spanQuerys within a given
+    distance from each other.</p>
+
+    @name ejs.SpanNearQuery
+    @ejs query
+    @borrows ejs.QueryMixin.boost as boost
+    @borrows ejs.QueryMixin._type as _type
+    @borrows ejs.QueryMixin.toJSON as toJSON
+
+    @desc
+    Matches spans which are near one another.
+
+    @param {(Query|Query[])} clauses A single SpanQuery or array of SpanQueries
+    @param {Integer} slop The number of intervening unmatched positions
+
+    */
+  ejs.SpanNearQuery = function (clauses, slop) {
+
+    var 
+      i, 
+      len,
+      _common = ejs.QueryMixin('span_near'),
+      query = _common.toJSON();
+    
+    query.span_near.clauses = [];
+    query.span_near.slop = slop;
+    
+    if (isQuery(clauses)) {
+      query.span_near.clauses.push(clauses.toJSON());
+    } else if (isArray(clauses)) {
+      for (i = 0, len = clauses.length; i < len; i++) {
+        if (!isQuery(clauses[i])) {
+          throw new TypeError('Argument must be array of SpanQueries');
+        }
+        
+        query.span_near.clauses.push(clauses[i].toJSON());
+      }
+    } else {
+      throw new TypeError('Argument must be SpanQuery or array of SpanQueries');
+    }
+
+    return extend(_common, {
+
+      /**
+            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.
+
+            @member ejs.SpanNearQuery
+            @param {(Query|Query[])} clauses A SpanQuery or array of SpanQueries.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      clauses: function (clauses) {
+        var i, len;
+        
+        if (clauses == null) {
+          return query.span_near.clauses;
+        }
+      
+        if (isQuery(clauses)) {
+          query.span_near.clauses.push(clauses.toJSON());
+        } else if (isArray(clauses)) {
+          query.span_near.clauses = [];
+          for (i = 0, len = clauses.length; i < len; i++) {
+            if (!isQuery(clauses[i])) {
+              throw new TypeError('Argument must be array of SpanQueries');
+            }
+
+            query.span_near.clauses.push(clauses[i].toJSON());
+          }
+        } else {
+          throw new TypeError('Argument must be SpanQuery or array of SpanQueries');
+        }
+        
+        return this;
+      },
+
+      /**
+            Sets the maximum number of intervening unmatched positions.
+
+            @member ejs.SpanNearQuery
+            @param {Number} distance The number of intervening unmatched positions.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      slop: function (distance) {
+        if (distance == null) {
+          return query.span_near.slop;
+        }
+      
+        query.span_near.slop = distance;
+        return this;
+      },
+
+      /**
+            Sets whether or not matches are required to be in-order.
+
+            @member ejs.SpanNearQuery
+            @param {Boolean} trueFalse Determines if matches must be in-order.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      inOrder: function (trueFalse) {
+        if (trueFalse == null) {
+          return query.span_near.in_order;
+        }
+      
+        query.span_near.in_order = trueFalse;
+        return this;
+      },
+
+      /**
+            Sets whether or not payloads are being used. A payload is an arbitrary
+            byte array stored at a specific position (i.e. token/term).
+
+            @member ejs.SpanNearQuery
+            @param {Boolean} trueFalse Whether or not to return payloads.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      collectPayloads: function (trueFalse) {
+        if (trueFalse == null) {
+          return query.span_near.collect_payloads;
+        }
+      
+        query.span_near.collect_payloads = trueFalse;
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>Removes matches which overlap with another span query.
+    The span not query maps to Lucene SpanNotQuery.</p>
+
+    @name ejs.SpanNotQuery
+    @ejs query
+    @borrows ejs.QueryMixin.boost as boost
+    @borrows ejs.QueryMixin._type as _type
+    @borrows ejs.QueryMixin.toJSON as toJSON
+
+    @desc
+    Removes matches which overlap with another span query.
+
+    @param {Query} includeQry a valid SpanQuery whose matching docs will be returned.
+    @param {Query} excludeQry a valid SpanQuery whose matching docs will not be returned
+    
+    */
+  ejs.SpanNotQuery = function (includeQry, excludeQry) {
+
+    if (!isQuery(includeQry) || !isQuery(excludeQry)) {
+      throw new TypeError('Argument must be a SpanQuery');
+    }
+    
+    var
+      _common = ejs.QueryMixin('span_not'),
+      query = _common.toJSON();
+    
+    query.span_not.include = includeQry.toJSON();
+    query.span_not.exclude = excludeQry.toJSON();
+
+    return extend(_common, {
+
+      /**
+            Set the span query whose matches are filtered.
+
+            @member ejs.SpanNotQuery
+            @param {Object} spanQuery Any valid span type query.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      include: function (spanQuery) {
+        if (spanQuery == null) {
+          return query.span_not.include;
+        }
+      
+        if (!isQuery(spanQuery)) {
+          throw new TypeError('Argument must be a SpanQuery');
+        }
+        
+        query.span_not.include = spanQuery.toJSON();
+        return this;
+      },
+
+      /**
+            Sets the span query whose matches must not overlap those returned.
+
+            @member ejs.SpanNotQuery
+            @param {Object} spanQuery Any valid span type query.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      exclude: function (spanQuery) {
+        if (spanQuery == null) {
+          return query.span_not.exclude;
+        }
+      
+        if (!isQuery(spanQuery)) {
+          throw new TypeError('Argument must be a SpanQuery');
+        }
+        
+        query.span_not.exclude = spanQuery.toJSON();
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>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.</p>
+
+    @name ejs.SpanOrQuery
+    @ejs query
+    @borrows ejs.QueryMixin.boost as boost
+    @borrows ejs.QueryMixin._type as _type
+    @borrows ejs.QueryMixin.toJSON as toJSON
+
+    @desc
+    Matches the union of its span clauses.
+
+    @param {Object} clauses A single SpanQuery or array of SpanQueries.
+
+    */
+  ejs.SpanOrQuery = function (clauses) {
+
+    var
+      i, 
+      len,
+      _common = ejs.QueryMixin('span_or'),
+      query = _common.toJSON();
+    
+    query.span_or.clauses = [];
+
+    if (isQuery(clauses)) {
+      query.span_or.clauses.push(clauses.toJSON());
+    } else if (isArray(clauses)) {
+      for (i = 0, len = clauses.length; i < len; i++) {
+        if (!isQuery(clauses[i])) {
+          throw new TypeError('Argument must be array of SpanQueries');
+        }
+        
+        query.span_or.clauses.push(clauses[i].toJSON());
+      }
+    } else {
+      throw new TypeError('Argument must be SpanQuery or array of SpanQueries');
+    }
+
+    return extend(_common, {
+
+      /**
+            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.
+
+            @member ejs.SpanOrQuery
+            @param {(Query|Query[])} clauses A SpanQuery or array of SpanQueries.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      clauses: function (clauses) {
+        var i, len;
+        
+        if (clauses == null) {
+          return query.span_or.clauses;
+        }
+      
+        if (isQuery(clauses)) {
+          query.span_or.clauses.push(clauses.toJSON());
+        } else if (isArray(clauses)) {
+          query.span_or.clauses = [];
+          for (i = 0, len = clauses.length; i < len; i++) {
+            if (!isQuery(clauses[i])) {
+              throw new TypeError('Argument must be array of SpanQueries');
+            }
+
+            query.span_or.clauses.push(clauses[i].toJSON());
+          }
+        } else {
+          throw new TypeError('Argument must be SpanQuery or array of SpanQueries');
+        }
+        
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>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.</p>
+
+    @name ejs.SpanTermQuery
+    @ejs query
+    @borrows ejs.QueryMixin._type as _type
+    @borrows ejs.QueryMixin.toJSON as toJSON
+
+    @desc
+    Matches spans containing a term
+
+    @param {String} field the document field/field to query against
+    @param {String} value the literal value to be matched
+    */
+  ejs.SpanTermQuery = function (field, value) {
+
+    var
+      _common = ejs.QueryMixin('span_term'),
+      query = _common.toJSON();
+
+    query.span_term[field] = {
+      term: value
+    };
+
+    return extend(_common, {
+
+      /**
+            Sets the field to query against.
+
+            @member ejs.SpanTermQuery
+            @param {String} f A valid field name.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      field: function (f) {
+        var oldValue = query.span_term[field];
+      
+        if (f == null) {
+          return field;
+        }
+
+        delete query.span_term[field];
+        field = f;
+        query.span_term[f] = oldValue;
+      
+        return this;
+      },
+    
+      /**
+            Sets the term.
+
+            @member ejs.SpanTermQuery
+            @param {String} t A single term.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      term: function (t) {
+        if (t == null) {
+          return query.span_term[field].term;
+        }
+
+        query.span_term[field].term = t;
+        return this;
+      },
+      
+      /**
+            Sets the boost value for documents matching the <code>Query</code>.
+
+            @member ejs.SpanTermQuery
+            @param {Double} boost A positive <code>double</code> value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      boost: function (boost) {
+        if (boost == null) {
+          return query.span_term[field].boost;
+        }
+
+        query.span_term[field].boost = boost;
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>A <code>TermQuery</code> can be used to return documents containing a given
+    keyword or <em>term</em>. For instance, you might want to retieve all the
+    documents/objects that contain the term <code>Javascript</code>. Term filters
+    often serve as the basis for more complex queries such as <em>Boolean</em> queries.</p>
+
+    @name ejs.TermQuery
+    @ejs query
+    @borrows ejs.QueryMixin._type as _type
+    @borrows ejs.QueryMixin.toJSON as toJSON
+
+    @desc
+    A Query that matches documents containing a term. This may be
+    combined with other terms with a BooleanQuery.
+
+    @param {String} field the document field/key to query against
+    @param {String} term the literal value to be matched
+    */
+  ejs.TermQuery = function (field, term) {
+
+    var
+      _common = ejs.QueryMixin('term'),
+      query = _common.toJSON();
+
+    query.term[field] = {
+      term: term
+    };
+
+    return extend(_common, {
+
+      /**
+            Sets the fields to query against.
+
+            @member ejs.TermQuery
+            @param {String} f A valid field name.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      field: function (f) {
+        var oldValue = query.term[field];
+      
+        if (f == null) {
+          return field;
+        }
+
+        delete query.term[field];
+        field = f;
+        query.term[f] = oldValue;
+      
+        return this;
+      },
+    
+      /**
+            Sets the term.
+
+            @member ejs.TermQuery
+            @param {String} t A single term.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      term: function (t) {
+        if (t == null) {
+          return query.term[field].term;
+        }
+
+        query.term[field].term = t;
+        return this;
+      },
+      
+      /**
+            Sets the boost value for documents matching the <code>Query</code>.
+
+            @member ejs.TermQuery
+            @param {Number} boost A positive <code>double</code> value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      boost: function (boost) {
+        if (boost == null) {
+          return query.term[field].boost;
+        }
+
+        query.term[field].boost = boost;
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>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.</p>
+
+    @name ejs.TermsQuery
+    @ejs query
+    @borrows ejs.QueryMixin.boost as boost
+    @borrows ejs.QueryMixin._type as _type
+    @borrows ejs.QueryMixin.toJSON as toJSON
+
+    @desc
+    A Query that matches documents containing provided terms. 
+
+    @param {String} field the document field/key to query against
+    @param {(String|String[])} terms a single term or array of "terms" to match
+    */
+  ejs.TermsQuery = function (field, terms) {
+
+    var
+      _common = ejs.QueryMixin('terms'),
+      query = _common.toJSON();
+    
+    if (isString(terms)) {
+      query.terms[field] = [terms];
+    } else if (isArray(terms)) {
+      query.terms[field] = terms;
+    } else {
+      throw new TypeError('Argument must be string or array');
+    }
+    
+    return extend(_common, {
+
+      /**
+            Sets the fields to query against.
+
+            @member ejs.TermsQuery
+            @param {String} f A valid field name.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      field: function (f) {
+        var oldValue = query.terms[field];
+      
+        if (f == null) {
+          return field;
+        }
+
+        delete query.terms[field];
+        field = f;
+        query.terms[f] = oldValue;
+      
+        return this;
+      },
+    
+      /**
+            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.
+
+            @member ejs.TermsQuery
+            @param {(String|String[])} t A single term or an array or terms.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      terms: function (t) {
+        if (t == null) {
+          return query.terms[field];
+        }
+
+        if (isString(t)) {
+          query.terms[field].push(t);
+        } else if (isArray(t)) {
+          query.terms[field] = t;
+        } else {
+          throw new TypeError('Argument must be string or array');
+        }
+      
+        return this;
+      },
+
+      /**
+            Sets the minimum number of terms that need to match in a document
+            before that document is returned in the results.
+
+            @member ejs.TermsQuery
+            @param {Integer} min A positive integer.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      minimumShouldMatch: function (min) {
+        if (min == null) {
+          return query.terms.minimum_should_match;
+        }
+      
+        query.terms.minimum_should_match = min;
+        return this;
+      },
+      
+      /**
+            Enables or disables similarity coordinate scoring of documents
+            matching the <code>Query</code>. Default: false.
+
+            @member ejs.TermsQuery
+            @param {String} trueFalse A <code>true/false</code value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      disableCoord: function (trueFalse) {
+        if (trueFalse == null) {
+          return query.terms.disable_coord;
+        }
+
+        query.terms.disable_coord = trueFalse;
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>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.</p>
+
+    <p>The top_children also provide scoring capabilities, with the ability to 
+    specify max, sum or avg as the score type.</p>
+
+    @name ejs.TopChildrenQuery
+    @ejs query
+    @borrows ejs.QueryMixin.boost as boost
+    @borrows ejs.QueryMixin._type as _type
+    @borrows ejs.QueryMixin.toJSON as toJSON
+
+    @desc
+    Returns child documents matching the query aggregated into the parent docs.
+
+    @param {Object} qry A valid query object.
+    @param {String} type The child type to execute the query on
+    */
+  ejs.TopChildrenQuery = function (qry, type) {
+
+    if (!isQuery(qry)) {
+      throw new TypeError('Argument must be a Query');
+    }
+    
+    var 
+      _common = ejs.QueryMixin('top_children'),
+      query = _common.toJSON();
+    
+    query.top_children.query = qry.toJSON();
+    query.top_children.type = type;
+
+    return extend(_common, {
+
+      /**
+            Sets the query
+
+            @member ejs.TopChildrenQuery
+            @param {Object} q A valid Query object
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      query: function (q) {
+        if (q == null) {
+          return query.top_children.query;
+        }
+  
+        if (!isQuery(q)) {
+          throw new TypeError('Argument must be a Query');
+        }
+        
+        query.top_children.query = q.toJSON();
+        return this;
+      },
+
+      /**
+            Sets the child document type to search against
+
+            @member ejs.TopChildrenQuery
+            @param {String} t A valid type name
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      type: function (t) {
+        if (t == null) {
+          return query.top_children.type;
+        }
+  
+        query.top_children.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. 
+
+            @deprecated since elasticsearch 0.90
+            @member ejs.TopChildrenQuery
+            @param {String} s The scope name as a string.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      scope: function (s) {
+        return this;
+      },
+
+      /**
+            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
+            
+            @member ejs.TopChildrenQuery
+            @param {String} s The scoring type as a string. 
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      score: function (s) {
+        if (s == null) {
+          return query.top_children.score;
+        }
+  
+        s = s.toLowerCase();
+        if (s === 'max' || s === 'sum' || s === 'avg' || s === 'total') {
+          query.top_children.score = s;
+        }
+      
+        return this;
+      },
+  
+      /**
+            Sets the scoring type.  Valid values are max, sum, total, or avg. 
+            If another value is passed it we silently ignore the value.
+
+            @member ejs.TopChildrenQuery
+            @param {String} s The scoring type as a string. 
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      scoreMode: function (s) {
+        if (s == null) {
+          return query.top_children.score_mode;
+        }
+  
+        s = s.toLowerCase();
+        if (s === 'max' || s === 'sum' || s === 'avg' || s === 'total') {
+          query.top_children.score_mode = s;
+        }
+      
+        return this;
+      },
+      
+      /**
+            Sets the factor which is the number of hits that are asked for in
+            the child query.  Defaults to 5.
+
+            @member ejs.TopChildrenQuery
+            @param {Integer} f A positive integer value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      factor: function (f) {
+        if (f == null) {
+          return query.top_children.factor;
+        }
+
+        query.top_children.factor = f;
+        return this;
+      },
+
+      /**
+            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
+
+            @member ejs.TopChildrenQuery
+            @param {Integer} f A positive integer value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      incrementalFactor: function (f) {
+        if (f == null) {
+          return query.top_children.incremental_factor;
+        }
+
+        query.top_children.incremental_factor = f;
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>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.</p>
+
+    @name ejs.WildcardQuery
+    @ejs query
+    @borrows ejs.QueryMixin._type as _type
+    @borrows ejs.QueryMixin.toJSON as toJSON
+
+    @desc
+    A Query that matches documents containing a wildcard. This may be
+    combined with other wildcards with a BooleanQuery.
+
+    @param {String} field the document field/key to query against
+    @param {String} value the literal value to be matched
+    */
+  ejs.WildcardQuery = function (field, value) {
+
+    var
+      _common = ejs.QueryMixin('wildcard'),
+      query = _common.toJSON();
+
+    query.wildcard[field] = {
+      value: value
+    };
+
+    return extend(_common, {
+
+      /**
+            Sets the fields to query against.
+
+            @member ejs.WildcardQuery
+            @param {String} f A valid field name.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      field: function (f) {
+        var oldValue = query.wildcard[field];
+    
+        if (f == null) {
+          return field;
+        }
+
+        delete query.wildcard[field];
+        field = f;
+        query.wildcard[f] = oldValue;
+    
+        return this;
+      },
+  
+      /**
+            Sets the wildcard query value.
+
+            @member ejs.WildcardQuery
+            @param {String} v A single term.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      value: function (v) {
+        if (v == null) {
+          return query.wildcard[field].value;
+        }
+
+        query.wildcard[field].value = v;
+        return this;
+      },
+    
+      /**
+            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.
+
+            @member ejs.WildcardQuery
+            @param {String} m The rewrite method as a string.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      rewrite: function (m) {
+        if (m == null) {
+          return query.wildcard[field].rewrite;
+        }
+        
+        m = m.toLowerCase();
+        if (m === 'constant_score_auto' || m === 'scoring_boolean' ||
+          m === 'constant_score_boolean' || m === 'constant_score_filter' ||
+          m.indexOf('top_terms_boost_') === 0 || 
+          m.indexOf('top_terms_') === 0) {
+            
+          query.wildcard[field].rewrite = m;
+        }
+        
+        return this;
+      },
+      
+      /**
+            Sets the boost value for documents matching the <code>Query</code>.
+
+            @member ejs.WildcardQuery
+            @param {Number} boost A positive <code>double</code> value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      boost: function (boost) {
+        if (boost == null) {
+          return query.wildcard[field].boost;
+        }
+
+        query.wildcard[field].boost = boost;
+        return this;
+      }
+      
+    });
+  };
+
+  /**
+    @class
+    <p>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.</p>
+
+    @name ejs.BoostFactorScoreFunction
+    @ejs scorefunction
+    @borrows ejs.ScoreFunctionMixin.filter as filter
+    @borrows ejs.ScoreFunctionMixin._type as _type
+    @borrows ejs.ScoreFunctionMixin.toJSON as toJSON
+
+    @param {Float} boostVal the boost factor.
+
+    @desc
+    <p>Multiply the score by the provided boost_factor.</p>
+
+    */
+  ejs.BoostFactorScoreFunction = function (boostVal) {
+
+    var
+      _common = ejs.ScoreFunctionMixin('boost_factor'),
+      func = _common.toJSON();
+
+    func.boost_factor = boostVal;
+
+    return extend(_common, {
+
+      /**
+      Sets the boost factor.
+
+      @member ejs.BoostFactorScoreFunction
+      @param {Float} b the boost factor.
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      boost: function (b) {
+        if (b == null) {
+          return func.boost_factor;
+        }
+
+        func.boost_factor = b;
+        return this;
+      }
+
+    });
+  };
+
+  /**
+    @class
+    <p>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.</p>
+
+    <p>Supported decay functions are: linear, exp, and gauss.</p>
+
+    @name ejs.DecayScoreFunction
+    @ejs scorefunction
+    @borrows ejs.ScoreFunctionMixin.filter as filter
+    @borrows ejs.ScoreFunctionMixin._type as _type
+    @borrows ejs.ScoreFunctionMixin.toJSON as toJSON
+
+    @param {String} field the document field to run decay function against.
+
+    @desc
+    <p>Score a document with a function that decays depending on the distance
+    of a numeric field value of the document from given origin.</p>
+
+    */
+  ejs.DecayScoreFunction = function (field) {
+
+    var
+      mode = 'gauss', // default decay function
+      _common = ejs.ScoreFunctionMixin(mode),
+      func = _common.toJSON(),
+      changeMode = function (newMode) {
+        var oldValue;
+        if (mode !== newMode) {
+          oldValue = func[mode];
+          delete func[mode];
+          mode = newMode;
+          func[mode] = oldValue;
+        }
+      };
+
+    func[mode][field] = {};
+
+    return extend(_common, {
+
+      /**
+      Use the linear decay function. Linear decay.
+
+      @member ejs.DecayScoreFunction
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      linear: function () {
+        changeMode('linear');
+      },
+
+      /**
+      Use the exp decay function. Exponential decay.
+
+      @member ejs.DecayScoreFunction
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      exp: function () {
+        changeMode('exp');
+      },
+
+      /**
+      Use the gauss decay function. Normal decay.
+
+      @member ejs.DecayScoreFunction
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      gauss: function () {
+        changeMode('gauss');
+      },
+
+      /**
+      Sets the fields to run the decay function against.
+
+      @member ejs.DecayScoreFunction
+      @param {String} f A valid field name.
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      field: function (f) {
+        var oldValue = func[mode][field];
+
+        if (f == null) {
+          return field;
+        }
+
+        delete func[mode][field];
+        field = f;
+        func[mode][field] = oldValue;
+
+        return this;
+      },
+
+      /**
+      Sets the scale/rate of decay.
+
+      @member ejs.DecayScoreFunction
+      @param {String} s A valid scale value for the field type.
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      scale: function (s) {
+        if (s == null) {
+          return func[mode][field].scale;
+        }
+
+        func[mode][field].scale = s;
+        return this;
+      },
+
+      /**
+      Sets the origin which is the “central point” from which the distance is
+      calculated.
+
+      @member ejs.DecayScoreFunction
+      @param {String} o A valid origin value for the field type.
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      origin: function (o) {
+        if (o == null) {
+          return func[mode][field].origin;
+        }
+
+        if (isGeoPoint(o)) {
+          func[mode][field].origin = o.toJSON();
+        } else if (isEJSObject(o)) {
+          throw new TypeError('origin must be a GeoPoint or native type');
+        } else {
+          func[mode][field].origin = o;
+        }
+
+        return this;
+      },
+
+      /**
+      Sets the decay value which defines how documents are scored at the distance
+      given at scale.
+
+      @member ejs.DecayScoreFunction
+      @param {Double} d A decay value as a double.
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      decay: function (d) {
+        if (d == null) {
+          return func[mode][field].decay;
+        }
+
+        func[mode][field].decay = d;
+        return this;
+      },
+
+      /**
+      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.
+
+      @member ejs.DecayScoreFunction
+      @param {String} o A valid offset value for the field type.
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      offset: function (o) {
+        if (o == null) {
+          return func[mode][field].offset;
+        }
+
+        func[mode][field].offset = o;
+        return this;
+      }
+
+    });
+  };
+
+  /**
+    @class
+    <p>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.</p>
+
+    @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
+    <p>Multiply the score by the value of the field, multiplied by the factor.</p>
+
+    */
+  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 <code>this</code> 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 <code>this</code> 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
+    <p>The random_score generates scores via a pseudo random number algorithm
+    that is initialized with a seed.</p>
+
+    @name ejs.RandomScoreFunction
+    @ejs scorefunction
+    @borrows ejs.ScoreFunctionMixin.filter as filter
+    @borrows ejs.ScoreFunctionMixin._type as _type
+    @borrows ejs.ScoreFunctionMixin.toJSON as toJSON
+
+    @desc
+    <p>Randomly score documents.</p>
+
+    */
+  ejs.RandomScoreFunction = function () {
+
+    var
+      _common = ejs.ScoreFunctionMixin('random_score'),
+      func = _common.toJSON();
+
+    return extend(_common, {
+
+      /**
+      Sets random seed value.
+
+      @member ejs.RandomScoreFunction
+      @param {Long} s A seed value.
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      seed: function (s) {
+        if (s == null) {
+          return func.random_score.seed;
+        }
+
+        func.random_score.seed = s;
+        return this;
+      }
+
+    });
+  };
+
+  /**
+    @class
+    <p>A basic filter score function, which mathces a filter and applies a
+    weight.</p>
+
+    @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
+    <p>Randomly score documents.</p>
+
+    */
+  ejs.ScoreFunction = function () {
+
+    var
+      _common = ejs.ScoreFunctionMixin();
+
+    return _common;
+  };
+
+  /**
+    @class
+    <p>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.</p>
+
+    @name ejs.ScriptScoreFunction
+    @ejs scorefunction
+    @borrows ejs.ScoreFunctionMixin.filter as filter
+    @borrows ejs.ScoreFunctionMixin._type as _type
+    @borrows ejs.ScoreFunctionMixin.toJSON as toJSON
+
+    @desc
+    <p>Modify a documents score using a script.</p>
+
+    */
+  ejs.ScriptScoreFunction = function () {
+
+    var
+      _common = ejs.ScoreFunctionMixin('script_score'),
+      func = _common.toJSON();
+
+    return extend(_common, {
+
+      /**
+      Set the script that will modify the score.
+
+      @member ejs.ScriptScoreFunction
+      @param {String} scriptCode A valid script string to execute.
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      script: function (scriptCode) {
+        if (scriptCode == null) {
+          return func.script_score.script;
+        }
+
+        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 <code>this</code> 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;
+      },
+
+      /**
+      The script language being used.
+
+      @member ejs.ScriptScoreFunction
+      @param {String} language The language of the script.
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      lang: function (language) {
+        if (language == null) {
+          return func.script_score.lang;
+        }
+
+        func.script_score.lang = language;
+        return this;
+      },
+
+      /**
+      Sets parameters that will be applied to the script.  Overwrites
+      any existing params.
+
+      @member ejs.ScriptScoreFunction
+      @param {Object} p An object where the keys are the parameter name and
+        values are the parameter value.
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      params: function (p) {
+        if (p == null) {
+          return func.script_score.params;
+        }
+
+        func.script_score.params = p;
+        return this;
+      }
+
+
+    });
+  };
+
+  /**
+    @class
+    <p>A GeoPoint object that can be used in queries and filters that 
+    take a GeoPoint.  GeoPoint supports various input formats.</p>
+
+    <p>See http://www.elasticsearch.org/guide/reference/mapping/geo-point-type.html</p>
+
+    @name ejs.GeoPoint
+    @ejs geo
+
+    @desc
+    <p>Defines a point</p>
+
+    @param {Array} p An optional point as an array in [lat, lon] format.
+    */
+  ejs.GeoPoint = function (p) {
+
+    var point = [0, 0];
+
+    // p  = [lat, lon], convert it to GeoJSON format of [lon, lat]
+    if (p != null && isArray(p) && p.length === 2) {
+      point = [p[1], p[0]];
+    }
+  
+    return {
+
+      /**
+            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"}
+
+            @member ejs.GeoPoint
+            @param {Object} obj an object with a lat and lon or geohash property.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      properties: function (obj) {
+        if (obj == null) {
+          return point;
+        }
+      
+        if (isObject(obj) && has(obj, 'lat') && has(obj, 'lon')) {
+          point = {
+            lat: obj.lat,
+            lon: obj.lon
+          };
+        } else if (isObject(obj) && has(obj, 'geohash')) {
+          point = {
+            geohash: obj.geohash
+          };
+        }
+      
+        return this;
+      },
+
+      /**
+            Sets the GeoPoint as a string.  The format is "lat,lon".
+          
+            Example:
+          
+            "41.12,-71.34"
+
+            @member ejs.GeoPoint
+            @param {String} s a String point in "lat,lon" format.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      string: function (s) {
+        if (s == null) {
+          return point;
+        }
+      
+        if (isString(s) && s.indexOf(',') !== -1) {
+          point = s;
+        }
+      
+        return this;
+      },
+    
+      /**
+            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"
+
+            @member ejs.GeoPoint
+            @param {String} hash an GeoHash as a string
+            @param {Integer} precision an optional precision length, defaults
+              to 12 if not specified.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      geohash: function (hash, precision) {
+        // set precision, default to 12
+        precision = (precision != null && isNumber(precision)) ? precision : 12;
+      
+        if (hash == null) {
+          return point;
+        }
+      
+        if (isString(hash) && hash.length === precision) {
+          point = hash;
+        }
+      
+        return this;
+      },
+    
+      /**
+            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]
+
+            @member ejs.GeoPoint
+            @param {Array} a an array of length 2.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      array: function (a) {
+        if (a == null) {
+          return point;
+        }
+      
+      
+        // convert to GeoJSON format of [lon, lat]
+        if (isArray(a) && a.length === 2) {
+          point = [a[1], a[0]];
+        }
+      
+        return this;
+      },
+
+      /**
+            The type of ejs object.  For internal use only.
+            
+            @member ejs.GeoPoint
+            @returns {String} the type of object
+            */
+      _type: function () {
+        return 'geo point';
+      },
+      
+      /**
+            Retrieves the internal <code>script</code> object. This is typically used by
+            internal API functions so use with caution.
+
+            @member ejs.GeoPoint
+            @returns {String} returns this object's internal object representation.
+            */
+      toJSON: function () {
+        return point;
+      }
+    };
+  };
+
+  /**
+    @class
+    <p>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.</p>
+
+    <p>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.</p>
+
+    <p>See http://www.elasticsearch.org/guide/reference/api/search/highlighting.html</p>
+
+    @name ejs.Highlight
+    @ejs request
+
+    @desc
+    <p>Allows to highlight search results on one or more fields.</p>
+
+    @param {(String|String[])} fields An optional field or array of fields to highlight.
+    */
+  ejs.Highlight = function (fields) {
+
+    var highlight = {
+      fields: {}
+    },
+
+    addOption = function (field, option, val) {
+      if (field == null) {
+        highlight[option] = val;
+      } else {
+        if (!has(highlight.fields, field)) {
+          highlight.fields[field] = {};
+        }
+
+        highlight.fields[field][option] = val;
+      }
+    };
+
+    if (fields != null) {
+      if (isString(fields)) {
+        highlight.fields[fields] = {};
+      } else if (isArray(fields)) {
+        each(fields, function (field) {
+          highlight.fields[field] = {};
+        });
+      }
+    }
+
+    return {
+
+      /**
+            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.
+
+            @member ejs.Highlight
+            @param {(String|String[])} vals A field name or array of field names.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      fields: function (vals) {
+        if (vals == null) {
+          return highlight.fields;
+        }
+
+        if (isString(vals)) {
+          if (!has(highlight.fields, vals)) {
+            highlight.fields[vals] = {};
+          }
+        } else if (isArray(vals)) {
+          each(vals, function (field) {
+            if (!has(highlight.fields, field)) {
+              highlight.fields[field] = {};
+            }
+          });
+        }
+      },
+
+      /**
+            Sets the pre tags for highlighted fragments.  You can apply the
+            tags to a specific field by passing the field name in to the
+            <code>oField</code> parameter.
+
+            @member ejs.Highlight
+            @param {(String|String[])} tags A single tag or an array of tags.
+            @param {String} oField An optional field name
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      preTags: function (tags, oField) {
+        if (tags === null && oField != null) {
+          return highlight.fields[oField].pre_tags;
+        } else if (tags == null) {
+          return highlight.pre_tags;
+        }
+
+        if (isString(tags)) {
+          addOption(oField, 'pre_tags', [tags]);
+        } else if (isArray(tags)) {
+          addOption(oField, 'pre_tags', tags);
+        }
+
+        return this;
+      },
+
+      /**
+            Sets the post tags for highlighted fragments.  You can apply the
+            tags to a specific field by passing the field name in to the
+            <code>oField</code> parameter.
+
+            @member ejs.Highlight
+            @param {(String|String[])} tags A single tag or an array of tags.
+            @param {String} oField An optional field name
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      postTags: function (tags, oField) {
+        if (tags === null && oField != null) {
+          return highlight.fields[oField].post_tags;
+        } else if (tags == null) {
+          return highlight.post_tags;
+        }
+
+        if (isString(tags)) {
+          addOption(oField, 'post_tags', [tags]);
+        } else if (isArray(tags)) {
+          addOption(oField, 'post_tags', tags);
+        }
+
+        return this;
+      },
+
+      /**
+            Sets the order of highlight fragments.  You can apply the option
+            to a specific field by passing the field name in to the
+            <code>oField</code> parameter.  Valid values for order are:
+
+            score - the score calculated by Lucene's highlighting framework.
+
+            @member ejs.Highlight
+            @param {String} o The order.  Currently only "score".
+            @param {String} oField An optional field name
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      order: function (o, oField) {
+        if (o === null && oField != null) {
+          return highlight.fields[oField].order;
+        } else if (o == null) {
+          return highlight.order;
+        }
+
+        o = o.toLowerCase();
+        if (o === 'score') {
+          addOption(oField, 'order', o);
+        }
+
+        return this;
+      },
+
+      /**
+            Sets the schema to be used for the tags. Valid values are:
+
+            styled - 10 <em> pre tags with css class of hltN, where N is 1-10
+
+            @member ejs.Highlight
+            @param {String} s The schema.  Currently only "styled".
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      tagsSchema: function (s) {
+        if (s == null) {
+          return highlight.tags_schema;
+        }
+
+        s = s.toLowerCase();
+        if (s === 'styled') {
+          highlight.tags_schema = s;
+        }
+
+        return this;
+      },
+
+      /**
+            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 <code>oField</code> parameter.  Defaults to false.
+
+            @member ejs.Highlight
+            @param {Boolean} trueFalse If filtered docs should be highlighted.
+            @param {String} oField An optional field name
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      highlightFilter: function (trueFalse, oField) {
+        if (trueFalse === null && oField != null) {
+          return highlight.fields[oField].highlight_filter;
+        } else if (trueFalse == null) {
+          return highlight.highlight_filter;
+        }
+
+        addOption(oField, 'highlight_filter', trueFalse);
+        return this;
+      },
+
+      /**
+            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 <code>oField</code> parameter. Default:  100
+
+            @member ejs.Highlight
+            @param {Integer} size The fragment size in characters.
+            @param {String} oField An optional field name
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      fragmentSize: function (size, oField) {
+        if (size === null && oField != null) {
+          return highlight.fields[oField].fragment_size;
+        } else if (size == null) {
+          return highlight.fragment_size;
+        }
+
+        addOption(oField, 'fragment_size', size);
+        return this;
+      },
+
+      /**
+            Sets the number of highlight fragments.
+            You can apply the option to a specific field by passing the field
+            name in to the <code>oField</code> parameter. Default:  5
+
+            @member ejs.Highlight
+            @param {Integer} cnt The fragment size in characters.
+            @param {String} oField An optional field name
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      numberOfFragments: function (cnt, oField) {
+        if (cnt === null && oField != null) {
+          return highlight.fields[oField].number_of_fragments;
+        } else if (cnt == null) {
+          return highlight.number_of_fragments;
+        }
+
+        addOption(oField, 'number_of_fragments', cnt);
+        return this;
+      },
+
+      /**
+            Sets highlight encoder.  Valid values are:
+
+            default - the default, no encoding
+            html - to encode html characters if you use html tags
+
+            @member ejs.Highlight
+            @param {String} e The encoder.  default or html
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      encoder: function (e) {
+        if (e == null) {
+          return highlight.encoder;
+        }
+
+        e = e.toLowerCase();
+        if (e === 'default' || e === 'html') {
+          highlight.encoder = e;
+        }
+
+        return this;
+      },
+
+      /**
+            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 <code>oField</code>
+            parameter.  Defaults to false.
+
+            @member ejs.Highlight
+            @param {Boolean} trueFalse If filtered docs should be highlighted.
+            @param {String} oField An optional field name
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      requireFieldMatch: function (trueFalse, oField) {
+        if (trueFalse === null && oField != null) {
+          return highlight.fields[oField].require_field_match;
+        } else if (trueFalse == null) {
+          return highlight.require_field_match;
+        }
+
+        addOption(oField, 'require_field_match', trueFalse);
+        return this;
+      },
+
+      /**
+            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
+            <code>oField</code> parameter. Default:  20
+
+            @member ejs.Highlight
+            @param {Integer} cnt The max characters to scan.
+            @param {String} oField An optional field name
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      boundaryMaxScan: function (cnt, oField) {
+        if (cnt === null && oField != null) {
+          return highlight.fields[oField].boundary_max_scan;
+        } else if (cnt == null) {
+          return highlight.boundary_max_scan;
+        }
+
+        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 <code>oField</code> 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 <code>this</code> 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
+            <code>oField</code> 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 <code>this</code> 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
+            <code>oField</code> 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 <code>this</code> 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 <code>this</code> 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 <code>script</code> 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
+    <p>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.</p>
+
+    @name ejs.IndexedShape
+    @ejs geo
+
+    @desc
+    <p>Defines a shape that already exists in an index/type.</p>
+
+    @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 <code>this</code> 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 <code>this</code> 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 <code>this</code> 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 <code>this</code> 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 <code>script</code> 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
+    <p>The <code>Request</code> object provides methods generating an elasticsearch request body.</p>
+
+    @name ejs.Request
+    @ejs request
+
+    @desc
+    <p>Provides methods for generating request bodies.</p>
+
+    @param {Object} conf 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
+    */
+  ejs.Request = function () {
+
+    /**
+        The internal query object.
+        @member ejs.Request
+        @property {Object} query
+        */
+    var query = {};
+
+    return {
+
+      /**
+            <p>Sets the sorting for the query.  This accepts many input formats.</p>
+
+            <dl>
+                <dd><code>sort()</code> - The current sorting values are returned.</dd>
+                <dd><code>sort(fieldName)</code> - Adds the field to the current list of sorting values.</dd>
+                <dd><code>sort(fieldName, order)</code> - Adds the field to the current list of
+                    sorting with the specified order.  Order must be asc or desc.</dd>
+                <dd><code>sort(ejs.Sort)</code> - Adds the Sort value to the current list of sorting values.</dd>
+                <dd><code>sort(array)</code> - Replaces all current sorting values with values
+                    from the array.  The array must contain only strings and Sort objects.</dd>
+            </dl>
+
+            <p>Multi-level sorting is supported so the order in which sort fields
+            are added to the query requests is relevant.</p>
+
+            <p>It is recommended to use <code>Sort</code> objects when possible.</p>
+
+            @member ejs.Request
+            @param {String} fieldName The field to be sorted by.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      sort: function () {
+        var i, len;
+
+        if (!has(query, "sort")) {
+          query.sort = [];
+        }
+
+        if (arguments.length === 0) {
+          return query.sort;
+        }
+
+        // if passed a single argument
+        if (arguments.length === 1) {
+          var sortVal = arguments[0];
+
+          if (isString(sortVal)) {
+            // add  a single field name
+            query.sort.push(sortVal);
+          } else if (isSort(sortVal)) {
+            // add the Sort object
+            query.sort.push(sortVal.toJSON());
+          } else if (isArray(sortVal)) {
+            // replace with all values in the array
+            // the values must be a fieldName (string) or a
+            // Sort object.  Any other type throws an Error.
+            query.sort = [];
+            for (i = 0, len = sortVal.length; i < len; i++) {
+              if (isString(sortVal[i])) {
+                query.sort.push(sortVal[i]);
+              } else if (isSort(sortVal[i])) {
+                query.sort.push(sortVal[i].toJSON());
+              } else {
+                throw new TypeError('Invalid object in array');
+              }
+            }
+          } else {
+            // Invalid object type as argument.
+            throw new TypeError('Argument must be string, Sort, or array');
+          }
+        } else if (arguments.length === 2) {
+          // handle the case where a single field name and order are passed
+          var field = arguments[0],
+            order = arguments[1];
+
+          if (isString(field) && isString(order)) {
+            order = order.toLowerCase();
+            if (order === 'asc' || order === 'desc') {
+              var sortObj = {};
+              sortObj[field] = {order: order};
+              query.sort.push(sortObj);
+            }
+          }
+        }
+
+        return this;
+      },
+
+      /**
+           Enables score computation and tracking during sorting.  Be default,
+           when sorting scores are not computed.
+
+            @member ejs.Request
+            @param {Boolean} trueFalse If scores should be computed and tracked.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      trackScores: function (trueFalse) {
+        if (trueFalse == null) {
+          return query.track_scores;
+        }
+
+        query.track_scores = trueFalse;
+        return this;
+      },
+
+      /**
+            A search result set could be very large (think Google). Setting the
+            <code>from</code> parameter allows you to page through the result set
+            by making multiple request. This parameters specifies the starting
+            result/document number point. Combine with <code>size()</code> to achieve paging.
+
+            @member ejs.Request
+            @param {Array} f The offset at which to start fetching results/documents from the result set.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      from: function (f) {
+        if (f == null) {
+          return query.from;
+        }
+
+        query.from = f;
+        return this;
+      },
+
+      /**
+            Sets the number of results/documents to be returned. This is set on a per page basis.
+
+            @member ejs.Request
+            @param {Integer} s The number of results that are to be returned by the search.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      size: function (s) {
+        if (s == null) {
+          return query.size;
+        }
+
+        query.size = s;
+        return this;
+      },
+
+      /**
+            A timeout, bounding the request to be executed within the
+            specified time value and bail when expired. Defaults to no timeout.
+
+            <p>This option is valid during the following operations:
+                <code>search</code> and <code>delete by query</code></p>
+
+            @member ejs.Request
+            @param {Long} t The timeout value in milliseconds.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      timeout: function (t) {
+        if (t == null) {
+          return query.timeout;
+        }
+
+        query.timeout = t;
+        return this;
+      },
+
+
+      /**
+            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.
+
+            @member ejs.Request
+            @param {(String|String[])} s The field as a string or fields as array
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      fields: function (fieldList) {
+        if (fieldList == null) {
+          return query.fields;
+        }
+
+        if (query.fields == null) {
+          query.fields = [];
+        }
+
+        if (isString(fieldList)) {
+          query.fields.push(fieldList);
+        } else if (isArray(fieldList)) {
+          query.fields = fieldList;
+        } else {
+          throw new TypeError('Argument must be a string or an array');
+        }
+
+        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.Request
+            @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 <code>this</code> so that calls can be chained.
+            */
+      source: function (includes, excludes) {
+        if (includes == null && excludes == null) {
+          return query._source;
+        }
+
+        if (!isArray(includes) && !isString(includes) && !isBoolean(includes)) {
+          throw new TypeError('Argument includes must be a string, an array, or a boolean');
+        }
+
+        if (excludes != null && !isArray(excludes) && !isString(excludes)) {
+          throw new TypeError('Argument excludes must be a string or an array');
+        }
+
+        if (isBoolean(includes)) {
+          query._source = includes;
+        } else {
+          query._source = {
+            includes: includes
+          };
+
+          if (excludes != null) {
+            query._source.excludes = excludes;
+          }
+        }
+
+        return this;
+      },
+
+      /**
+            Once a query executes, you can use rescore to run a secondary, more
+            expensive query to re-order the results.
+
+            @member ejs.Request
+            @param {Rescore} r The rescore configuration.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      rescore: function (r) {
+        if (r == null) {
+          return query.rescore;
+        }
+
+        if (!isRescore(r)) {
+          throw new TypeError('Argument must be a Rescore');
+        }
+
+        query.rescore = r.toJSON();
+
+        return this;
+      },
+
+      /**
+            Allows you to set the specified query on this search object. This is the
+            query that will be used when the search is executed.
+
+            @member ejs.Request
+            @param {Query} someQuery Any valid <code>Query</code> object.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      query: function (someQuery) {
+        if (someQuery == null) {
+          return query.query;
+        }
+
+        if (!isQuery(someQuery)) {
+          throw new TypeError('Argument must be a Query');
+        }
+
+        query.query = someQuery.toJSON();
+        return this;
+      },
+
+      /**
+            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.
+
+            @member ejs.Request
+            @param {Facet} facet Any valid <code>Facet</code> object.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      facet: function (facet) {
+        if (facet == null) {
+          return query.facets;
+        }
+
+        if (query.facets == null) {
+          query.facets = {};
+        }
+
+        if (!isFacet(facet)) {
+          throw new TypeError('Argument must be a Facet');
+        }
+
+        extend(query.facets, facet.toJSON());
+
+        return this;
+      },
+
+      /**
+      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.
+
+      @member ejs.Request
+      @param {Aggregation} agg Any valid <code>Aggregation</code> object.
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      aggregation: function(agg) {
+        if (agg == null) {
+          return query.aggs;
+        }
+
+        if (query.aggs == null) {
+          query.aggs = {};
+        }
+
+        if (!isAggregation(agg)) {
+          throw new TypeError('Argument must be an Aggregation');
+        }
+
+        extend(query.aggs, agg.toJSON());
+
+        return this;
+      },
+
+      /**
+      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.
+
+      @member ejs.Request
+      @param {Aggregation} agg Any valid <code>Aggregation</code> object.
+      @returns {Object} returns <code>this</code> so that calls can be chained.
+      */
+      agg: function(agg) {
+        return this.aggregation(agg);
+      },
+
+      /**
+            Allows you to set a specified filter on this request object.
+
+            @member ejs.Request
+            @param {Object} filter Any valid <code>Filter</code> object.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      filter: function (filter) {
+        if (filter == null) {
+          return query.filter;
+        }
+
+        if (!isFilter(filter)) {
+          throw new TypeError('Argument must be a Filter');
+        }
+
+        query.filter = filter.toJSON();
+        return this;
+      },
+
+      /**
+            Allows you to set a specified post_filter on this request object.
+
+            @member ejs.Request
+            @param {Object} filter Any valid <code>Filter</code> object.
+            @returns {Object} returns <code>this</code> 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 <code>Highlight</code>
+            settings.
+
+            @member ejs.Request
+            @param {Highlight} h A valid Highlight object
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      highlight: function (h) {
+        if (h == null) {
+          return query.highlight;
+        }
+
+        if (!isHighlight(h)) {
+          throw new TypeError('Argument must be a Highlight object');
+        }
+
+        query.highlight = h.toJSON();
+        return this;
+      },
+
+      /**
+            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 <code>Suggest</code> object.
+
+            @since elasticsearch 0.90
+
+            @member ejs.Request
+            @param {(String|Suggest)} s A valid Suggest object or a String to
+              set as the global suggest text.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      suggest: function (s) {
+        if (s == null) {
+          return query.suggest;
+        }
+
+        if (query.suggest == null) {
+          query.suggest = {};
+        }
+
+        if (isString(s)) {
+          query.suggest.text = s;
+        } else if (isSuggest(s)) {
+          extend(query.suggest, s.toJSON());
+        } else {
+          throw new TypeError('Argument must be a string or Suggest object');
+        }
+
+        return this;
+      },
+
+      /**
+            Computes a document property dynamically based on the supplied <code>ScriptField</code>.
+
+            @member ejs.Request
+            @param {ScriptField} oScriptField A valid <code>ScriptField</code>.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      scriptField: function (oScriptField) {
+        if (oScriptField == null) {
+          return query.script_fields;
+        }
+
+        if (query.script_fields == null) {
+          query.script_fields = {};
+        }
+
+        if (!isScriptField(oScriptField)) {
+          throw new TypeError('Argument must be a ScriptField');
+        }
+
+        extend(query.script_fields, oScriptField.toJSON());
+        return this;
+      },
+
+      /**
+            Boosts hits in the specified index by the given boost value.
+
+            @member ejs.Request
+            @param {String} index the index to boost
+            @param {Double} boost the boost value
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      indexBoost: function (index, boost) {
+        if (query.indices_boost == null) {
+          query.indices_boost = {};
+        }
+
+        if (arguments.length === 0) {
+          return query.indices_boost;
+        }
+
+        query.indices_boost[index] = boost;
+        return this;
+      },
+
+      /**
+            Enable/Disable explanation of score for each search result.
+
+            @member ejs.Request
+            @param {Boolean} trueFalse true to enable, false to disable
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      explain: function (trueFalse) {
+        if (trueFalse == null) {
+          return query.explain;
+        }
+
+        query.explain = trueFalse;
+        return this;
+      },
+
+      /**
+            Enable/Disable returning version number for each search result.
+
+            @member ejs.Request
+            @param {Boolean} trueFalse true to enable, false to disable
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      version: function (trueFalse) {
+        if (trueFalse == null) {
+          return query.version;
+        }
+
+        query.version = trueFalse;
+        return this;
+      },
+
+      /**
+            Filters out search results will scores less than the specified minimum score.
+
+            @member ejs.Request
+            @param {Double} min a positive <code>double</code> value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      minScore: function (min) {
+        if (min == null) {
+          return query.min_score;
+        }
+
+        query.min_score = min;
+        return this;
+      },
+
+      /**
+            The type of ejs object.  For internal use only.
+
+            @member ejs.Request
+            @returns {String} the type of object
+            */
+      _type: function () {
+        return 'request';
+      },
+
+      /**
+            Retrieves the internal <code>query</code> object. This is typically used by
+            internal API functions so use with caution.
+
+            @member ejs.Request
+            @returns {String} returns this object's internal object representation.
+            */
+      toJSON: function () {
+        return query;
+      }
+
+    };
+  };
+
+  /**
+    @class
+    <p>A method that allows to rescore queries with a typically more expensive.</p>
+
+    @name ejs.Rescore
+    @ejs request
+
+    @desc
+    <p>Defines an operation that rescores a query with another query.</p>
+
+    @param {Number} windowSize The optional number of documents to reorder per shard.
+    @param {Query} windowSize The optional query to use for rescoring.
+
+    */
+  ejs.Rescore = function (windowSize, qry) {
+
+    if (windowSize != null && !isNumber(windowSize)) {
+      throw new TypeError('Argument must be a Number');
+    }
+    
+    if (qry != null && !isQuery(qry)) {
+      throw new TypeError('Argument must be a Query');
+    }
+    
+    var rescore = {
+      query: {}
+    };
+
+    if (windowSize != null) {
+      rescore.window_size = windowSize;
+    }
+    
+    if (qry != null) {
+      rescore.query.rescore_query = qry.toJSON();
+    }
+    
+    return {
+
+      /**
+            Sets the query used by the rescoring.
+
+            @member ejs.Rescore
+            @param {Query} someQuery a valid query.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      rescoreQuery: function (someQuery) {
+        if (someQuery == null) {
+          return rescore.query.rescore_query;
+        }
+
+        if (!isQuery(someQuery)) {
+          throw new TypeError('Argument must be a Query');
+        }
+
+        rescore.query.rescore_query = someQuery.toJSON();
+        return this;
+      },
+
+      /**
+            Sets the weight assigned to the original query of the rescoring.
+
+            @member ejs.Rescore
+            @param {Number} weight a valid query weight.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      queryWeight: function (weight) {
+        if (weight == null) {
+          return rescore.query.query_weight;
+        }
+
+        if (!isNumber(weight)) {
+          throw new TypeError('Argument must be a Number');
+        }
+
+        rescore.query.query_weight = weight;
+        return this;
+      },
+
+      /**
+            Sets the weight assigned to the query used to rescore the original query.
+
+            @member ejs.Rescore
+            @param {Number} weight a valid rescore query weight.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      rescoreQueryWeight: function (weight) {
+        if (weight == null) {
+          return rescore.query.rescore_query_weight;
+        }
+
+        if (!isNumber(weight)) {
+          throw new TypeError('Argument must be a Number');
+        }
+
+        rescore.query.rescore_query_weight = weight;
+        return this;
+      },
+
+      /**
+            Sets the window_size parameter of the rescoring.
+
+            @member ejs.Rescore
+            @param {Number} size a valid window size.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      windowSize: function (size) {
+        if (size == null) {
+          return rescore.window_size;
+        }
+
+        if (!isNumber(size)) {
+          throw new TypeError('Argument must be a Number');
+        }
+
+        rescore.window_size = size;
+        return this;
+      },
+
+      /**
+            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
+
+            @member ejs.Rescore
+            @param {String} s The score mode as a string.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      scoreMode: function (s) {
+        if (s == null) {
+          return rescore.query.score_mode;
+        }
+    
+        s = s.toLowerCase();
+        if (s === 'total' || s === 'min' || s === 'max' || s === 'multiply' || 
+          s === 'avg') {
+          rescore.query.score_mode = s;
+        }
+        
+        return this;
+      },
+
+      /**
+            The type of ejs object.  For internal use only.
+
+            @member ejs.Rescore
+            @returns {String} the type of object
+            */
+      _type: function () {
+        return 'rescore';
+      },
+
+      /**
+            Retrieves the internal <code>script</code> object. This is typically used by
+            internal API functions so use with caution.
+
+            @member ejs.Rescore
+            @returns {String} returns this object's internal object representation.
+            */
+      toJSON: function () {
+        return rescore;
+      }
+    };
+  };
+  /**
+    @class
+    <p>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
+    <code>price</code> and <code>quantity</code>. At query time, you could define a computed
+    property that dynamically creates a new field called <code>total</code>in each document
+    based on the calculation <code>price * quantity</code>.</p>
+
+    @name ejs.ScriptField
+    @ejs request
+
+    @desc
+    <p>Computes dynamic document properties based on information from other fields.</p>
+
+    @param {String} fieldName A name of the script field to create.
+
+    */
+  ejs.ScriptField = function (fieldName) {
+    var script = {};
+
+    script[fieldName] = {};
+
+    return {
+
+      /**
+            The script language being used. Currently supported values are
+            <code>javascript</code> and <code>mvel</code>.
+
+            @member ejs.ScriptField
+            @param {String} language The language of the script.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      lang: function (language) {
+        if (language == null) {
+          return script[fieldName].lang;
+        }
+      
+        script[fieldName].lang = language;
+        return this;
+      },
+
+      /**
+            Sets the script/code that will be used to perform the calculation.
+
+            @member ejs.ScriptField
+            @param {String} expression The script/code to use.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      script: function (expression) {
+        if (expression == null) {
+          return script[fieldName].script;
+        }
+      
+        script[fieldName].script = expression;
+        return this;
+      },
+
+      /**
+            Allows you to set script parameters to be used during the execution of the script.
+
+            @member ejs.ScriptField
+            @param {Object} oParams An object containing key/value pairs representing param name/value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      params: function (oParams) {
+        if (oParams == null) {
+          return script[fieldName].params;
+        }
+      
+        script[fieldName].params = oParams;
+        return this;
+      },
+
+      /**
+            If execeptions thrown from the script should be ignored or not.
+            Default: false
+
+            @member ejs.ScriptField
+            @param {Boolean} trueFalse if execptions should be ignored
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      ignoreFailure: function (trueFalse) {
+        if (trueFalse == null) {
+          return script[fieldName].ignore_failure;
+        }
+        
+        script[fieldName].ignore_failure = trueFalse;
+        return this;
+      },
+
+      /**
+            The type of ejs object.  For internal use only.
+            
+            @member ejs.ScriptField
+            @returns {String} the type of object
+            */
+      _type: function () {
+        return 'script field';
+      },
+      
+      /**
+            Retrieves the internal <code>script</code> object. This is typically used by
+            internal API functions so use with caution.
+
+            @member ejs.ScriptField
+            @returns {String} returns this object's internal <code>facet</code> property.
+            */
+      toJSON: function () {
+        return script;
+      }
+    };
+  };
+
+  /**
+    @class
+    <p>A Shape object that can be used in queries and filters that 
+    take a Shape.  Shape uses the GeoJSON format.</p>
+
+    <p>See http://www.geojson.org/</p>
+
+    @name ejs.Shape
+    @ejs geo
+
+    @desc
+    <p>Defines a shape</p>
+
+    @param {String} type A valid shape type.
+    @param {Array} coords An valid coordinat definition for the given shape.
+
+    */
+  ejs.Shape = function (type, coords) {
+  
+    var 
+      shape = {},
+      validType = function (t) {
+        var valid = false;
+        if (t === 'point' || t === 'linestring' || t === 'polygon' || 
+          t === 'multipoint' || t === 'envelope' || t === 'multipolygon' ||
+          t === 'circle' || t === 'multilinestring') {
+          valid = true;
+        }
+
+        return valid;
+      };
+    
+    type = type.toLowerCase();
+    if (validType(type)) {
+      shape.type = type;
+      shape.coordinates = coords;
+    }  
+  
+    return {
+
+      /**
+            Sets the shape type.  Can be set to one of:  point, linestring, polygon,
+            multipoint, envelope, or multipolygon.
+
+            @member ejs.Shape
+            @param {String} t a valid shape type.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      type: function (t) {
+        if (t == null) {
+          return shape.type;
+        }
+      
+        t = t.toLowerCase();
+        if (validType(t)) {
+          shape.type = t;
+        }
+      
+        return this;
+      },
+
+      /**
+            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.
+
+            @member ejs.Shape
+            @param {Array} c a valid coordinates definition for the shape.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      coordinates: function (c) {
+        if (c == null) {
+          return shape.coordinates;
+        }
+
+        shape.coordinates = c;
+        return this;
+      },
+      
+      /**
+            Sets the radius for parsing a circle <code>Shape</code>.
+
+            @member ejs.Shape
+            @param {String} r a valid radius value for a circle.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      radius: function (r) {
+        if (r == null) {
+          return shape.radius;
+        }
+        
+        shape.radius = r;
+        return this;
+      },
+
+      /**
+            The type of ejs object.  For internal use only.
+            
+            @member ejs.Shape
+            @returns {String} the type of object
+            */
+      _type: function () {
+        return 'shape';
+      },
+      
+      /**
+            Retrieves the internal <code>script</code> object. This is typically used by
+            internal API functions so use with caution.
+
+            @member ejs.Shape
+            @returns {String} returns this object's internal object representation.
+            */
+      toJSON: function () {
+        return shape;
+      }
+    };
+  };
+
+  /**
+    @class
+    <p>A Sort object that can be used in on the Request object to specify 
+    various types of sorting.</p>
+
+    <p>See http://www.elasticsearch.org/guide/reference/api/search/sort.html</p>
+
+    @name ejs.Sort
+    @ejs request
+
+    @desc
+    <p>Defines a sort value</p>
+
+    @param {String} fieldName The fieldName to sort against.  Defaults to _score
+      if not specified.
+    */
+  ejs.Sort = function (fieldName) {
+
+    // default to sorting against the documents score.
+    if (fieldName == null) {
+      fieldName = '_score';
+    }
+  
+    var sort = {},
+      key = fieldName, // defaults to field search
+      geo_key = '_geo_distance', // used when doing geo distance sort
+      script_key = '_script'; // used when doing script sort
+    
+    // defaults to a field sort
+    sort[key] = {};
+
+    return {
+
+      /**
+            Set's the field to sort on
+
+            @member ejs.Sort
+            @param {String} f The name of a field 
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      field: function (f) {
+        var oldValue = sort[key];
+      
+        if (f == null) {
+          return fieldName;
+        }
+    
+        delete sort[key];      
+        fieldName = f;
+        key = f;
+        sort[key] = oldValue;
+      
+        return this;
+      },
+
+      /**
+            Enables sorting based on a distance from a GeoPoint
+
+            @member ejs.Sort
+            @param {GeoPoint} point A valid GeoPoint object
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      geoDistance: function (point) {
+        var oldValue = sort[key];
+      
+        if (point == null) {
+          return sort[key][fieldName];
+        }
+    
+        if (!isGeoPoint(point)) {
+          throw new TypeError('Argument must be a GeoPoint');
+        }
+      
+        delete sort[key];
+        key = geo_key;
+        sort[key] = oldValue;
+        sort[key][fieldName] = point.toJSON();
+      
+        return this;
+      },
+    
+      /**
+            Enables sorting based on a script.
+
+            @member ejs.Sort
+            @param {String} scriptCode The script code as a string
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      script: function (scriptCode) {
+        var oldValue = sort[key];
+      
+        if (scriptCode == null) {
+          return sort[key].script;
+        }
+      
+        delete sort[key];
+        key = script_key;
+        sort[key] = oldValue;
+        sort[key].script = scriptCode;
+      
+        return this;
+      },
+    
+      /**
+            Sets the sort order.  Valid values are:
+          
+            asc - for ascending order
+            desc - for descending order
+
+            Valid during sort types:  field, geo distance, and script
+          
+            @member ejs.Sort
+            @param {String} o The sort order as a string, asc or desc.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      order: function (o) {
+        if (o == null) {
+          return sort[key].order;
+        }
+    
+        o = o.toLowerCase();
+        if (o === 'asc' || o === 'desc') {
+          sort[key].order = o;  
+        }
+      
+        return this;
+      },
+    
+      /**
+            Sets the sort order to ascending (asc).  Same as calling
+            <code>order('asc')</code>.
+          
+            @member ejs.Sort
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      asc: function () {
+        sort[key].order = 'asc';
+        return this;
+      },
+      
+      /**
+            Sets the sort order to descending (desc).  Same as calling
+            <code>order('desc')</code>.
+          
+            @member ejs.Sort
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      desc: function () {
+        sort[key].order = 'desc';
+        return this;
+      },
+      
+      /**
+            Sets the order with a boolean value.  
+          
+            true = descending sort order
+            false = ascending sort order
+
+            Valid during sort types:  field, geo distance, and script
+          
+            @member ejs.Sort
+            @param {Boolean} trueFalse If sort should be in reverse order.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      reverse: function (trueFalse) {
+        if (trueFalse == null) {
+          return sort[key].reverse;
+        }
+    
+        sort[key].reverse = trueFalse;  
+        return this;
+      },
+    
+      /**
+            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
+          
+            @member ejs.Sort
+            @param {String} m The value to use for documents with the field missing.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      missing: function (m) {
+        if (m == null) {
+          return sort[key].missing;
+        }
+    
+        sort[key].missing = m;  
+        return this;
+      },
+    
+      /**
+            Sets if the sort should ignore unmapped fields vs throwing an error.
+
+            Valid during sort types:  field
+          
+            @member ejs.Sort
+            @param {Boolean} trueFalse If sort should ignore unmapped fields.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      ignoreUnmapped: function (trueFalse) {
+        if (trueFalse == null) {
+          return sort[key].ignore_unmapped;
+        }
+    
+        sort[key].ignore_unmapped = trueFalse;  
+        return this;
+      },
+    
+      /**
+             Sets the distance unit.  Valid values are "mi" for miles or "km"
+             for kilometers. Defaults to "km".
+
+             Valid during sort types:  geo distance
+           
+             @member ejs.Sort
+             @param {Number} unit the unit of distance measure.
+             @returns {Object} returns <code>this</code> so that calls can be chained.
+             */
+      unit: function (unit) {
+        if (unit == null) {
+          return sort[key].unit;
+        }
+    
+        unit = unit.toLowerCase();
+        if (unit === 'mi' || unit === 'km') {
+          sort[key].unit = unit;
+        }
+      
+        return this;
+      },
+    
+      /**
+            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
+          
+            @member ejs.Sort
+            @param {String} trueFalse True if the coordinates should be normalized. False otherwise.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      normalize: function (trueFalse) {
+        if (trueFalse == null) {
+          return sort[key].normalize;
+        }
+
+        sort[key].normalize = trueFalse;
+        return this;
+      },
+    
+      /**
+            How to compute the distance. Can either be arc (better precision) 
+            or plane (faster). Defaults to arc.
+
+            Valid during sort types:  geo distance
+          
+            @member ejs.Sort
+            @param {String} type The execution type as a string.  
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      distanceType: function (type) {
+        if (type == null) {
+          return sort[key].distance_type;
+        }
+
+        type = type.toLowerCase();
+        if (type === 'arc' || type === 'plane') {
+          sort[key].distance_type = type;
+        }
+      
+        return this;
+      },
+    
+      /**
+            Sets parameters that will be applied to the script.  Overwrites 
+            any existing params.
+
+            Valid during sort types:  script
+          
+            @member ejs.Sort
+            @param {Object} p An object where the keys are the parameter name and 
+              values are the parameter value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      params: function (p) {
+        if (p == null) {
+          return sort[key].params;
+        }
+  
+        sort[key].params = p;
+        return this;
+      },
+  
+      /**
+            Sets the script language.
+
+            Valid during sort types:  script
+          
+            @member ejs.Sort
+            @param {String} lang The script language, default mvel.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      lang: function (lang) {
+        if (lang == null) {
+          return sort[key].lang;
+        }
+
+        sort[key].lang = lang;
+        return this;
+      },
+    
+      /**
+            Sets the script sort type.  Valid values are:
+          
+            <dl>
+                <dd><code>string</code> - script return value is sorted as a string</dd>
+                <dd><code>number</code> - script return value is sorted as a number</dd>
+            <dl>
+
+            Valid during sort types:  script
+          
+            @member ejs.Sort
+            @param {String} type The sort type.  Either string or number.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      type: function (type) {
+        if (type == null) {
+          return sort[key].type;
+        }
+
+        type = type.toLowerCase();
+        if (type === 'string' || type === 'number') {
+          sort[key].type = type;
+        }
+      
+        return this;
+      },
+
+      /**
+            Sets the sort mode.  Valid values are:
+          
+            <dl>
+                <dd><code>min</code> - sort by lowest value</dd>
+                <dd><code>max</code> - sort by highest value</dd>
+                <dd><code>sum</code> - sort by the sum of all values</dd>
+                <dd><code>avg</code> - sort by the average of all values</dd>
+            <dl>
+            
+            Valid during sort types:  field, geo distance
+          
+            @since elasticsearch 0.90
+            @member ejs.Sort
+            @param {String} m The sort mode.  Either min, max, sum, or avg.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      mode: function (m) {
+        if (m == null) {
+          return sort[key].mode;
+        }
+
+        m = m.toLowerCase();
+        if (m === 'min' || m === 'max' || m === 'sum' || m === 'avg') {
+          sort[key].mode = m;
+        }
+      
+        return this;
+      },
+      
+      /**
+            Sets the path of the nested object.
+
+            Valid during sort types:  field, geo distance
+          
+            @since elasticsearch 0.90
+            @member ejs.Sort
+            @param {String} path The nested path value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      nestedPath: function (path) {
+        if (path == null) {
+          return sort[key].nested_path;
+        }
+
+        sort[key].nested_path = path;
+        return this;
+      },
+      
+      /**
+            <p>Allows you to set a filter that nested objects must match
+            in order to be considered during sorting.</p>
+
+            Valid during sort types: field, geo distance
+            
+            @since elasticsearch 0.90
+            @member ejs.Sort
+            @param {Object} oFilter A valid <code>Filter</code> object.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      nestedFilter: function (oFilter) {
+        if (oFilter == null) {
+          return sort[key].nested_filter;
+        }
+      
+        if (!isFilter(oFilter)) {
+          throw new TypeError('Argument must be a Filter');
+        }
+        
+        sort[key].nested_filter = oFilter.toJSON();
+        return this;
+      },
+
+      /**
+            The type of ejs object.  For internal use only.
+          
+            @member ejs.Sort
+            @returns {String} the type of object
+            */
+      _type: function () {
+        return 'sort';
+      },
+    
+      /**
+            Retrieves the internal <code>script</code> object. This is typically used by
+            internal API functions so use with caution.
+
+            @member ejs.Sort
+            @returns {String} returns this object's internal object representation.
+            */
+      toJSON: function () {
+        return sort;
+      }
+    };
+  };
+
+  /**
+    @class
+    @suggester
+    <p>The completion suggester is a so-called prefix suggester. It does not do spell 
+    correction like the term or phrase suggesters but allows basic auto-complete functionality.</p>
+
+    @name ejs.CompletionSuggester
+    @ejs suggest
+    @borrows ejs.SuggesterMixin.text as text
+    @borrows ejs.SuggesterMixin._type as _type
+    @borrows ejs.SuggesterMixin.toJSON as toJSON
+    @borrows ejs.SuggestContextMixin.analyzer as analyzer
+    @borrows ejs.SuggestContextMixin.field as field
+    @borrows ejs.SuggestContextMixin.size as size
+    @borrows ejs.SuggestContextMixin.shardSize as shardSize
+  
+    @since elasticsearch 0.90.4
+  
+    @desc
+    <p>A suggester that allows basic auto-complete functionality.</p>
+
+    @param {String} name The name which be used to refer to this suggester.
+    */
+  ejs.CompletionSuggester = function (name) {
+
+    var
+      _context,
+      _common = ejs.SuggesterMixin(name),
+      suggest = _common.toJSON();
+    
+    suggest[name].completion = {};
+    _context = ejs.SuggestContextMixin(suggest[name].completion);
+  
+    return extend(_common, _context, {
+    
+      /**
+            <p>Enable fuzzy completions which means a can spell a word
+            incorrectly and still get a suggestion.</p>
+
+            @member ejs.CompletionSuggester
+            @param {Boolean} trueFalse true to enable fuzzy completions, false to disable.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      fuzzy: function (trueFalse) {
+        if (trueFalse == null) {
+          return suggest[name].completion.fuzzy;
+        }
+      
+        if (trueFalse && suggest[name].completion.fuzzy == null) {
+          suggest[name].completion.fuzzy = {};
+        } else if (!trueFalse && suggest[name].completion.fuzzy != null) {
+          delete suggest[name].completion.fuzzy;
+        }
+      
+        return this;
+      },
+    
+      /**
+            <p>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.</p>
+
+            @member ejs.CompletionSuggester
+            @param {Boolean} trueFalse true to enable transpositions.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      transpositions: function (trueFalse) {
+        if (suggest[name].completion.fuzzy == null) {
+          suggest[name].completion.fuzzy = {};
+        }
+      
+        if (trueFalse == null) {
+          return suggest[name].completion.fuzzy.transpositions;
+        }
+      
+        suggest[name].completion.fuzzy.transpositions = trueFalse;
+        return this;
+      },
+    
+      /**
+            <p>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.</p>
+
+            @member ejs.CompletionSuggester
+            @param {Boolean} trueFalse true to set unicode aware, false to disable.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      unicodeAware: function (trueFalse) {
+        if (suggest[name].completion.fuzzy == null) {
+          suggest[name].completion.fuzzy = {};
+        }
+      
+        if (trueFalse == null) {
+          return suggest[name].completion.fuzzy.unicode_aware;
+        }
+      
+        suggest[name].completion.fuzzy.unicode_aware = trueFalse;
+        return this;
+      },
+    
+      /**
+            <p>Maximum edit distance (fuzziness), defaults to 1.  Automatically 
+            enables fuzzy suggestions when set to any value.</p>
+
+            @member ejs.CompletionSuggester
+            @param {Integer} d A positive integer value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      editDistance: function (d) {
+        if (suggest[name].completion.fuzzy == null) {
+          suggest[name].completion.fuzzy = {};
+        }
+      
+        if (d == null) {
+          return suggest[name].completion.fuzzy.edit_distance;
+        }
+      
+        suggest[name].completion.fuzzy.edit_distance = d;
+        return this;
+      },
+    
+      /**
+            <p>Minimum length of the input before fuzzy suggestions are returned, defaults 
+            to 3.  Automatically enables fuzzy suggestions when set to any value.</p>
+
+            @member ejs.CompletionSuggester
+            @param {Integer} m A positive integer value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      minLength: function (m) {
+        if (suggest[name].completion.fuzzy == null) {
+          suggest[name].completion.fuzzy = {};
+        }
+      
+        if (m == null) {
+          return suggest[name].completion.fuzzy.min_length;
+        }
+      
+        suggest[name].completion.fuzzy.min_length = m;
+        return this;
+      },
+    
+      /**
+            <p>Minimum length of the input, which is not checked for fuzzy alternatives, defaults 
+            to 1.  Automatically enables fuzzy suggestions when set to any value.</p>
+
+            @member ejs.CompletionSuggester
+            @param {Integer} l A positive integer value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      prefixLength: function (l) {
+        if (suggest[name].completion.fuzzy == null) {
+          suggest[name].completion.fuzzy = {};
+        }
+      
+        if (l == null) {
+          return suggest[name].completion.fuzzy.prefix_length;
+        }
+      
+        suggest[name].completion.fuzzy.prefix_length = l;
+        return this;
+      }
+    
+    });
+  };
+
+  /**
+    @class
+    <p>DirectGenerator is a candidate generator for <code>PhraseSuggester</code>.
+    It generates terms based on edit distance and operators much like the
+    <code>TermSuggester</code>.</p>
+
+    @name ejs.DirectGenerator
+    @ejs suggest
+    @borrows ejs.DirectSettingsMixin.accuracy as accuracy
+    @borrows ejs.DirectSettingsMixin.suggestMode as suggestMode
+    @borrows ejs.DirectSettingsMixin.sort as sort
+    @borrows ejs.DirectSettingsMixin.stringDistance as stringDistance
+    @borrows ejs.DirectSettingsMixin.maxEdits as maxEdits
+    @borrows ejs.DirectSettingsMixin.maxInspections as maxInspections
+    @borrows ejs.DirectSettingsMixin.maxTermFreq as maxTermFreq
+    @borrows ejs.DirectSettingsMixin.prefixLength as prefixLength
+    @borrows ejs.DirectSettingsMixin.minWordLen as minWordLen
+    @borrows ejs.DirectSettingsMixin.minDocFreq as minDocFreq
+
+    @since elasticsearch 0.90
+  
+    @desc
+    <p>A candidate generator that generates terms based on edit distance.</p>
+  
+    */
+  ejs.DirectGenerator = function () {
+
+  
+    var
+  
+    generator = {},
+    _common = ejs.DirectSettingsMixin(generator);
+    
+    return extend(_common, {
+
+      /**
+            <p>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.</p>
+
+            @member ejs.DirectGenerator
+            @param {String} analyzer A valid analyzer name.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      preFilter: function (analyzer) {
+        if (analyzer == null) {
+          return generator.pre_filter;
+        }
+  
+        generator.pre_filter = analyzer;
+        return this;
+      },
+    
+      /**
+            <p>Sets an analyzer that is applied to each of the generated tokens 
+            before they are passed to the actual phrase scorer.</p>
+
+            @member ejs.DirectGenerator
+            @param {String} analyzer A valid analyzer name.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      postFilter: function (analyzer) {
+        if (analyzer == null) {
+          return generator.post_filter;
+        }
+  
+        generator.post_filter = analyzer;
+        return this;
+      },
+    
+      /**
+            <p>Sets the field used to generate suggestions from.</p>
+
+            @member ejs.DirectGenerator
+            @param {String} field A valid field name.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      field: function (field) {
+        if (field == null) {
+          return generator.field;
+        }
+  
+        generator.field = field;
+        return this;
+      },
+    
+      /**
+            <p>Sets the number of suggestions returned for each token.</p>
+
+            @member ejs.DirectGenerator
+            @param {Integer} s A positive integer value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      size: function (s) {
+        if (s == null) {
+          return generator.size;
+        }
+  
+        generator.size = s;
+        return this;
+      },
+
+      /**
+            The type of ejs object.  For internal use only.
+        
+            @member ejs.DirectGenerator
+            @returns {String} the type of object
+            */
+      _type: function () {
+        return 'generator';
+      },
+  
+      /**
+            <p>Retrieves the internal <code>generator</code> object. This is typically used by
+               internal API functions so use with caution.</p>
+
+            @member ejs.DirectGenerator
+            @returns {String} returns this object's internal <code>generator</code> property.
+            */
+      toJSON: function () {
+        return generator;
+      }
+    });
+  };
+
+  /**
+    @class
+    <p>PhraseSuggester extends the <code>PhraseSuggester</code> 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.</p>
+
+    @name ejs.PhraseSuggester
+    @ejs suggest
+    @borrows ejs.SuggesterMixin.text as text
+    @borrows ejs.SuggesterMixin._type as _type
+    @borrows ejs.SuggesterMixin.toJSON as toJSON
+    @borrows ejs.SuggestContextMixin.analyzer as analyzer
+    @borrows ejs.SuggestContextMixin.field as field
+    @borrows ejs.SuggestContextMixin.size as size
+    @borrows ejs.SuggestContextMixin.shardSize as shardSize
+
+    @since elasticsearch 0.90
+
+    @desc
+    <p>A suggester that suggests entire corrected phrases.</p>
+
+    @param {String} name The name which be used to refer to this suggester.
+    */
+  ejs.PhraseSuggester = function (name) {
+
+    var
+      _context,
+      _common = ejs.SuggesterMixin(name),
+      suggest = _common.toJSON();
+
+    suggest[name].phrase = {};
+    _context = ejs.SuggestContextMixin(suggest[name].phrase);
+
+    return extend(_common, _context, {
+
+      /**
+            <p>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.</p>
+
+            @member ejs.PhraseSuggester
+            @param {Double} l A positive double value greater than 0.0.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      realWordErrorLikelihood: function (l) {
+        if (l == null) {
+          return suggest[name].phrase.real_word_error_likelihood;
+        }
+
+        suggest[name].phrase.real_word_error_likelihood = l;
+        return this;
+      },
+
+      /**
+            <p>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.</p>
+
+            @member ejs.PhraseSuggester
+            @param {Double} c A positive double value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      confidence: function (c) {
+        if (c == null) {
+          return suggest[name].phrase.confidence;
+        }
+
+        suggest[name].phrase.confidence = c;
+        return this;
+      },
+
+      /**
+            <p>Sets the separator that is used to separate terms in the bigram
+            field. If not set the whitespce character is used as a
+            separator.</p>
+
+            @member ejs.PhraseSuggester
+            @param {String} sep A string separator.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      separator: function (sep) {
+        if (sep == null) {
+          return suggest[name].phrase.separator;
+        }
+
+        suggest[name].phrase.separator = sep;
+        return this;
+      },
+
+      /**
+            <p>Sets the maximum percentage of the terms that at most
+            considered to be misspellings in order to form a correction.</p>
+
+            @member ejs.PhraseSuggester
+            @param {Double} c A positive double value greater between 0 and 1.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      maxErrors: function (max) {
+        if (max == null) {
+          return suggest[name].phrase.max_errors;
+        }
+
+        suggest[name].phrase.max_errors = max;
+        return this;
+      },
+
+      /**
+            <p>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.</p>
+
+            @member ejs.PhraseSuggester
+            @param {Integer} s A positive integer value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      gramSize: function (s) {
+        if (s == null) {
+          return suggest[name].phrase.gram_size;
+        }
+
+        suggest[name].phrase.gram_size = s;
+        return this;
+      },
+
+      /**
+            <p>Forces the use of unigrams.</p>
+
+            @member ejs.PhraseSuggester
+            @param {Boolean} trueFalse True to force unigrams, false otherwise.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      forceUnigrams: function (trueFalse) {
+        if (trueFalse == null) {
+          return suggest[name].phrase.force_unigrams;
+        }
+
+        suggest[name].phrase.force_unigrams = trueFalse;
+        return this;
+      },
+
+      /**
+            <p>Sets the token limit.</p>
+
+            @member ejs.PhraseSuggester
+            @param {Integer} l A positive integer value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      tokenLimit: function (l) {
+        if (l == null) {
+          return suggest[name].phrase.token_limit;
+        }
+
+        suggest[name].phrase.token_limit = l;
+        return this;
+      },
+
+      /**
+            <p>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.</p>
+
+            @member ejs.PhraseSuggester
+            @param {Double} tl A positive double value used for trigram weight.
+            @param {Double} bl A positive double value used for bigram weight.
+            @param {Double} ul A positive double value used for unigram weight.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      linearSmoothing: function (tl, bl, ul) {
+        if (arguments.length === 0) {
+          return suggest[name].phrase.smoothing;
+        }
+
+        suggest[name].phrase.smoothing = {
+          linear: {
+            trigram_lambda: tl,
+            bigram_lambda: bl,
+            unigram_lambda: ul
+          }
+        };
+
+        return this;
+      },
+
+      /**
+            <p>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.</p>
+
+            @member ejs.PhraseSuggester
+            @param {Double} alpha A double value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      laplaceSmoothing: function (alpha) {
+        if (alpha == null) {
+          return suggest[name].phrase.smoothing;
+        }
+
+        suggest[name].phrase.smoothing = {
+          laplace: {
+            alpha: alpha
+          }
+        };
+
+        return this;
+      },
+
+      /**
+            <p>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.</p>
+
+            @member ejs.PhraseSuggester
+            @param {Double} discount A double value.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      stupidBackoffSmoothing: function (discount) {
+        if (discount == null) {
+          return suggest[name].phrase.smoothing;
+        }
+
+        suggest[name].phrase.smoothing = {
+          stupid_backoff: {
+            discount: discount
+          }
+        };
+
+        return this;
+      },
+
+      /**
+            <p>Enables highlighting of suggestions</p>
+
+            @member ejs.PhraseSuggester
+            @param {String} preTag A tag used at highlight start.
+            @param {String} postTag A tag used at the end of the highlight.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      highlight: function (preTag, postTag) {
+        if (arguments.length === 0) {
+          return suggest[name].phrase.highlight;
+        }
+
+        suggest[name].phrase.highlight = {
+          pre_tag: preTag,
+          post_tag: postTag
+        };
+
+        return this;
+      },
+
+      /**
+            Adds a direct generator. If passed a single <code>Generator</code>
+            it is added to the list of existing generators.  If passed an
+            array of Generators, they replace all existing generators.
+
+            @member ejs.PhraseSuggester
+            @param {(Generator|Generator[])} oGenerator A valid Generator or
+              array of Generator objects.
+            @returns {Object} returns <code>this</code> so that calls can be chained.
+            */
+      directGenerator: function (oGenerator) {
+        var i, len;
+
+        if (suggest[name].phrase.direct_generator == null) {
+          suggest[name].phrase.direct_generator = [];
+        }
+
+        if (oGenerator == null) {
+          return suggest[name].phrase.direct_generator;
+        }
+
+        if (isGenerator(oGenerator)) {
+          suggest[name].phrase.direct_generator.push(oGenerator.toJSON());
+        } else if (isArray(oGenerator)) {
+          suggest[name].phrase.direct_generator = [];
+          for (i = 0, len = oGenerator.length; i < len; i++) {
+            if (!isGenerator(oGenerator[i])) {
+              throw new TypeError('Argument must be an array of Generators');
+            }
+
+            suggest[name].phrase.direct_generator.push(oGenerator[i].toJSON());
+          }
+        } else {
+          throw new TypeError('Argument must be a Generator or array of Generators');
+        }
+
+        return this;
+      }
+
+    });
+  };
+
+  /**
+    @class
+    <p>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 
+    <code>PhraseSuggester</code>.</p>
+
+    @name ejs.TermSuggester
+    @ejs suggest
+    @borrows ejs.SuggesterMixin.text as text
+    @borrows ejs.SuggesterMixin._type as _type
+    @borrows ejs.SuggesterMixin.toJSON as toJSON
+    @borrows ejs.DirectSettingsMixin.accuracy as accuracy
+    @borrows ejs.DirectSettingsMixin.suggestMode as suggestMode
+    @borrows ejs.DirectSettingsMixin.sort as sort
+    @borrows ejs.DirectSettingsMixin.stringDistance as stringDistance
+    @borrows ejs.DirectSettingsMixin.maxEdits as maxEdits
+    @borrows ejs.DirectSettingsMixin.maxInspections as maxInspections
+    @borrows ejs.DirectSettingsMixin.maxTermFreq as maxTermFreq
+    @borrows ejs.DirectSettingsMixin.prefixLength as prefixLength
+    @borrows ejs.DirectSettingsMixin.minWordLen as minWordLen
+    @borrows ejs.DirectSettingsMixin.minDocFreq as minDocFreq
+    @borrows ejs.SuggestContextMixin.analyzer as analyzer
+    @borrows ejs.SuggestContextMixin.field as field
+    @borrows ejs.SuggestContextMixin.size as size
+    @borrows ejs.SuggestContextMixin.shardSize as shardSize
+
+    @since elasticsearch 0.90
+    
+    @desc
+    <p>A suggester that suggests terms based on edit distance.</p>
+
+    @param {String} name The name which be used to refer to this suggester.
+    */
+  ejs.TermSuggester = function (name) {
+
+    var
+      _direct,
+      _context,
+      _common = ejs.SuggesterMixin(name),
+      suggest = _common.toJSON();  
+    
+    suggest[name].term = {};
+    _direct = ejs.DirectSettingsMixin(suggest[name].term);
+    _context = ejs.SuggestContextMixin(suggest[name].term);
+
+    return extend(_common, _direct, _context);
+  };
+
+  // run in noConflict mode
+  ejs.noConflict = function () {
+    root.ejs = _ejs;
+    return this;
+  };
+  
+}).call(this);
+
+
+
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:08 GMT+0200 (CEST) +
+ + + + + diff --git a/dist/docs/fonts/OpenSans-Bold-webfont.eot b/dist/docs/fonts/OpenSans-Bold-webfont.eot new file mode 100644 index 0000000000000000000000000000000000000000..5d20d916338a5890a033952e2e07ba7380f5a7d3 GIT binary patch literal 19544 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 literal 0 HcmV?d00001 diff --git a/dist/docs/fonts/OpenSans-Bold-webfont.svg b/dist/docs/fonts/OpenSans-Bold-webfont.svg new file mode 100644 index 0000000..3ed7be4 --- /dev/null +++ b/dist/docs/fonts/OpenSans-Bold-webfont.svg @@ -0,0 +1,1830 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dist/docs/fonts/OpenSans-Bold-webfont.woff b/dist/docs/fonts/OpenSans-Bold-webfont.woff new file mode 100644 index 0000000000000000000000000000000000000000..1205787b0ed50db71ebd4f8a7f85d106721ff258 GIT binary patch literal 22432 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 ig3W + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dist/docs/fonts/OpenSans-BoldItalic-webfont.woff b/dist/docs/fonts/OpenSans-BoldItalic-webfont.woff new file mode 100644 index 0000000000000000000000000000000000000000..ed760c0628b6a0026041f5b8bba466a0471fd2e0 GIT binary patch literal 23048 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dist/docs/fonts/OpenSans-Italic-webfont.woff b/dist/docs/fonts/OpenSans-Italic-webfont.woff new file mode 100644 index 0000000000000000000000000000000000000000..ff652e64356b538c001423b6aedefcf1ee66cd17 GIT binary patch literal 23188 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 literal 0 HcmV?d00001 diff --git a/dist/docs/fonts/OpenSans-Light-webfont.svg b/dist/docs/fonts/OpenSans-Light-webfont.svg new file mode 100644 index 0000000..11a472c --- /dev/null +++ b/dist/docs/fonts/OpenSans-Light-webfont.svg @@ -0,0 +1,1831 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dist/docs/fonts/OpenSans-Light-webfont.woff b/dist/docs/fonts/OpenSans-Light-webfont.woff new file mode 100644 index 0000000000000000000000000000000000000000..e786074813a27d0a7a249047832988d5bf0fe756 GIT binary patch literal 22248 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 literal 0 HcmV?d00001 diff --git a/dist/docs/fonts/OpenSans-LightItalic-webfont.eot b/dist/docs/fonts/OpenSans-LightItalic-webfont.eot new file mode 100644 index 0000000000000000000000000000000000000000..8f445929ffb03b50e98c2a2f7d831a0cb1b276a2 GIT binary patch literal 20535 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 Z%0#`NexefPFV?Xj51H#Y#AC7WXn+Jg($4?@ literal 0 HcmV?d00001 diff --git a/dist/docs/fonts/OpenSans-LightItalic-webfont.svg b/dist/docs/fonts/OpenSans-LightItalic-webfont.svg new file mode 100644 index 0000000..431d7e3 --- /dev/null +++ b/dist/docs/fonts/OpenSans-LightItalic-webfont.svg @@ -0,0 +1,1835 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dist/docs/fonts/OpenSans-LightItalic-webfont.woff b/dist/docs/fonts/OpenSans-LightItalic-webfont.woff new file mode 100644 index 0000000000000000000000000000000000000000..43e8b9e6cc061ff17fd2903075cbde12715512b3 GIT binary patch literal 23400 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 + + + +
+ +
+ Documentation generated by JSDoc 3.3.2 on Tue Aug 04 2015 08:03:08 GMT+0200 (CEST) +
+ + + + + \ No newline at end of file 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/linenumber.js b/dist/docs/scripts/linenumber.js new file mode 100644 index 0000000..8d52f7e --- /dev/null +++ b/dist/docs/scripts/linenumber.js @@ -0,0 +1,25 @@ +/*global document */ +(function() { + var source = document.getElementsByClassName('prettyprint source linenums'); + var i = 0; + var lineNumber = 0; + var lineId; + var lines; + var totalLines; + var anchorHash; + + if (source && source[0]) { + anchorHash = document.location.hash.substring(1); + lines = source[0].getElementsByTagName('li'); + totalLines = lines.length; + + for (; i < totalLines; i++) { + lineNumber++; + lineId = 'line' + lineNumber; + lines[i].id = lineId; + if (lineId === anchorHash) { + lines[i].className += ' selected'; + } + } + } +})(); 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)/],["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/prettify/prettify.js b/dist/docs/scripts/prettify/prettify.js new file mode 100644 index 0000000..eef5ad7 --- /dev/null +++ b/dist/docs/scripts/prettify/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/jsdoc-default.css b/dist/docs/styles/jsdoc-default.css new file mode 100644 index 0000000..24aa20f --- /dev/null +++ b/dist/docs/styles/jsdoc-default.css @@ -0,0 +1,353 @@ +@font-face { + font-family: 'Open Sans'; + font-weight: normal; + font-style: normal; + src: url('../fonts/OpenSans-Regular-webfont.eot'); + src: + local('Open Sans'), + local('OpenSans'), + url('../fonts/OpenSans-Regular-webfont.eot?#iefix') format('embedded-opentype'), + url('../fonts/OpenSans-Regular-webfont.woff') format('woff'), + url('../fonts/OpenSans-Regular-webfont.svg#open_sansregular') format('svg'); +} + +@font-face { + font-family: 'Open Sans Light'; + font-weight: normal; + font-style: normal; + src: url('../fonts/OpenSans-Light-webfont.eot'); + src: + local('Open Sans Light'), + local('OpenSans Light'), + url('../fonts/OpenSans-Light-webfont.eot?#iefix') format('embedded-opentype'), + url('../fonts/OpenSans-Light-webfont.woff') format('woff'), + url('../fonts/OpenSans-Light-webfont.svg#open_sanslight') format('svg'); +} + +html +{ + overflow: auto; + background-color: #fff; + font-size: 14px; +} + +body +{ + font-family: 'Open Sans', sans-serif; + line-height: 1.5; + color: #4d4e53; + background-color: white; +} + +a, a:visited, a:active { + color: #0095dd; + text-decoration: none; +} + +a:hover { + text-decoration: underline; +} + +header +{ + display: block; + padding: 0px 4px; +} + +tt, code, kbd, samp { + font-family: Consolas, Monaco, 'Andale Mono', monospace; +} + +.class-description { + font-size: 130%; + line-height: 140%; + margin-bottom: 1em; + margin-top: 1em; +} + +.class-description:empty { + margin: 0; +} + +#main { + float: left; + width: 70%; +} + +article dl { + margin-bottom: 40px; +} + +section +{ + display: block; + background-color: #fff; + padding: 12px 24px; + border-bottom: 1px solid #ccc; + margin-right: 30px; +} + +.variation { + display: none; +} + +.signature-attributes { + font-size: 60%; + color: #aaa; + font-style: italic; + font-weight: lighter; +} + +nav +{ + display: block; + float: right; + margin-top: 28px; + width: 30%; + box-sizing: border-box; + border-left: 1px solid #ccc; + padding-left: 16px; +} + +nav ul { + font-family: 'Lucida Grande', 'Lucida Sans Unicode', arial, sans-serif; + font-size: 100%; + line-height: 17px; + padding: 0; + margin: 0; + list-style-type: none; +} + +nav ul a, nav ul a:visited, nav ul a:active { + font-family: Consolas, Monaco, 'Andale Mono', monospace; + line-height: 18px; + color: #4D4E53; +} + +nav h3 { + margin-top: 12px; +} + +nav li { + margin-top: 6px; +} + +footer { + display: block; + padding: 6px; + margin-top: 12px; + font-style: italic; + font-size: 90%; +} + +h1, h2, h3, h4 { + font-weight: 200; + margin: 0; +} + +h1 +{ + font-family: 'Open Sans Light', sans-serif; + font-size: 48px; + letter-spacing: -2px; + margin: 12px 24px 20px; +} + +h2, h3 +{ + font-size: 30px; + font-weight: 700; + letter-spacing: -1px; + margin-bottom: 12px; +} + +h4 +{ + font-size: 18px; + letter-spacing: -0.33px; + margin-bottom: 12px; + color: #4d4e53; +} + +h5, .container-overview .subsection-title +{ + font-size: 120%; + font-weight: bold; + letter-spacing: -0.01em; + margin: 8px 0 3px 0; +} + +h6 +{ + font-size: 100%; + letter-spacing: -0.01em; + margin: 6px 0 3px 0; + font-style: italic; +} + +.ancestors { color: #999; } +.ancestors a +{ + color: #999 !important; + text-decoration: none; +} + +.clear +{ + clear: both; +} + +.important +{ + font-weight: bold; + color: #950B02; +} + +.yes-def { + text-indent: -1000px; +} + +.type-signature { + color: #aaa; +} + +.name, .signature { + font-family: Consolas, Monaco, 'Andale Mono', monospace; +} + +.details { margin-top: 14px; border-left: 2px solid #DDD; } +.details dt { width: 120px; float: left; padding-left: 10px; padding-top: 6px; } +.details dd { margin-left: 70px; } +.details ul { margin: 0; } +.details ul { list-style-type: none; } +.details li { margin-left: 30px; padding-top: 6px; } +.details pre.prettyprint { margin: 0 } +.details .object-value { padding-top: 0; } + +.description { + margin-bottom: 1em; + margin-top: 1em; +} + +.code-caption +{ + font-style: italic; + font-size: 107%; + margin: 0; +} + +.prettyprint +{ + border: 1px solid #ddd; + width: 80%; + overflow: auto; +} + +.prettyprint.source { + width: inherit; +} + +.prettyprint code +{ + font-size: 100%; + line-height: 18px; + display: block; + padding: 4px 12px; + margin: 0; + background-color: #fff; + color: #4D4E53; +} + +.prettyprint code span.line +{ + display: inline-block; +} + +.prettyprint.linenums +{ + padding-left: 70px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.prettyprint.linenums ol +{ + padding-left: 0; +} + +.prettyprint.linenums li +{ + border-left: 3px #ddd solid; +} + +.prettyprint.linenums li.selected, +.prettyprint.linenums li.selected * +{ + background-color: lightyellow; +} + +.prettyprint.linenums li * +{ + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; +} + +.params, .props +{ + border-spacing: 0; + border: 0; + border-collapse: collapse; +} + +.params .name, .props .name, .name code { + color: #4D4E53; + font-family: Consolas, Monaco, 'Andale Mono', monospace; + font-size: 100%; +} + +.params td, .params th, .props td, .props th +{ + border: 1px solid #ddd; + margin: 0px; + text-align: left; + vertical-align: top; + padding: 4px 6px; + display: table-cell; +} + +.params thead tr, .props thead tr +{ + background-color: #ddd; + font-weight: bold; +} + +.params .params thead tr, .props .props thead tr +{ + background-color: #fff; + font-weight: bold; +} + +.params th, .props th { border-right: 1px solid #aaa; } +.params thead .last, .props thead .last { border-right: 1px solid #ddd; } + +.params td.description > p:first-child, +.props td.description > p:first-child +{ + margin-top: 0; + padding-top: 0; +} + +.params td.description > p:last-child, +.props td.description > p:last-child +{ + margin-bottom: 0; + padding-bottom: 0; +} + +.disabled { + color: #454545; +} diff --git a/dist/docs/styles/prettify-jsdoc.css b/dist/docs/styles/prettify-jsdoc.css new file mode 100644 index 0000000..5a2526e --- /dev/null +++ b/dist/docs/styles/prettify-jsdoc.css @@ -0,0 +1,111 @@ +/* JSDoc prettify.js theme */ + +/* plain text */ +.pln { + color: #000000; + font-weight: normal; + font-style: normal; +} + +/* string content */ +.str { + color: #006400; + font-weight: normal; + font-style: normal; +} + +/* a keyword */ +.kwd { + color: #000000; + font-weight: bold; + font-style: normal; +} + +/* a comment */ +.com { + font-weight: normal; + font-style: italic; +} + +/* a type name */ +.typ { + color: #000000; + font-weight: normal; + font-style: normal; +} + +/* a literal value */ +.lit { + color: #006400; + font-weight: normal; + font-style: normal; +} + +/* punctuation */ +.pun { + color: #000000; + font-weight: bold; + font-style: normal; +} + +/* lisp open bracket */ +.opn { + color: #000000; + font-weight: bold; + font-style: normal; +} + +/* lisp close bracket */ +.clo { + color: #000000; + font-weight: bold; + font-style: normal; +} + +/* a markup tag name */ +.tag { + color: #006400; + font-weight: normal; + font-style: normal; +} + +/* a markup attribute name */ +.atn { + color: #006400; + font-weight: normal; + font-style: normal; +} + +/* a markup attribute value */ +.atv { + color: #006400; + font-weight: normal; + font-style: normal; +} + +/* a declaration */ +.dec { + color: #000000; + font-weight: bold; + font-style: normal; +} + +/* a variable name */ +.var { + color: #000000; + font-weight: normal; + font-style: normal; +} + +/* a function name */ +.fun { + color: #000000; + font-weight: bold; + font-style: normal; +} + +/* Specify class=linenums on a pre to get line numbering */ +ol.linenums { + margin-top: 0; + margin-bottom: 0; +} diff --git a/dist/docs/styles/prettify-tomorrow.css b/dist/docs/styles/prettify-tomorrow.css new file mode 100644 index 0000000..b6f92a7 --- /dev/null +++ b/dist/docs/styles/prettify-tomorrow.css @@ -0,0 +1,132 @@ +/* Tomorrow Theme */ +/* Original theme - https://github.com/chriskempson/tomorrow-theme */ +/* Pretty printing styles. Used with prettify.js. */ +/* SPAN elements with the classes below are added by prettyprint. */ +/* plain text */ +.pln { + color: #4d4d4c; } + +@media screen { + /* string content */ + .str { + color: #718c00; } + + /* a keyword */ + .kwd { + color: #8959a8; } + + /* a comment */ + .com { + color: #8e908c; } + + /* a type name */ + .typ { + color: #4271ae; } + + /* a literal value */ + .lit { + color: #f5871f; } + + /* punctuation */ + .pun { + color: #4d4d4c; } + + /* lisp open bracket */ + .opn { + color: #4d4d4c; } + + /* lisp close bracket */ + .clo { + color: #4d4d4c; } + + /* a markup tag name */ + .tag { + color: #c82829; } + + /* a markup attribute name */ + .atn { + color: #f5871f; } + + /* a markup attribute value */ + .atv { + color: #3e999f; } + + /* a declaration */ + .dec { + color: #f5871f; } + + /* a variable name */ + .var { + color: #c82829; } + + /* a function name */ + .fun { + color: #4271ae; } } +/* Use higher contrast and text-weight for printable form. */ +@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; } } +/* Style */ +/* +pre.prettyprint { + background: white; + font-family: Consolas, Monaco, 'Andale Mono', monospace; + font-size: 12px; + line-height: 1.5; + border: 1px solid #ccc; + padding: 10px; } +*/ + +/* Specify class=linenums on a pre to get line numbering */ +ol.linenums { + margin-top: 0; + margin-bottom: 0; } + +/* IE indents via margin-left */ +li.L0, +li.L1, +li.L2, +li.L3, +li.L4, +li.L5, +li.L6, +li.L7, +li.L8, +li.L9 { + /* */ } + +/* Alternate shading for lines */ +li.L1, +li.L3, +li.L5, +li.L7, +li.L9 { + /* */ } 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 ba20e77..aecff90 100644 --- a/dist/elastic.js +++ b/dist/elastic.js @@ -1,4 +1,4 @@ -/*! elastic.js - v1.3.3 - 2015-08-04 +/*! elastic.js - v1.3.3 - 2015-08-06 * https://github.com/fullscale/elastic.js * Copyright (c) 2015 FullScale Labs, LLC; Licensed MIT */ @@ -320,6 +320,8 @@ @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 @@ -338,7 +340,7 @@ /**

Sets the field to operate on.

- @member ejs.MetricsAggregationMixin + @member ejs.BucketsAggregationMixin @param {String} field a valid field name.. @returns {Object} returns this so that calls can be chained. */ @@ -354,7 +356,7 @@ /** Allows you generate or modify the terms/values using a script. - @member ejs.MetricsAggregationMixin + @member ejs.BucketsAggregationMixin @param {String} scriptCode A valid script string to execute. @returns {Object} returns this so that calls can be chained. */ @@ -370,7 +372,7 @@ /** Allows you generate or modify the terms/values using a script. - @member ejs.MetricsAggregationMixin + @member ejs.BucketsAggregationMixin @param {String} scriptId A valid script id to execute. @returns {Object} returns this so that calls can be chained. */ @@ -386,7 +388,7 @@ /** Allows you generate or modify the terms/values using a script. - @member ejs.MetricsAggregationMixin + @member ejs.BucketsAggregationMixin @param {String} scriptFile A valid script file to execute. @returns {Object} returns this so that calls can be chained. */ @@ -402,7 +404,7 @@ /** The script language being used. - @member ejs.MetricsAggregationMixin + @member ejs.BucketsAggregationMixin @param {String} language The language of the script. @returns {Object} returns this so that calls can be chained. */ @@ -419,7 +421,7 @@ Sets parameters that will be applied to the script. Overwrites any existing params. - @member ejs.MetricsAggregationMixin + @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. @@ -3237,8 +3239,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 @@ -3269,6 +3272,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 @@ -3286,9 +3291,6 @@ _common = ejs.MetricsAggregationMixin(name, 'cardinality'), agg = _common.toJSON(); - // not supported in cardinality aggregation - delete _common.scriptValuesSorted; - return extend(_common, { /** @@ -3603,6 +3605,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 @@ -3708,8 +3716,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 @@ -3780,6 +3789,66 @@ }); }; + /** + @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.

@@ -3803,7 +3872,6 @@ agg = _common.toJSON(); // not supported in geo bounds aggregation - delete _common.scriptValuesSorted; delete _common.script; delete _common.scriptId; delete _common.scriptFile; @@ -3816,7 +3884,7 @@ /** Optional parameter which specifies whether the bounding box should be allowed to overlap the international date line. The default value is true - @member ejs.wrapLongitude + @member ejs.GeoBoundsAggregation @param {Boolean} trueFalse to overlap the international date line. @returns {Object} returns this so that calls can be chained. */ @@ -4187,6 +4255,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 @@ -4342,6 +4416,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 @@ -4431,8 +4511,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 @@ -4464,8 +4545,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 @@ -4593,8 +4675,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 @@ -4708,6 +4791,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 @@ -4811,7 +4900,6 @@ delete _common.script; delete _common.scriptId; delete _common.scriptFile; - delete _common.scriptValuesSorted; return extend(_common, { @@ -5260,8 +5348,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 @@ -5293,8 +5382,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 @@ -5322,6 +5412,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 @@ -5544,8 +5640,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, { /** @@ -5760,7 +5858,9 @@ @ejs aggregation @borrows ejs.MetricsAggregationMixin.field as field @borrows ejs.MetricsAggregationMixin.script as script - @borrows ejs.MetricsAggregationMixin.lang asr lang + @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 diff --git a/dist/elastic.min.js b/dist/elastic.min.js index c60a317..a46829c 100644 --- a/dist/elastic.min.js +++ b/dist/elastic.min.js @@ -1,8 +1,8 @@ -/*! elastic.js - v1.3.3 - 2015-08-04 +/*! elastic.js - v1.3.3 - 2015-08-06 * https://github.com/fullscale/elastic.js * Copyright (c) 2015 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.BucketsAggregationMixin=function(a,b){var d=z.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)}})},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(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}}},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)},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)}})},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 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}}},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.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)}})},z.DateRangeAggregation=function(a){var b=z.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)}})},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.GeoBoundsAggregation=function(a){var b=z.MetricsAggregationMixin(a,"geo_bounds"),d=b.toJSON();return delete b.scriptValuesSorted,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)}})},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.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)}})},z.IPv4RangeAggregation=function(a){var b=z.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)}})},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.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)}})},z.ScriptedMetricAggregation=function(a){var b=z.MetricsAggregationMixin(a,"scripted_metric"),d=b.toJSON();return delete b.field,delete b.script,delete b.scriptId,delete b.scriptFile,delete b.scriptValuesSorted,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)}})},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.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){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},null!=c&&(d[a].top_hits._source.excludes=c)),this}})},z.ValueCountAggregation=function(a){var b=z.MetricsAggregationMixin(a,"value_count");b.toJSON();return b},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(a){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(a){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(a){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 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)}})},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)},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(!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(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)}})},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(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)}})},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){var b=z.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)}})},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(),("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)}})},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(a){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(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)}})},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.FieldValueFactorFunction=function(a){var b=z.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)}})},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.ScoreFunction=function(){var a=z.ScoreFunctionMixin();return a},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,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)}})},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},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(!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=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.BucketsAggregationMixin=function(a,b){var d=z.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)}})},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(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}}},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)},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)}})},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 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}}},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 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.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)}})},z.DateRangeAggregation=function(a){var b=z.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)}})},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.FiltersAggregation=function(a){var b=z.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}})},z.GeoBoundsAggregation=function(a){var b=z.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)}})},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.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)}})},z.IPv4RangeAggregation=function(a){var b=z.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)}})},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.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)}})},z.ScriptedMetricAggregation=function(a){var b=z.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)}})},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.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){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.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(!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},null!=c&&(d[a].top_hits._source.excludes=c)),this}})},z.ValueCountAggregation=function(a){var b=z.MetricsAggregationMixin(a,"value_count");b.toJSON();return b},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(a){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(a){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(a){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 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)}})},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)},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(!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(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)}})},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(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)}})},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){var b=z.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)}})},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(),("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)}})},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(a){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(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)}})},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.FieldValueFactorFunction=function(a){var b=z.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)}})},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.ScoreFunction=function(){var a=z.ScoreFunctionMixin();return a},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,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)}})},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},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(!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 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/DateRangeAggregation.js b/src/aggregations/DateRangeAggregation.js index 6f0936c..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 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 index fc40e3a..0631515 100644 --- a/src/aggregations/GeoBoundsAggregation.js +++ b/src/aggregations/GeoBoundsAggregation.js @@ -21,7 +21,6 @@ agg = _common.toJSON(); // not supported in geo bounds aggregation - delete _common.scriptValuesSorted; delete _common.script; delete _common.scriptId; delete _common.scriptFile; @@ -34,7 +33,7 @@ /** Optional parameter which specifies whether the bounding box should be allowed to overlap the international date line. The default value is true - @member ejs.wrapLongitude + @member ejs.GeoBoundsAggregation @param {Boolean} trueFalse to overlap the international date line. @returns {Object} returns this so that calls can be chained. */ diff --git a/src/aggregations/HistogramAggregation.js b/src/aggregations/HistogramAggregation.js index 03398fb..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 diff --git a/src/aggregations/IPv4RangeAggregation.js b/src/aggregations/IPv4RangeAggregation.js index f8f334a..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 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 fcaa4f2..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 diff --git a/src/aggregations/ScriptedMetricAggregation.js b/src/aggregations/ScriptedMetricAggregation.js index 3a68cbb..b27f362 100644 --- a/src/aggregations/ScriptedMetricAggregation.js +++ b/src/aggregations/ScriptedMetricAggregation.js @@ -26,7 +26,6 @@ delete _common.script; delete _common.scriptId; delete _common.scriptFile; - delete _common.scriptValuesSorted; return extend(_common, { 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 76ea03a..1f007f6 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 diff --git a/src/aggregations/TopHitsAggregation.js b/src/aggregations/TopHitsAggregation.js index 8390825..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, { /** diff --git a/src/aggregations/ValueCountAggregation.js b/src/aggregations/ValueCountAggregation.js index bcca310..355ea08 100644 --- a/src/aggregations/ValueCountAggregation.js +++ b/src/aggregations/ValueCountAggregation.js @@ -10,7 +10,9 @@ @ejs aggregation @borrows ejs.MetricsAggregationMixin.field as field @borrows ejs.MetricsAggregationMixin.script as script - @borrows ejs.MetricsAggregationMixin.lang asr lang + @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 diff --git a/src/mixins/BucketsAggregationMixin.js b/src/mixins/BucketsAggregationMixin.js index 15ec2e2..284e116 100644 --- a/src/mixins/BucketsAggregationMixin.js +++ b/src/mixins/BucketsAggregationMixin.js @@ -6,6 +6,8 @@ @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 @@ -24,7 +26,7 @@ /**

Sets the field to operate on.

- @member ejs.MetricsAggregationMixin + @member ejs.BucketsAggregationMixin @param {String} field a valid field name.. @returns {Object} returns this so that calls can be chained. */ @@ -40,7 +42,7 @@ /** Allows you generate or modify the terms/values using a script. - @member ejs.MetricsAggregationMixin + @member ejs.BucketsAggregationMixin @param {String} scriptCode A valid script string to execute. @returns {Object} returns this so that calls can be chained. */ @@ -56,7 +58,7 @@ /** Allows you generate or modify the terms/values using a script. - @member ejs.MetricsAggregationMixin + @member ejs.BucketsAggregationMixin @param {String} scriptId A valid script id to execute. @returns {Object} returns this so that calls can be chained. */ @@ -72,7 +74,7 @@ /** Allows you generate or modify the terms/values using a script. - @member ejs.MetricsAggregationMixin + @member ejs.BucketsAggregationMixin @param {String} scriptFile A valid script file to execute. @returns {Object} returns this so that calls can be chained. */ @@ -88,7 +90,7 @@ /** The script language being used. - @member ejs.MetricsAggregationMixin + @member ejs.BucketsAggregationMixin @param {String} language The language of the script. @returns {Object} returns this so that calls can be chained. */ @@ -105,7 +107,7 @@ Sets parameters that will be applied to the script. Overwrites any existing params. - @member ejs.MetricsAggregationMixin + @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. From 9162a3e58aef4adf325cb51f9035ad7cbe90b792 Mon Sep 17 00:00:00 2001 From: ErwanPigneul Date: Thu, 6 Aug 2015 00:42:07 +0200 Subject: [PATCH 43/56] update Readme --- README.md | 8 + dist/docs/ejs.AggregationMixin.html | 2 +- dist/docs/ejs.AndFilter.html | 2 +- dist/docs/ejs.AvgAggregation.html | 2 +- dist/docs/ejs.BoolFilter.html | 2 +- dist/docs/ejs.BoolQuery.html | 2 +- dist/docs/ejs.BoostFactorScoreFunction.html | 2 +- dist/docs/ejs.BoostingQuery.html | 2 +- dist/docs/ejs.BucketsAggregationMixin.html | 2 +- dist/docs/ejs.CardinalityAggregation.html | 2 +- dist/docs/ejs.CommonTermsQuery.html | 2 +- dist/docs/ejs.CompletionSuggester.html | 2 +- dist/docs/ejs.ConstantScoreQuery.html | 2 +- dist/docs/ejs.DateHistogramAggregation.html | 2 +- dist/docs/ejs.DateHistogramFacet.html | 2 +- dist/docs/ejs.DateRangeAggregation.html | 2 +- dist/docs/ejs.DecayScoreFunction.html | 2 +- dist/docs/ejs.DirectGenerator.html | 2 +- dist/docs/ejs.DirectSettingsMixin.html | 2 +- dist/docs/ejs.DisMaxQuery.html | 2 +- dist/docs/ejs.ExistsFilter.html | 2 +- dist/docs/ejs.ExtendedStatsAggregation.html | 2 +- dist/docs/ejs.FacetMixin.html | 2 +- dist/docs/ejs.FieldMaskingSpanQuery.html | 2 +- dist/docs/ejs.FieldValueFactorFunction.html | 2 +- dist/docs/ejs.FilterAggregation.html | 2 +- dist/docs/ejs.FilterFacet.html | 2 +- dist/docs/ejs.FilterMixin.html | 2 +- dist/docs/ejs.FilteredQuery.html | 2 +- dist/docs/ejs.FiltersAggregation.html | 2 +- dist/docs/ejs.FunctionScoreQuery.html | 2 +- dist/docs/ejs.FuzzyLikeThisFieldQuery.html | 2 +- dist/docs/ejs.FuzzyLikeThisQuery.html | 2 +- dist/docs/ejs.FuzzyQuery.html | 2 +- dist/docs/ejs.GeoBboxFilter.html | 2 +- dist/docs/ejs.GeoBoundsAggregation.html | 2 +- dist/docs/ejs.GeoDistanceAggregation.html | 2 +- dist/docs/ejs.GeoDistanceFacet.html | 2 +- dist/docs/ejs.GeoDistanceFilter.html | 2 +- dist/docs/ejs.GeoDistanceRangeFilter.html | 2 +- dist/docs/ejs.GeoHashGridAggregation.html | 2 +- dist/docs/ejs.GeoPoint.html | 2 +- dist/docs/ejs.GeoPolygonFilter.html | 2 +- dist/docs/ejs.GeoShapeFilter.html | 2 +- dist/docs/ejs.GeoShapeQuery.html | 2 +- dist/docs/ejs.GlobalAggregation.html | 2 +- dist/docs/ejs.HasChildFilter.html | 2 +- dist/docs/ejs.HasChildQuery.html | 2 +- dist/docs/ejs.HasParentFilter.html | 2 +- dist/docs/ejs.HasParentQuery.html | 2 +- dist/docs/ejs.Highlight.html | 2 +- dist/docs/ejs.HistogramAggregation.html | 2 +- dist/docs/ejs.HistogramFacet.html | 2 +- dist/docs/ejs.IPv4RangeAggregation.html | 2 +- dist/docs/ejs.IdsFilter.html | 2 +- dist/docs/ejs.IdsQuery.html | 2 +- dist/docs/ejs.IndexedShape.html | 2 +- dist/docs/ejs.IndicesFilter.html | 2 +- dist/docs/ejs.IndicesQuery.html | 2 +- dist/docs/ejs.LimitFilter.html | 2 +- dist/docs/ejs.MatchAllFilter.html | 2 +- dist/docs/ejs.MatchAllQuery.html | 2 +- dist/docs/ejs.MatchQuery.html | 2 +- dist/docs/ejs.MaxAggregation.html | 2 +- dist/docs/ejs.MetricsAggregationMixin.html | 2 +- dist/docs/ejs.MinAggregation.html | 2 +- dist/docs/ejs.MissingAggregation.html | 2 +- dist/docs/ejs.MissingFilter.html | 2 +- dist/docs/ejs.MoreLikeThisFieldQuery.html | 2 +- dist/docs/ejs.MoreLikeThisQuery.html | 2 +- dist/docs/ejs.MultiMatchQuery.html | 2 +- dist/docs/ejs.NestedAggregation.html | 2 +- dist/docs/ejs.NestedFilter.html | 2 +- dist/docs/ejs.NestedQuery.html | 2 +- dist/docs/ejs.NotFilter.html | 2 +- dist/docs/ejs.NumericRangeFilter.html | 2 +- dist/docs/ejs.OrFilter.html | 2 +- dist/docs/ejs.PercentilesAggregation.html | 2 +- dist/docs/ejs.PhraseSuggester.html | 2 +- dist/docs/ejs.PrefixFilter.html | 2 +- dist/docs/ejs.PrefixQuery.html | 2 +- dist/docs/ejs.QueryFacet.html | 2 +- dist/docs/ejs.QueryFilter.html | 2 +- dist/docs/ejs.QueryMixin.html | 2 +- dist/docs/ejs.QueryStringQuery.html | 2 +- dist/docs/ejs.RandomScoreFunction.html | 2 +- dist/docs/ejs.RangeAggregation.html | 2 +- dist/docs/ejs.RangeFacet.html | 2 +- dist/docs/ejs.RangeFilter.html | 2 +- dist/docs/ejs.RangeQuery.html | 2 +- dist/docs/ejs.RegexpFilter.html | 2 +- dist/docs/ejs.RegexpQuery.html | 2 +- dist/docs/ejs.Request.html | 2 +- dist/docs/ejs.Rescore.html | 2 +- dist/docs/ejs.ScoreFunction.html | 2 +- dist/docs/ejs.ScoreFunctionMixin.html | 2 +- dist/docs/ejs.ScriptField.html | 2 +- dist/docs/ejs.ScriptFilter.html | 2 +- dist/docs/ejs.ScriptScoreFunction.html | 2 +- dist/docs/ejs.ScriptedMetricAggregation.html | 2 +- dist/docs/ejs.Shape.html | 2 +- .../docs/ejs.SignificantTermsAggregation.html | 2 +- dist/docs/ejs.Sort.html | 2 +- dist/docs/ejs.SpanFirstQuery.html | 2 +- dist/docs/ejs.SpanMultiTermQuery.html | 2 +- dist/docs/ejs.SpanNearQuery.html | 2 +- dist/docs/ejs.SpanNotQuery.html | 2 +- dist/docs/ejs.SpanOrQuery.html | 2 +- dist/docs/ejs.SpanTermQuery.html | 2 +- dist/docs/ejs.StatisticalFacet.html | 2 +- dist/docs/ejs.StatsAggregation.html | 2 +- dist/docs/ejs.SuggestContextMixin.html | 2 +- dist/docs/ejs.SuggesterMixin.html | 2 +- dist/docs/ejs.SumAggregation.html | 2 +- dist/docs/ejs.TermFilter.html | 2 +- dist/docs/ejs.TermQuery.html | 2 +- dist/docs/ejs.TermStatsFacet.html | 2 +- dist/docs/ejs.TermSuggester.html | 2 +- dist/docs/ejs.TermsAggregation.html | 2 +- dist/docs/ejs.TermsFacet.html | 2 +- dist/docs/ejs.TermsFilter.html | 2 +- dist/docs/ejs.TermsQuery.html | 2 +- dist/docs/ejs.TopChildrenQuery.html | 2 +- dist/docs/ejs.TopHitsAggregation.html | 2 +- dist/docs/ejs.TypeFilter.html | 2 +- dist/docs/ejs.ValueCountAggregation.html | 2 +- dist/docs/ejs.WildcardQuery.html | 2 +- dist/docs/ejs.html | 2 +- dist/docs/ejs.html#.AggregationMixin | 132 - dist/docs/ejs.html#.AndFilter | 223 - dist/docs/ejs.html#.BoolFilter | 174 - dist/docs/ejs.html#.BoolQuery | 173 - dist/docs/ejs.html#.BoostFactorScoreFunction | 221 - dist/docs/ejs.html#.BoostingQuery | 269 - dist/docs/ejs.html#.CardinalityAggregation | 221 - dist/docs/ejs.html#.CommonTermsQuery | 253 - dist/docs/ejs.html#.CompletionSuggester | 218 - dist/docs/ejs.html#.ConstantScoreQuery | 180 - dist/docs/ejs.html#.DateHistogramAggregation | 228 - dist/docs/ejs.html#.DateHistogramFacet | 238 - dist/docs/ejs.html#.DateRangeAggregation | 227 - dist/docs/ejs.html#.DecayScoreFunction | 225 - dist/docs/ejs.html#.DirectGenerator | 175 - dist/docs/ejs.html#.DirectSettingsMixin | 132 - dist/docs/ejs.html#.DisMaxQuery | 174 - dist/docs/ejs.html#.ExistsFilter | 220 - dist/docs/ejs.html#.FacetMixin | 132 - dist/docs/ejs.html#.FieldMaskingSpanQuery | 246 - dist/docs/ejs.html#.FieldValueFactorFunction | 222 - dist/docs/ejs.html#.FilterAggregation | 221 - dist/docs/ejs.html#.FilterFacet | 236 - dist/docs/ejs.html#.FilterMixin | 132 - dist/docs/ejs.html#.FilteredQuery | 247 - dist/docs/ejs.html#.FunctionScoreQuery | 173 - dist/docs/ejs.html#.FuzzyLikeThisFieldQuery | 262 - dist/docs/ejs.html#.FuzzyLikeThisQuery | 236 - dist/docs/ejs.html#.FuzzyQuery | 249 - dist/docs/ejs.html#.GeoBboxFilter | 220 - dist/docs/ejs.html#.GeoDistanceAggregation | 226 - dist/docs/ejs.html#.GeoDistanceFacet | 237 - dist/docs/ejs.html#.GeoDistanceFilter | 220 - dist/docs/ejs.html#.GeoDistanceRangeFilter | 220 - dist/docs/ejs.html#.GeoHashGridAggregation | 223 - dist/docs/ejs.html#.GeoPoint | 222 - dist/docs/ejs.html#.GeoPolygonFilter | 220 - dist/docs/ejs.html#.GeoShapeFilter | 177 - dist/docs/ejs.html#.GeoShapeQuery | 177 - dist/docs/ejs.html#.HasChildFilter | 243 - dist/docs/ejs.html#.HasChildQuery | 244 - dist/docs/ejs.html#.HasParentFilter | 243 - dist/docs/ejs.html#.HasParentQuery | 244 - dist/docs/ejs.html#.Highlight | 234 - dist/docs/ejs.html#.HistogramAggregation | 222 - dist/docs/ejs.html#.HistogramFacet | 238 - dist/docs/ejs.html#.IPv4RangeAggregation | 222 - dist/docs/ejs.html#.IdsFilter | 224 - dist/docs/ejs.html#.IdsQuery | 224 - dist/docs/ejs.html#.IndexedShape | 246 - dist/docs/ejs.html#.IndicesFilter | 249 - dist/docs/ejs.html#.IndicesQuery | 249 - dist/docs/ejs.html#.LimitFilter | 219 - dist/docs/ejs.html#.MatchQuery | 245 - dist/docs/ejs.html#.MetricsAggregationMixin | 132 - dist/docs/ejs.html#.MissingAggregation | 221 - dist/docs/ejs.html#.MissingFilter | 219 - dist/docs/ejs.html#.MoreLikeThisFieldQuery | 243 - dist/docs/ejs.html#.MoreLikeThisQuery | 246 - dist/docs/ejs.html#.MultiMatchQuery | 250 - dist/docs/ejs.html#.NestedAggregation | 221 - dist/docs/ejs.html#.NestedFilter | 227 - dist/docs/ejs.html#.NestedQuery | 226 - dist/docs/ejs.html#.NotFilter | 220 - dist/docs/ejs.html#.NumericRangeFilter | 230 - dist/docs/ejs.html#.OrFilter | 222 - dist/docs/ejs.html#.PercentilesAggregation | 223 - dist/docs/ejs.html#.PhraseSuggester | 226 - dist/docs/ejs.html#.PrefixFilter | 243 - dist/docs/ejs.html#.PrefixQuery | 243 - dist/docs/ejs.html#.QueryFacet | 236 - dist/docs/ejs.html#.QueryFilter | 227 - dist/docs/ejs.html#.QueryMixin | 132 - dist/docs/ejs.html#.QueryStringQuery | 224 - dist/docs/ejs.html#.RandomScoreFunction | 171 - dist/docs/ejs.html#.RangeAggregation | 226 - dist/docs/ejs.html#.RangeFacet | 236 - dist/docs/ejs.html#.RangeFilter | 219 - dist/docs/ejs.html#.RangeQuery | 222 - dist/docs/ejs.html#.RegexpFilter | 244 - dist/docs/ejs.html#.RegexpQuery | 244 - dist/docs/ejs.html#.Request | 223 - dist/docs/ejs.html#.Rescore | 242 - dist/docs/ejs.html#.ScoreFunctionMixin | 132 - dist/docs/ejs.html#.ScriptField | 223 - dist/docs/ejs.html#.ScriptFilter | 219 - dist/docs/ejs.html#.ScriptScoreFunction | 172 - dist/docs/ejs.html#.ScriptedMetricAggregation | 220 - dist/docs/ejs.html#.Shape | 245 - .../ejs.html#.SignificantTermsAggregation | 221 - dist/docs/ejs.html#.Sort | 223 - dist/docs/ejs.html#.SpanFirstQuery | 244 - dist/docs/ejs.html#.SpanMultiTermQuery | 221 - dist/docs/ejs.html#.SpanNearQuery | 246 - dist/docs/ejs.html#.SpanNotQuery | 243 - dist/docs/ejs.html#.SpanOrQuery | 220 - dist/docs/ejs.html#.SpanTermQuery | 244 - dist/docs/ejs.html#.StatisticalFacet | 236 - dist/docs/ejs.html#.SuggestContextMixin | 132 - dist/docs/ejs.html#.SuggesterMixin | 132 - dist/docs/ejs.html#.TermFilter | 244 - dist/docs/ejs.html#.TermQuery | 246 - dist/docs/ejs.html#.TermStatsFacet | 236 - dist/docs/ejs.html#.TermsAggregation | 220 - dist/docs/ejs.html#.TermsFacet | 233 - dist/docs/ejs.html#.TermsFilter | 246 - dist/docs/ejs.html#.TermsQuery | 247 - dist/docs/ejs.html#.TopChildrenQuery | 248 - dist/docs/ejs.html#.TopHitsAggregation | 222 - dist/docs/ejs.html#.TypeFilter | 219 - dist/docs/ejs.html#.WildcardQuery | 249 - dist/docs/elastic.js.html | 18220 ---------------- dist/docs/fonts/OpenSans-Bold-webfont.eot | Bin 19544 -> 0 bytes dist/docs/fonts/OpenSans-Bold-webfont.svg | 1830 -- dist/docs/fonts/OpenSans-Bold-webfont.woff | Bin 22432 -> 0 bytes .../fonts/OpenSans-BoldItalic-webfont.eot | Bin 20133 -> 0 bytes .../fonts/OpenSans-BoldItalic-webfont.svg | 1830 -- .../fonts/OpenSans-BoldItalic-webfont.woff | Bin 23048 -> 0 bytes dist/docs/fonts/OpenSans-Italic-webfont.eot | Bin 20265 -> 0 bytes dist/docs/fonts/OpenSans-Italic-webfont.svg | 1830 -- dist/docs/fonts/OpenSans-Italic-webfont.woff | Bin 23188 -> 0 bytes dist/docs/fonts/OpenSans-Light-webfont.eot | Bin 19514 -> 0 bytes dist/docs/fonts/OpenSans-Light-webfont.svg | 1831 -- dist/docs/fonts/OpenSans-Light-webfont.woff | Bin 22248 -> 0 bytes .../fonts/OpenSans-LightItalic-webfont.eot | Bin 20535 -> 0 bytes .../fonts/OpenSans-LightItalic-webfont.svg | 1835 -- .../fonts/OpenSans-LightItalic-webfont.woff | Bin 23400 -> 0 bytes dist/docs/fonts/OpenSans-Regular-webfont.eot | Bin 19836 -> 0 bytes dist/docs/fonts/OpenSans-Regular-webfont.svg | 1831 -- dist/docs/fonts/OpenSans-Regular-webfont.woff | Bin 22660 -> 0 bytes dist/docs/index.html | 65 - dist/docs/scripts/linenumber.js | 25 - .../scripts/prettify/Apache-License-2.0.txt | 202 - dist/docs/scripts/prettify/lang-css.js | 2 - dist/docs/scripts/prettify/prettify.js | 28 - dist/docs/styles/jsdoc-default.css | 353 - dist/docs/styles/prettify-jsdoc.css | 111 - dist/docs/styles/prettify-tomorrow.css | 132 - 266 files changed, 135 insertions(+), 54600 deletions(-) delete mode 100644 dist/docs/ejs.html#.AggregationMixin delete mode 100644 dist/docs/ejs.html#.AndFilter delete mode 100644 dist/docs/ejs.html#.BoolFilter delete mode 100644 dist/docs/ejs.html#.BoolQuery delete mode 100644 dist/docs/ejs.html#.BoostFactorScoreFunction delete mode 100644 dist/docs/ejs.html#.BoostingQuery delete mode 100644 dist/docs/ejs.html#.CardinalityAggregation delete mode 100644 dist/docs/ejs.html#.CommonTermsQuery delete mode 100644 dist/docs/ejs.html#.CompletionSuggester delete mode 100644 dist/docs/ejs.html#.ConstantScoreQuery delete mode 100644 dist/docs/ejs.html#.DateHistogramAggregation delete mode 100644 dist/docs/ejs.html#.DateHistogramFacet delete mode 100644 dist/docs/ejs.html#.DateRangeAggregation delete mode 100644 dist/docs/ejs.html#.DecayScoreFunction delete mode 100644 dist/docs/ejs.html#.DirectGenerator delete mode 100644 dist/docs/ejs.html#.DirectSettingsMixin delete mode 100644 dist/docs/ejs.html#.DisMaxQuery delete mode 100644 dist/docs/ejs.html#.ExistsFilter delete mode 100644 dist/docs/ejs.html#.FacetMixin delete mode 100644 dist/docs/ejs.html#.FieldMaskingSpanQuery delete mode 100644 dist/docs/ejs.html#.FieldValueFactorFunction delete mode 100644 dist/docs/ejs.html#.FilterAggregation delete mode 100644 dist/docs/ejs.html#.FilterFacet delete mode 100644 dist/docs/ejs.html#.FilterMixin delete mode 100644 dist/docs/ejs.html#.FilteredQuery delete mode 100644 dist/docs/ejs.html#.FunctionScoreQuery delete mode 100644 dist/docs/ejs.html#.FuzzyLikeThisFieldQuery delete mode 100644 dist/docs/ejs.html#.FuzzyLikeThisQuery delete mode 100644 dist/docs/ejs.html#.FuzzyQuery delete mode 100644 dist/docs/ejs.html#.GeoBboxFilter delete mode 100644 dist/docs/ejs.html#.GeoDistanceAggregation delete mode 100644 dist/docs/ejs.html#.GeoDistanceFacet delete mode 100644 dist/docs/ejs.html#.GeoDistanceFilter delete mode 100644 dist/docs/ejs.html#.GeoDistanceRangeFilter delete mode 100644 dist/docs/ejs.html#.GeoHashGridAggregation delete mode 100644 dist/docs/ejs.html#.GeoPoint delete mode 100644 dist/docs/ejs.html#.GeoPolygonFilter delete mode 100644 dist/docs/ejs.html#.GeoShapeFilter delete mode 100644 dist/docs/ejs.html#.GeoShapeQuery delete mode 100644 dist/docs/ejs.html#.HasChildFilter delete mode 100644 dist/docs/ejs.html#.HasChildQuery delete mode 100644 dist/docs/ejs.html#.HasParentFilter delete mode 100644 dist/docs/ejs.html#.HasParentQuery delete mode 100644 dist/docs/ejs.html#.Highlight delete mode 100644 dist/docs/ejs.html#.HistogramAggregation delete mode 100644 dist/docs/ejs.html#.HistogramFacet delete mode 100644 dist/docs/ejs.html#.IPv4RangeAggregation delete mode 100644 dist/docs/ejs.html#.IdsFilter delete mode 100644 dist/docs/ejs.html#.IdsQuery delete mode 100644 dist/docs/ejs.html#.IndexedShape delete mode 100644 dist/docs/ejs.html#.IndicesFilter delete mode 100644 dist/docs/ejs.html#.IndicesQuery delete mode 100644 dist/docs/ejs.html#.LimitFilter delete mode 100644 dist/docs/ejs.html#.MatchQuery delete mode 100644 dist/docs/ejs.html#.MetricsAggregationMixin delete mode 100644 dist/docs/ejs.html#.MissingAggregation delete mode 100644 dist/docs/ejs.html#.MissingFilter delete mode 100644 dist/docs/ejs.html#.MoreLikeThisFieldQuery delete mode 100644 dist/docs/ejs.html#.MoreLikeThisQuery delete mode 100644 dist/docs/ejs.html#.MultiMatchQuery delete mode 100644 dist/docs/ejs.html#.NestedAggregation delete mode 100644 dist/docs/ejs.html#.NestedFilter delete mode 100644 dist/docs/ejs.html#.NestedQuery delete mode 100644 dist/docs/ejs.html#.NotFilter delete mode 100644 dist/docs/ejs.html#.NumericRangeFilter delete mode 100644 dist/docs/ejs.html#.OrFilter delete mode 100644 dist/docs/ejs.html#.PercentilesAggregation delete mode 100644 dist/docs/ejs.html#.PhraseSuggester delete mode 100644 dist/docs/ejs.html#.PrefixFilter delete mode 100644 dist/docs/ejs.html#.PrefixQuery delete mode 100644 dist/docs/ejs.html#.QueryFacet delete mode 100644 dist/docs/ejs.html#.QueryFilter delete mode 100644 dist/docs/ejs.html#.QueryMixin delete mode 100644 dist/docs/ejs.html#.QueryStringQuery delete mode 100644 dist/docs/ejs.html#.RandomScoreFunction delete mode 100644 dist/docs/ejs.html#.RangeAggregation delete mode 100644 dist/docs/ejs.html#.RangeFacet delete mode 100644 dist/docs/ejs.html#.RangeFilter delete mode 100644 dist/docs/ejs.html#.RangeQuery delete mode 100644 dist/docs/ejs.html#.RegexpFilter delete mode 100644 dist/docs/ejs.html#.RegexpQuery delete mode 100644 dist/docs/ejs.html#.Request delete mode 100644 dist/docs/ejs.html#.Rescore delete mode 100644 dist/docs/ejs.html#.ScoreFunctionMixin delete mode 100644 dist/docs/ejs.html#.ScriptField delete mode 100644 dist/docs/ejs.html#.ScriptFilter delete mode 100644 dist/docs/ejs.html#.ScriptScoreFunction delete mode 100644 dist/docs/ejs.html#.ScriptedMetricAggregation delete mode 100644 dist/docs/ejs.html#.Shape delete mode 100644 dist/docs/ejs.html#.SignificantTermsAggregation delete mode 100644 dist/docs/ejs.html#.Sort delete mode 100644 dist/docs/ejs.html#.SpanFirstQuery delete mode 100644 dist/docs/ejs.html#.SpanMultiTermQuery delete mode 100644 dist/docs/ejs.html#.SpanNearQuery delete mode 100644 dist/docs/ejs.html#.SpanNotQuery delete mode 100644 dist/docs/ejs.html#.SpanOrQuery delete mode 100644 dist/docs/ejs.html#.SpanTermQuery delete mode 100644 dist/docs/ejs.html#.StatisticalFacet delete mode 100644 dist/docs/ejs.html#.SuggestContextMixin delete mode 100644 dist/docs/ejs.html#.SuggesterMixin delete mode 100644 dist/docs/ejs.html#.TermFilter delete mode 100644 dist/docs/ejs.html#.TermQuery delete mode 100644 dist/docs/ejs.html#.TermStatsFacet delete mode 100644 dist/docs/ejs.html#.TermsAggregation delete mode 100644 dist/docs/ejs.html#.TermsFacet delete mode 100644 dist/docs/ejs.html#.TermsFilter delete mode 100644 dist/docs/ejs.html#.TermsQuery delete mode 100644 dist/docs/ejs.html#.TopChildrenQuery delete mode 100644 dist/docs/ejs.html#.TopHitsAggregation delete mode 100644 dist/docs/ejs.html#.TypeFilter delete mode 100644 dist/docs/ejs.html#.WildcardQuery delete mode 100644 dist/docs/elastic.js.html delete mode 100644 dist/docs/fonts/OpenSans-Bold-webfont.eot delete mode 100644 dist/docs/fonts/OpenSans-Bold-webfont.svg delete mode 100644 dist/docs/fonts/OpenSans-Bold-webfont.woff delete mode 100644 dist/docs/fonts/OpenSans-BoldItalic-webfont.eot delete mode 100644 dist/docs/fonts/OpenSans-BoldItalic-webfont.svg delete mode 100644 dist/docs/fonts/OpenSans-BoldItalic-webfont.woff delete mode 100644 dist/docs/fonts/OpenSans-Italic-webfont.eot delete mode 100644 dist/docs/fonts/OpenSans-Italic-webfont.svg delete mode 100644 dist/docs/fonts/OpenSans-Italic-webfont.woff delete mode 100644 dist/docs/fonts/OpenSans-Light-webfont.eot delete mode 100644 dist/docs/fonts/OpenSans-Light-webfont.svg delete mode 100644 dist/docs/fonts/OpenSans-Light-webfont.woff delete mode 100644 dist/docs/fonts/OpenSans-LightItalic-webfont.eot delete mode 100644 dist/docs/fonts/OpenSans-LightItalic-webfont.svg delete mode 100644 dist/docs/fonts/OpenSans-LightItalic-webfont.woff delete mode 100644 dist/docs/fonts/OpenSans-Regular-webfont.eot delete mode 100644 dist/docs/fonts/OpenSans-Regular-webfont.svg delete mode 100644 dist/docs/fonts/OpenSans-Regular-webfont.woff delete mode 100644 dist/docs/index.html delete mode 100644 dist/docs/scripts/linenumber.js delete mode 100644 dist/docs/scripts/prettify/Apache-License-2.0.txt delete mode 100644 dist/docs/scripts/prettify/lang-css.js delete mode 100644 dist/docs/scripts/prettify/prettify.js delete mode 100644 dist/docs/styles/jsdoc-default.css delete mode 100644 dist/docs/styles/prettify-jsdoc.css delete mode 100644 dist/docs/styles/prettify-tomorrow.css diff --git a/README.md b/README.md index 13b3ca3..6b08080 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,11 @@ +It's a maintained fork + +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). diff --git a/dist/docs/ejs.AggregationMixin.html b/dist/docs/ejs.AggregationMixin.html index 028ad13..c3556a8 100644 --- a/dist/docs/ejs.AggregationMixin.html +++ b/dist/docs/ejs.AggregationMixin.html @@ -495,7 +495,7 @@

Request

)CdQ3F!eKyF|9D2V!F-rhUpJ8J+l7g0OBBVM#THTI&O8)>EGR%u6Gd9D9pm5!S}%&6DxW}^f|7=Y zPoO3(pTZY#?(7(|!5}5Nn!D%DotZmlW)?smSMcEE<^aT$6gw#LlwubPI9BYTffL0! zyu-EPCnz{Y#ZR&1d{F!hr_NW!&#~mXis$jseXDo@U)-kR7sMBeUt-T&RQw9By@BF9 z3f?cpmw4m-R{RHncaC**(V--ipJ<~6LkW2fi6RVfh%vcYt9@z>&M0LBSf-Q|Et8wU zCt43_*JB)mHR71wb`K@~5Cizwp{`A2uuJ^_Bcl3k{7ree$8&@l?;^2nagS+NqCDBfkB?pJws=PbK~+A7|2 z{gCDJKI-i%m4LD$n{WIwWR|c+NRy`C1#)1sSBI7FiH6z-QkhY&Q_|%I3exQ zQ`X1M?cZH4^M&BSyr;2z$+^SZUMA*0001Z+HKHROw(}?!13=vX`$@Br+fGR zZ%e`5O6%Txi$Yrz0gF{}p>fY>OnlS0Uevf}oDXW;D{d2gcE<2)oFcV80@g$H)63L{HN*d{8kVzKVW(;E)$9N_%kx5Ku3R9WJbY?JW^G#k0Wdx>E$NBBVtKRLiL?sA*s%w`TdsNz1=+~FRNdB8&+@iBD0 zXFTC4C-8-Cwv(4U=LLQ~^Oa4^rG|OTr5?ItoaPMYxxh`%a*kVU z;HYGAjq6;IY{`*awo0DlOMw(hkrYdb(O28l;MYvSx*ChcQW4f^QL5UdE3HbqvbxB$pfSg`>Cj#;?~00;nMAg}==M6d%RaIhCe zARtS)01i=0um)3FSgr#ump{<1pq_<0a34Kp8x=7I1^|9 literal 0 HcmV?d00001 diff --git a/dist/docs/fonts/OpenSans-Regular-webfont.eot b/dist/docs/fonts/OpenSans-Regular-webfont.eot new file mode 100644 index 0000000000000000000000000000000000000000..6bbc3cf58cb011a6b4bf3cb1612ce212608f7274 GIT binary patch literal 19836 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dist/docs/fonts/OpenSans-Regular-webfont.woff b/dist/docs/fonts/OpenSans-Regular-webfont.woff new file mode 100644 index 0000000000000000000000000000000000000000..e231183dce4c7b452afc9e7799586fd285e146f4 GIT binary patch literal 22660 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 ML;wL%uV=LY00kR;TmS$7 literal 0 HcmV?d00001 diff --git a/dist/docs/img/glyphicons-halflings-white.png b/dist/docs/img/glyphicons-halflings-white.png new file mode 100644 index 0000000000000000000000000000000000000000..3bf6484a29d8da269f9bc874b25493a45fae3bae GIT binary patch literal 8777 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 B7G?kd literal 0 HcmV?d00001 diff --git a/dist/docs/img/glyphicons-halflings.png b/dist/docs/img/glyphicons-halflings.png new file mode 100644 index 0000000000000000000000000000000000000000..a9969993201f9cee63cf9f49217646347297b643 GIT binary patch literal 12799 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 literal 0 HcmV?d00001 diff --git a/dist/docs/index.html b/dist/docs/index.html new file mode 100644 index 0000000..b843770 --- /dev/null +++ b/dist/docs/index.html @@ -0,0 +1,65 @@ + + + + + JSDoc: Home + + + + + + + + + + +