Skip to content

Commit

Permalink
[TSVB] Fixes bug with tophit aggregation and index not exist (elastic…
Browse files Browse the repository at this point in the history
…#106814)

* [TSVB] Fixes bug with tophit aggregation and no fields index

* Update src/plugins/vis_type_timeseries/public/application/components/aggs/top_hit.js

Co-authored-by: Alexey Antonov <[email protected]>

* Apply review comments

Co-authored-by: Alexey Antonov <[email protected]>
  • Loading branch information
stratoula and alexwizp committed Jul 28, 2021
1 parent 2c5f8e7 commit b2e1ecf
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ const TopHitAggUi = (props) => {
const handleSelectChange = createSelectHandler(handleChange);
const handleTextChange = createTextHandler(handleChange);
const fieldsSelector = getIndexPatternKey(indexPattern);
const field = fields[fieldsSelector].find((f) => f.name === model.field);
const field = fields?.[fieldsSelector]?.find((f) => f.name === model.field);
const aggWithOptions = getAggWithOptions(field, aggWithOptionsRestrictFields);
const orderOptions = getOrderOptions();

Expand Down

0 comments on commit b2e1ecf

Please sign in to comment.