Skip to content

Commit

Permalink
[ML] Fixes loading of data visualizer with KQL saved search (#51882)
Browse files Browse the repository at this point in the history
  • Loading branch information
peteharverson authored Nov 29, 2019
1 parent 62baeeb commit d92965a
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
EuiSpacer,
EuiTitle,
} from '@elastic/eui';
import { KBN_FIELD_TYPES, esQuery } from '../../../../../../../../src/plugins/data/public';
import { KBN_FIELD_TYPES, esQuery, esKuery } from '../../../../../../../../src/plugins/data/public';
import { NavigationMenu } from '../../components/navigation_menu';
import { ML_JOB_FIELD_TYPES } from '../../../../common/constants/field_types';
import { SEARCH_QUERY_LANGUAGE } from '../../../../common/constants/search';
Expand Down Expand Up @@ -180,12 +180,8 @@ export const Page: FC = () => {
const qryString = query.query;
let qry;
if (queryLanguage === SEARCH_QUERY_LANGUAGE.KUERY) {
qry = {
query_string: {
query: qryString,
default_operator: 'AND',
},
};
const ast = esKuery.fromKueryExpression(qryString);
qry = esKuery.toElasticsearchQuery(ast, currentIndexPattern);
} else {
qry = esQuery.luceneStringToDsl(qryString);
esQuery.decorateQuery(qry, kibanaConfig.get('query:queryString:options'));
Expand Down

0 comments on commit d92965a

Please sign in to comment.