Skip to content

Commit

Permalink
Revert "Fix ppl commands (opensearch-project#8199) (opensearch-projec…
Browse files Browse the repository at this point in the history
…t#8283)"

This reverts commit 6511ee1.
  • Loading branch information
abbyhu2000 committed Sep 24, 2024
1 parent 5a6ae2f commit f775acf
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit f775acf

Please sign in to comment.