graphql-compose-elasticsearch
Version:
Elastic search via GraphQL
29 lines • 1.24 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getRangeITC = void 0;
const utils_1 = require("../../../utils");
const Float_1 = require("../../Commons/Float");
const Script_1 = require("../../Commons/Script");
const FieldNames_1 = require("../../Commons/FieldNames");
function getRangeITC(opts) {
const name = (0, utils_1.getTypeName)('AggsRange', opts);
const description = (0, utils_1.desc)(`
A multi-bucket value source based aggregation that enables the user
to define a set of ranges - each representing a bucket.
Note that this aggregation includes the \`from\` value and excludes the
\`to\` value for each range.
[Documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-range-aggregation.html)
`);
return opts.getOrCreateITC(name, () => ({
name,
description,
fields: {
field: (0, FieldNames_1.getNumericFields)(opts),
ranges: () => [(0, Float_1.getFloatRangeKeyedITC)(opts)],
keyed: 'Boolean',
script: () => (0, Script_1.getCommonsScriptITC)(opts),
},
}));
}
exports.getRangeITC = getRangeITC;
//# sourceMappingURL=Range.js.map