graphql-compose-elasticsearch
Version:
Elastic search via GraphQL
33 lines • 1.29 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getHistogramITC = void 0;
const utils_1 = require("../../../utils");
const FieldNames_1 = require("../../Commons/FieldNames");
function getHistogramITC(opts) {
const name = (0, utils_1.getTypeName)('AggsHistogram', opts);
const description = (0, utils_1.desc)(`
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.
[Documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-histogram-aggregation.html)
`);
return opts.getOrCreateITC(name, () => ({
name,
description,
fields: {
field: (0, FieldNames_1.getNumericFields)(opts),
interval: 'Float',
missing: 'Float',
min_doc_count: 'Int',
extended_bounds: `input ${(0, utils_1.getTypeName)('AggsHistogramBounds', opts)} {
min: Float
max: Float
}`,
order: 'JSON',
offset: 'Int',
keyed: 'Boolean',
},
}));
}
exports.getHistogramITC = getHistogramITC;
//# sourceMappingURL=Histogram.js.map