add comment about docvalue for date fields in getComputedFields (#25725)

This commit is contained in:
Nathan Reese 2018-11-19 13:22:04 -07:00 committed by GitHub
parent 708638899f
commit 0958e1d1d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,13 +18,15 @@
*/
import _ from 'lodash';
// Takes a hit, merges it with any stored/scripted fields, and with the metaFields
// returns a flattened version
export function getComputedFields() {
const self = this;
const scriptFields = {};
let docvalueFields = [];
// Date value returned in "_source" could be in any number of formats
// Use a docvalue for each date field to ensure standardized formats when working with date fields
// indexPattern.flattenHit will override "_source" values when the same field is also defined in "fields"
docvalueFields = _.reject(self.fields.byType.date, 'scripted')
.map((dateField) => {
return {