mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Fixes issue reported in https://discuss.elastic.co/t/view-surrounding-documents-causes-failed-to-parse-date-field-exception/147234 The default date field format is `strict_date_optional_time||epoch_millis` so we didn't run into this during testing. If the user has custom mappings for their timestamp field and `epoch_millis` isn't one of the optional formats the context query will fail since it always sends the date in millis. This change forces the query to accept the date in millis.
This commit is contained in:
parent
108b524ae8
commit
a9f06c0595
3 changed files with 3 additions and 2 deletions
|
@ -103,7 +103,7 @@ describe('context app', function () {
|
|||
// should have started at the given time
|
||||
expect(intervals[0].gte).to.eql(MS_PER_DAY * 3000);
|
||||
// should have ended with a half-open interval
|
||||
expect(_.last(intervals)).to.only.have.key('gte');
|
||||
expect(_.last(intervals)).to.only.have.keys('gte', 'format');
|
||||
expect(intervals.length).to.be.greaterThan(1);
|
||||
|
||||
expect(hits).to.eql(searchSourceStub._stubHits.slice(0, 3));
|
||||
|
|
|
@ -103,7 +103,7 @@ describe('context app', function () {
|
|||
// should have started at the given time
|
||||
expect(intervals[0].lte).to.eql(MS_PER_DAY * 3000);
|
||||
// should have ended with a half-open interval
|
||||
expect(_.last(intervals)).to.only.have.key('lte');
|
||||
expect(_.last(intervals)).to.only.have.keys('lte', 'format');
|
||||
expect(intervals.length).to.be.greaterThan(1);
|
||||
|
||||
expect(hits).to.eql(searchSourceStub._stubHits.slice(-3));
|
||||
|
|
|
@ -216,6 +216,7 @@ function fetchContextProvider(indexPatterns, Private) {
|
|||
filter: {
|
||||
range: {
|
||||
[timeField]: {
|
||||
format: 'epoch_millis',
|
||||
...startRange,
|
||||
...endRange,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue