Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kertal committed Feb 22, 2023
1 parent b590ba6 commit 6952750
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,13 @@ export async function getFieldCapabilities(params: FieldCapabilitiesParams) {
indexFilter,
fields,
});
const fieldsFromFieldCapsByName = keyBy(readFieldCapsResponse(esFieldCaps.body), 'name');
const fieldCapsArr = readFieldCapsResponse(esFieldCaps.body);
const fieldsFromFieldCapsByName = keyBy(fieldCapsArr, 'name');

const allFieldsUnsorted = Object.keys(fieldsFromFieldCapsByName)
// not all meta fields are provided, so remove and manually add
.filter((name) => !fieldsFromFieldCapsByName[name].metadata_field)
.concat(fieldsFromFieldCapsByName.length ? metaFields : [])
.concat(fieldCapsArr.length ? metaFields : [])
.reduce<{ names: string[]; map: Map<string, string> }>(
(agg, value) => {
// This is intentionally using a Map to be highly optimized with very large indexes AND be safe for user provided data
Expand Down

0 comments on commit 6952750

Please sign in to comment.