diff --git a/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.test.ts b/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.test.ts index 7add5cb4a4553..1baefb8f1aa1f 100644 --- a/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.test.ts +++ b/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.test.ts @@ -87,7 +87,6 @@ describe('AbstractSearchStrategy', () => { body: 'body', index: 'index', }, - indexType: undefined, }, { sessionId: '1', diff --git a/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts b/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts index 26c3a6c7c8bf7..f1601baf9e501 100644 --- a/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts +++ b/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts @@ -21,7 +21,7 @@ export abstract class AbstractSearchStrategy { requestContext: VisTypeTimeseriesRequestHandlerContext, req: VisTypeTimeseriesVisDataRequest, bodies: any[], - indexType?: string + strategy?: string ) { const requests: any[] = []; @@ -30,12 +30,14 @@ export abstract class AbstractSearchStrategy { requestContext.search .search( { - indexType, params: { ...body, }, }, - req.body.searchSession + { + ...req.body.searchSession, + ...(strategy ? { strategy } : {}), + } ) .toPromise() ); diff --git a/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/rollup_search_strategy.ts b/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/rollup_search_strategy.ts index 0ac00863d0a73..068e88db6dca1 100644 --- a/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/rollup_search_strategy.ts +++ b/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/rollup_search_strategy.ts @@ -18,6 +18,7 @@ import type { VisTypeTimeseriesVisDataRequest, } from '../../../types'; import { MAX_BUCKETS_SETTING } from '../../../../common/constants'; +import { ROLLUP_SEARCH_STRATEGY } from '../../../../../data/common'; const getRollupIndices = (rollupData: { [key: string]: any }) => Object.keys(rollupData); const isIndexPatternContainsWildcard = (indexPattern: string) => indexPattern.includes('*'); @@ -28,7 +29,7 @@ export class RollupSearchStrategy extends AbstractSearchStrategy { req: VisTypeTimeseriesVisDataRequest, bodies: any[] ) { - return super.search(requestContext, req, bodies, 'rollup'); + return super.search(requestContext, req, bodies, ROLLUP_SEARCH_STRATEGY); } async getRollupData(