UNPKG

graphql-compose-elasticsearch

Version:
31 lines 1.35 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getDiversifiedSamplerITC = void 0; const utils_1 = require("../../../utils"); const Script_1 = require("../../Commons/Script"); const FieldNames_1 = require("../../Commons/FieldNames"); function getDiversifiedSamplerITC(opts) { const name = (0, utils_1.getTypeName)('AggsDiversifiedSampler', opts); const description = (0, utils_1.desc)(` A filtering aggregation used to limit any sub aggregations' processing to a sample of the top-scoring documents. Diversity settings are used to limit the number of matches that share a common value such as an "author". [Documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-diversified-sampler-aggregation.html) `); return opts.getOrCreateITC(name, () => ({ name, description, fields: { shard_size: { type: 'String', defaultValue: 100, }, field: (0, FieldNames_1.getAllFields)(opts), max_docs_per_value: 'Int', script: () => (0, Script_1.getCommonsScriptITC)(opts), execution_hint: 'String', }, })); } exports.getDiversifiedSamplerITC = getDiversifiedSamplerITC; //# sourceMappingURL=DiversifiedSampler.js.map