elastic-builder
Advanced tools
Comparing version 0.1.5 to 0.1.6
@@ -57,3 +57,3 @@ 'use strict'; | ||
/** | ||
* The precision_threshold options allows to trade memory for accuracy, | ||
* The `precision_threshold` options allows to trade memory for accuracy, | ||
* and defines a unique count below which counts are expected to be close to accurate. | ||
@@ -60,0 +60,0 @@ * |
'use strict'; | ||
exports.MetricsAggregationBase = require('./metrics-aggregation-base'); | ||
exports.AvgAggregation = require('./avg-aggregation'); | ||
@@ -4,0 +6,0 @@ exports.CardinalityAggregation = require('./cardinality-aggregation'); |
@@ -77,2 +77,3 @@ 'use strict'; | ||
checkType(_script, Script); | ||
this._aggsDef.script = _script; | ||
@@ -79,0 +80,0 @@ return this; |
@@ -113,6 +113,27 @@ 'use strict'; | ||
}, { | ||
key: 'tdigest', | ||
value: function tdigest(compression) { | ||
this._aggsDef.tdigest = { compression: compression }; | ||
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. | ||
* | ||
* Alias for `tdigest` | ||
* | ||
* @param {number} compression Parameter to balance memory utilization with estimation accuracy. | ||
* @returns {PercentileRanksAggregation} returns `this` so that calls can be chained | ||
*/ | ||
}, { | ||
key: 'compression', | ||
value: function compression(_compression) { | ||
this._aggsDef.tdigest = { compression: _compression }; | ||
return this; | ||
return this.tdigest(_compression); | ||
} | ||
@@ -119,0 +140,0 @@ |
@@ -92,2 +92,24 @@ 'use strict'; | ||
}, { | ||
key: 'tdigest', | ||
value: function tdigest(compression) { | ||
this._aggsDef.tdigest = { compression: compression }; | ||
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. | ||
* | ||
* Alias for `tdigest` | ||
* | ||
* @param {number} compression Parameter to balance memory utilization with estimation accuracy. | ||
* @returns {PercentileRanksAggregation} returns `this` so that calls can be chained | ||
*/ | ||
}, { | ||
key: 'compression', | ||
@@ -94,0 +116,0 @@ value: function compression(_compression) { |
@@ -124,3 +124,3 @@ 'use strict'; | ||
value: function combineScript(_combineScript) { | ||
this._aggsDef.map_script = _combineScript; | ||
this._aggsDef.combine_script = _combineScript; | ||
return this; | ||
@@ -144,3 +144,3 @@ } | ||
value: function reduceScript(_reduceScript) { | ||
this._aggsDef.map_script = _reduceScript; | ||
this._aggsDef.reduce_script = _reduceScript; | ||
return this; | ||
@@ -155,2 +155,4 @@ } | ||
* | ||
* If you specify script parameters then you must specify `"_agg": {}`. | ||
* | ||
* @param {Object} params Object passed to init, map and combine script. Default value - `{ "_agg": {} }` | ||
@@ -163,2 +165,3 @@ * @returns {ScriptedMetricAggregation} returns `this` so that calls can be chained | ||
value: function params(_params) { | ||
// TODO: If sure, add validation to see that _agg: {} is present in params | ||
this._aggsDef.params = _params; | ||
@@ -165,0 +168,0 @@ return this; |
@@ -142,2 +142,3 @@ 'use strict'; | ||
checkType(_sort, Sort); | ||
if (!has(this._aggsDef, 'sort')) this._aggsDef.sort = []; | ||
@@ -224,2 +225,3 @@ | ||
checkType(_highlight, Highlight); | ||
this._aggsDef.highlight = _highlight; | ||
@@ -283,2 +285,25 @@ return this; | ||
/** | ||
* Sets given dynamic document properties to be computed using supplied `Script`s. | ||
* | ||
* Object should have `scriptFieldName` as key and `script` as the value. | ||
* | ||
* @param {Object} scriptFields Object with `scriptFieldName` as key and `script` as the value. | ||
* @returns {TopHitsAggregation} returns `this` so that calls can be chained | ||
*/ | ||
}, { | ||
key: 'scriptFields', | ||
value: function scriptFields(_scriptFields) { | ||
var _this3 = this; | ||
checkType(_scriptFields, Object); | ||
forEach(Object.keys(_scriptFields), function (scriptFieldName) { | ||
return _this3.scriptField(scriptFieldName, _scriptFields[scriptFieldName]); | ||
}); | ||
return this; | ||
} | ||
/** | ||
* Allows to return the doc value representation of a field for each hit. | ||
@@ -285,0 +310,0 @@ * Doc value fields can work on fields that are not stored. |
{ | ||
"name": "elastic-builder", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"description": "A JavaScript implementation of the elasticsearch Query DSL", | ||
@@ -25,3 +25,3 @@ "main": "lib/index.js", | ||
"postversion": "npm run git-push", | ||
"git-commit": "git add docs browser && git commit -m \"Commit built files\"", | ||
"git-commit": "git add docs browser && git commit --no-verify -m \"Commit built files\"", | ||
"git-push": "cross-env \"git push origin master && git push origin v$npm_package_version\"" | ||
@@ -28,0 +28,0 @@ }, |
@@ -41,3 +41,3 @@ 'use strict'; | ||
/** | ||
* The precision_threshold options allows to trade memory for accuracy, | ||
* The `precision_threshold` options allows to trade memory for accuracy, | ||
* and defines a unique count below which counts are expected to be close to accurate. | ||
@@ -44,0 +44,0 @@ * |
'use strict'; | ||
exports.MetricsAggregationBase = require('./metrics-aggregation-base'); | ||
exports.AvgAggregation = require('./avg-aggregation'); | ||
@@ -4,0 +6,0 @@ exports.CardinalityAggregation = require('./cardinality-aggregation'); |
@@ -52,2 +52,3 @@ 'use strict'; | ||
checkType(script, Script); | ||
this._aggsDef.script = script; | ||
@@ -54,0 +55,0 @@ return this; |
@@ -87,3 +87,3 @@ 'use strict'; | ||
*/ | ||
compression(compression) { | ||
tdigest(compression) { | ||
this._aggsDef.tdigest = { compression }; | ||
@@ -94,2 +94,20 @@ 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. | ||
* | ||
* Alias for `tdigest` | ||
* | ||
* @param {number} compression Parameter to balance memory utilization with estimation accuracy. | ||
* @returns {PercentileRanksAggregation} returns `this` so that calls can be chained | ||
*/ | ||
compression(compression) { | ||
return this.tdigest(compression); | ||
} | ||
/** | ||
* HDR Histogram (High Dynamic Range Histogram) is an alternative implementation | ||
@@ -96,0 +114,0 @@ * that can be useful when calculating percentiles for latency measurements |
@@ -69,2 +69,21 @@ 'use strict'; | ||
*/ | ||
tdigest(compression) { | ||
this._aggsDef.tdigest = { compression }; | ||
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. | ||
* | ||
* Alias for `tdigest` | ||
* | ||
* @param {number} compression Parameter to balance memory utilization with estimation accuracy. | ||
* @returns {PercentileRanksAggregation} returns `this` so that calls can be chained | ||
*/ | ||
compression(compression) { | ||
@@ -71,0 +90,0 @@ this._aggsDef.tdigest = { compression }; |
@@ -93,3 +93,3 @@ 'use strict'; | ||
combineScript(combineScript) { | ||
this._aggsDef.map_script = combineScript; | ||
this._aggsDef.combine_script = combineScript; | ||
return this; | ||
@@ -110,3 +110,3 @@ } | ||
reduceScript(reduceScript) { | ||
this._aggsDef.map_script = reduceScript; | ||
this._aggsDef.reduce_script = reduceScript; | ||
return this; | ||
@@ -121,2 +121,4 @@ } | ||
* | ||
* If you specify script parameters then you must specify `"_agg": {}`. | ||
* | ||
* @param {Object} params Object passed to init, map and combine script. Default value - `{ "_agg": {} }` | ||
@@ -126,2 +128,3 @@ * @returns {ScriptedMetricAggregation} returns `this` so that calls can be chained | ||
params(params) { | ||
// TODO: If sure, add validation to see that _agg: {} is present in params | ||
this._aggsDef.params = params; | ||
@@ -128,0 +131,0 @@ return this; |
@@ -103,2 +103,3 @@ 'use strict'; | ||
checkType(sort, Sort); | ||
if (!has(this._aggsDef, 'sort')) this._aggsDef.sort = []; | ||
@@ -166,2 +167,3 @@ | ||
checkType(highlight, Highlight); | ||
this._aggsDef.highlight = highlight; | ||
@@ -216,2 +218,20 @@ return this; | ||
/** | ||
* Sets given dynamic document properties to be computed using supplied `Script`s. | ||
* | ||
* Object should have `scriptFieldName` as key and `script` as the value. | ||
* | ||
* @param {Object} scriptFields Object with `scriptFieldName` as key and `script` as the value. | ||
* @returns {TopHitsAggregation} returns `this` so that calls can be chained | ||
*/ | ||
scriptFields(scriptFields) { | ||
checkType(scriptFields, Object); | ||
forEach(Object.keys(scriptFields), scriptFieldName => | ||
this.scriptField(scriptFieldName, scriptFields[scriptFieldName]) | ||
); | ||
return this; | ||
} | ||
/** | ||
* Allows to return the doc value representation of a field for each hit. | ||
@@ -218,0 +238,0 @@ * Doc value fields can work on fields that are not stored. |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1305309
22957