dsl-builder
Version:
OpenSearch Query Builder - Extract from OpenSearch Dashboards
25 lines (24 loc) • 677 B
JavaScript
/*
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Any modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/
import * as ast from '../ast';
export function buildNodeParams(child) {
return {
arguments: [child],
};
}
export function toOpenSearchQuery(node, indexPattern, config = {}, context = {}) {
const [argument] = node.arguments;
return {
bool: {
must_not: ast.toOpenSearchQuery(argument, indexPattern, config, context),
},
};
}