graphql-compose-elasticsearch
Version:
Elastic search via GraphQL
29 lines • 1.1 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getHasChildITC = void 0;
const Query_1 = require("../Query");
const utils_1 = require("../../../utils");
function getHasChildITC(opts) {
const name = (0, utils_1.getTypeName)('QueryHasChild', opts);
const description = (0, utils_1.desc)(`
The has_child filter accepts a query and the child type to run against,
and results in parent documents that have child docs matching the query.
[Documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-has-child-query.html)
`);
return opts.getOrCreateITC(name, () => ({
name,
description,
fields: {
type: 'String',
query: () => (0, Query_1.getQueryITC)(opts),
score_mode: {
type: 'String',
description: 'Can be: `avg`, `sum`, `max`, `min`, `none`.',
},
min_children: 'Int',
max_children: 'Int',
},
}));
}
exports.getHasChildITC = getHasChildITC;
//# sourceMappingURL=HasChild.js.map