graphql-compose-elasticsearch
Version:
Elastic search via GraphQL
27 lines • 962 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getTermsITC = void 0;
const utils_1 = require("../../../utils");
const FieldNames_1 = require("../../Commons/FieldNames");
function getTermsITC(opts) {
const name = (0, utils_1.getTypeName)('QueryTerms', opts);
const description = (0, utils_1.desc)(`
Filters documents that have fields that match any of
the provided terms (not analyzed). { fieldName: [values] }
[Documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-terms-query.html)
`);
const fields = (0, FieldNames_1.getAllAsFieldConfigMap)(opts, '[JSON]');
if (typeof fields === 'object') {
return opts.getOrCreateITC(name, () => ({
name,
description,
fields,
}));
}
return {
type: 'JSON',
description,
};
}
exports.getTermsITC = getTermsITC;
//# sourceMappingURL=Terms.js.map