From 3664138217b15e37bf95237fa712c7bddb2ba36c Mon Sep 17 00:00:00 2001 From: Walter Rafelsberger Date: Wed, 1 Apr 2020 10:12:26 +0200 Subject: [PATCH] [ML] Adds a check if query is a match_all query. --- .../transform/public/app/common/request.ts | 2 +- .../step_define/step_define_summary.tsx | 41 +++++++++++-------- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/x-pack/plugins/transform/public/app/common/request.ts b/x-pack/plugins/transform/public/app/common/request.ts index 79fb3acb9fcaf..7e965dbe802c0 100644 --- a/x-pack/plugins/transform/public/app/common/request.ts +++ b/x-pack/plugins/transform/public/app/common/request.ts @@ -81,7 +81,7 @@ export function getPreviewRequestBody( }, }; - if (!isDefaultQuery(query)) { + if (!isDefaultQuery(query) && !isMatchAllQuery(query)) { request.source.query = query; } diff --git a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/step_define_summary.tsx b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/step_define_summary.tsx index a1e00fcd3b8ed..f31514e67003b 100644 --- a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/step_define_summary.tsx +++ b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/step_define_summary.tsx @@ -17,7 +17,7 @@ import { EuiText, } from '@elastic/eui'; -import { getPivotQuery, isDefaultQuery } from '../../../../common'; +import { getPivotQuery, isDefaultQuery, isMatchAllQuery } from '../../../../common'; import { PivotPreview } from '../../../../components/pivot_preview'; import { SearchItems } from '../../../../hooks/use_search_items'; @@ -60,24 +60,29 @@ export const StepDefineSummary: FC = ({ {searchString} )} - {typeof searchString === 'undefined' && !isDefaultQuery(pivotQuery) && ( - - - {JSON.stringify(pivotQuery, null, 2)} - - - )} + + {JSON.stringify(pivotQuery, null, 2)} + + + )} )}