graphql-compose-elasticsearch
Version:
Elastic search via GraphQL
42 lines • 1.76 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getSimpleQueryStringITC = void 0;
const utils_1 = require("../../../utils");
function getSimpleQueryStringITC(opts) {
const name = (0, utils_1.getTypeName)('QuerySimpleQueryString', opts);
const description = (0, utils_1.desc)(`
A query that uses the SimpleQueryParser to parse its context.
Unlike the regular query_string query, the simple_query_string query
will never throw an exception, and discards invalid parts of the query.
Eg. "this AND that OR thus" or "(content:this OR name:this) AND (content:that OR name:that)"
[Documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-simple-query-string-query.html)
`);
return opts.getOrCreateITC(name, () => ({
name,
description,
fields: {
query: 'String!',
fields: '[String]',
default_operator: `enum ${(0, utils_1.getTypeName)('QuerySimpleQueryStringOperatorEnum', opts)} {
and
or
}`,
analyzer: 'String',
flags: {
type: 'String',
description: (0, utils_1.desc)(`
Can provided several flags, eg "OR|AND|PREFIX".
The available flags are: ALL, NONE, AND, OR, NOT, PREFIX, PHRASE,
PRECEDENCE, ESCAPE, WHITESPACE, FUZZY, NEAR, and SLOP.
`),
},
analyze_wildcard: 'Boolean',
lenient: 'Boolean',
minimum_should_match: 'String',
quote_field_suffix: 'String',
boost: 'Float',
},
}));
}
exports.getSimpleQueryStringITC = getSimpleQueryStringITC;
//# sourceMappingURL=SimpleQueryString.js.map