graphql-compose-elasticsearch
Version:
Elastic search via GraphQL
34 lines • 1.25 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getTermsITC = void 0;
const utils_1 = require("../../../utils");
const Script_1 = require("../../Commons/Script");
const FieldNames_1 = require("../../Commons/FieldNames");
function getTermsITC(opts) {
const name = (0, utils_1.getTypeName)('AggsTerms', opts);
const description = (0, utils_1.desc)(`
A multi-bucket value source based aggregation where buckets
are dynamically built - one per unique value.
[Documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html)
`);
return opts.getOrCreateITC(name, () => ({
name,
description,
fields: {
field: () => (0, FieldNames_1.getTermFields)(opts),
size: {
type: 'Int',
defaultValue: 10,
},
shard_size: 'Int',
order: 'JSON',
include: 'JSON',
exclude: 'JSON',
script: () => (0, Script_1.getCommonsScriptITC)(opts),
execution_hint: 'String',
missing: 'JSON',
},
}));
}
exports.getTermsITC = getTermsITC;
//# sourceMappingURL=Terms.js.map