[Maps] Support runtime fields in tooltips (#84377)

This commit is contained in:
Thomas Neirynck 2020-12-01 16:33:16 -05:00 committed by GitHub
parent 4ae84a00a5
commit 49f0ca0827
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -487,8 +487,14 @@ export class ESSearchSource extends AbstractESSource implements ITiledSingleLaye
return {};
}
const { docValueFields } = getDocValueAndSourceFields(
indexPattern,
this._getTooltipPropertyNames()
);
const initialSearchContext = { docvalue_fields: docValueFields }; // Request fields in docvalue_fields insted of _source
const searchService = getSearchService();
const searchSource = searchService.searchSource.createEmpty();
const searchSource = await searchService.searchSource.create(initialSearchContext as object);
searchSource.setField('index', indexPattern);
searchSource.setField('size', 1);