graphql-compose-elasticsearch
Version:
Elastic search via GraphQL
35 lines • 1.22 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getGeoShapeITC = void 0;
const utils_1 = require("../../../utils");
const FieldNames_1 = require("../../Commons/FieldNames");
function getGeoShapeITC(opts) {
const name = (0, utils_1.getTypeName)('QueryGeoShape', opts);
const description = (0, utils_1.desc)(`
Filter documents indexed using the geo_shape type.
Requires the geo_shape Mapping.
[Documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-geo-shape-query.html)
`);
const subName = (0, utils_1.getTypeName)('QueryGeoShapeSettings', opts);
const fields = (0, FieldNames_1.getGeoShapeAsFieldConfigMap)(opts, opts.getOrCreateITC(subName, () => ({
name: subName,
fields: {
shape: 'JSON',
relation: 'JSON',
indexed_shape: 'JSON',
},
})));
if (typeof fields === 'object') {
return opts.getOrCreateITC(name, () => ({
name,
description,
fields,
}));
}
return {
type: 'JSON',
description,
};
}
exports.getGeoShapeITC = getGeoShapeITC;
//# sourceMappingURL=GeoShape.js.map