Skip to content

Commit

Permalink
fixes after elastic#124488
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomThomson committed Feb 14, 2022
1 parent 79ad483 commit 2425aac
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ export const setupOptionsListSuggestionsRoute = (
const rawEsResult = await esClient.search({ index, body }, { signal: abortController.signal });

// parse raw ES response into OptionsListSuggestionResponse
const totalCardinality = get(rawEsResult.body, 'aggregations.unique_terms.value');
const totalCardinality = get(rawEsResult, 'aggregations.unique_terms.value');

const suggestions = get(rawEsResult.body, 'aggregations.suggestions.buckets')?.map(
const suggestions = get(rawEsResult, 'aggregations.suggestions.buckets')?.map(
(suggestion: { key: string; key_as_string: string }) =>
fieldSpec?.type === 'string' ? suggestion.key : suggestion.key_as_string
);

const rawInvalidSuggestions = get(rawEsResult.body, 'aggregations.validation.buckets') as {
const rawInvalidSuggestions = get(rawEsResult, 'aggregations.validation.buckets') as {
[key: string]: { doc_count: number };
};
const invalidSelections =
Expand Down

0 comments on commit 2425aac

Please sign in to comment.