Skip to content

Commit

Permalink
[TSVB] Fixes bug with tophit aggregation and index not exist (#106814)
Browse files Browse the repository at this point in the history
* [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 d796576 commit 715a7ca
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,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 715a7ca

Please sign in to comment.