graphql-compose-elasticsearch
Version:
Elastic search via GraphQL
25 lines • 1.01 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getTopHitsITC = void 0;
const utils_1 = require("../../../utils");
function getTopHitsITC(opts) {
const name = (0, utils_1.getTypeName)('AggsTopHits', opts);
const description = (0, utils_1.desc)(`
A top_hits metric aggregator keeps track of the most relevant document being
aggregated. This aggregator is intended to be used as a sub aggregator,
so that the top matching documents can be aggregated per bucket.
[Documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-top-hits-aggregation.html#search-aggregations-metrics-top-hits-aggregation)
`);
return opts.getOrCreateITC(name, () => ({
name,
description,
fields: {
from: 'Int',
size: 'Int',
sort: 'JSON',
_source: 'JSON',
},
}));
}
exports.getTopHitsITC = getTopHitsITC;
//# sourceMappingURL=TopHits.js.map