Skip to content

Commit

Permalink
[Discover] Fix flattening of _source fields of objects (elastic#136473)
Browse files Browse the repository at this point in the history
- when fetching _source nested objects like obj.rootKey.subkey1, object.rootKey.subkey2 were not flattened correctly

(cherry picked from commit 0c78f8a)

# Conflicts:
#	x-pack/test/reporting_api_integration/reporting_and_security/__snapshots__/download_csv_dashboard.snap
  • Loading branch information
dimaanj committed Jul 25, 2022
1 parent 21e94e1 commit 44cce9c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/plugins/data/common/search/tabify/tabify_docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export function flattenHit(hit: Hit, indexPattern?: IndexPattern, params?: Tabif
continue;
}

const hasValidMapping = field?.type !== 'conflict';
const hasValidMapping = field && field.type !== 'conflict';
const isValue = !isPlainObject(val);

if (hasValidMapping || isValue) {
Expand Down

0 comments on commit 44cce9c

Please sign in to comment.