Julia Rechkunova 2023-05-04 11:11:18 +02:00 committed by GitHub
parent 0a9bbe7c1f
commit 396a2b63d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -200,6 +200,7 @@ describe('tabify_docs', () => {
_size: 12,
_score: 77,
_source: {},
invalid_meta: 'test',
},
],
},
@ -216,7 +217,7 @@ describe('tabify_docs', () => {
},
},
},
metaFields: ['_id', '_index', '_score', '_type', '_size'],
metaFields: ['_id', '_index', '_score', '_type', '_size', 'invalid_meta'],
fieldFormats: fieldFormats as any,
});
const table = tabifyDocs(responsePlugin, dataView);

View file

@ -107,7 +107,8 @@ export function flattenHit(hit: Hit, indexPattern?: DataView, params?: TabifyDoc
// Merge all valid meta fields into the flattened object
indexPattern?.metaFields?.forEach((fieldName) => {
const isExcludedMetaField = EXCLUDED_META_FIELDS.includes(fieldName) || fieldName.at(0) !== '_';
const isExcludedMetaField =
EXCLUDED_META_FIELDS.includes(fieldName) || fieldName.charAt(0) !== '_';
if (isExcludedMetaField) {
return;
}