Skip to content

Commit

Permalink
get time field from data view
Browse files Browse the repository at this point in the history
  • Loading branch information
mattkime committed May 7, 2024
1 parent 7536b91 commit 88b8267
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ const defaultParams: OnlySearchSourceRuleParams = {
excludeHitsFromPreviousRun: true,
aggType: 'count',
groupBy: 'all',
timeField: 'time',
// this should be ignored when using a data view
timeField: 'timeFieldNotFromDataView',
};

describe('fetchSearchSourceQuery', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export function updateSearchSource(

searchSource.setField('size', isGroupAgg ? 0 : params.size);

const field = index.fields.find((f) => f.name === timeFieldName);
const field = index.getTimeField();
const filters = [
buildRangeFilter(
field!,
Expand Down

0 comments on commit 88b8267

Please sign in to comment.