Skip to content

Commit

Permalink
fix rollup in timeseries
Browse files Browse the repository at this point in the history
  • Loading branch information
Dosant committed Apr 23, 2021
1 parent e2aaa42 commit 2b08df0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ describe('AbstractSearchStrategy', () => {
body: 'body',
index: 'index',
},
indexType: undefined,
},
{
sessionId: '1',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export abstract class AbstractSearchStrategy {
requestContext: VisTypeTimeseriesRequestHandlerContext,
req: VisTypeTimeseriesVisDataRequest,
bodies: any[],
indexType?: string
strategy?: string
) {
const requests: any[] = [];

Expand All @@ -30,12 +30,14 @@ export abstract class AbstractSearchStrategy {
requestContext.search
.search(
{
indexType,
params: {
...body,
},
},
req.body.searchSession
{
...req.body.searchSession,
...(strategy ? { strategy } : {}),
}
)
.toPromise()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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('*');
Expand All @@ -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(
Expand Down

0 comments on commit 2b08df0

Please sign in to comment.