From f775acf007473bbd2d6911527a62e06e8d3fc411 Mon Sep 17 00:00:00 2001 From: abbyhu2000 Date: Tue, 24 Sep 2024 18:48:55 +0000 Subject: [PATCH] Revert "Fix ppl commands (#8199) (#8283)" This reverts commit 6511ee1dfc0ca3d9cbb87a9c6aa46e4d89061664. --- .../public/search/ppl_search_interceptor.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/plugins/query_enhancements/public/search/ppl_search_interceptor.ts b/src/plugins/query_enhancements/public/search/ppl_search_interceptor.ts index aecb7e32b009..973774e1d281 100644 --- a/src/plugins/query_enhancements/public/search/ppl_search_interceptor.ts +++ b/src/plugins/query_enhancements/public/search/ppl_search_interceptor.ts @@ -15,12 +15,12 @@ import { SearchInterceptorDeps, } from '../../../data/public'; import { + formatDate, + SEARCH_STRATEGY, API, EnhancedFetchContext, fetch, - formatDate, QueryAggConfig, - SEARCH_STRATEGY, } from '../../common'; import { QueryEnhancementsPluginStartDependencies } from '../types'; @@ -73,10 +73,8 @@ export class PPLSearchInterceptor extends SearchInterceptor { const query: Query = this.queryService.queryString.getQuery(); const dataset = query.dataset; if (!dataset || !dataset.timeFieldName) return query; - const [baseQuery, ...afterPipeParts] = query.query.split('|'); - const afterPipe = afterPipeParts.length > 0 ? ` | ${afterPipeParts.join('|').trim()}` : ''; const timeFilter = this.getTimeFilter(dataset.timeFieldName); - return { ...query, query: baseQuery + timeFilter + afterPipe }; + return { ...query, query: query.query + timeFilter }; } private getAggConfig(request: IOpenSearchDashboardsSearchRequest, query: Query) {