Elasticsearch: Only show numbers in histogram field autocomplete (#38631)

This commit is contained in:
Giordano Ricci 2021-08-27 17:19:44 +01:00 committed by GitHub
parent 5898824a48
commit b5e4a0a39a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -60,6 +60,11 @@ describe('useFields hook', () => {
result.current();
expect(getFields).toHaveBeenLastCalledWith(['date'], timeRange);
// Histrogram only works on numbers
rerender('histogram');
result.current();
expect(getFields).toHaveBeenLastCalledWith(['number'], timeRange);
// Geohash Grid only works on geo_point data
rerender('geohash_grid');
result.current();

View File

@ -34,6 +34,8 @@ const getFilter = (type: AggregationType) => {
return ['date'];
case 'geohash_grid':
return ['geo_point'];
case 'histogram':
return ['number'];
default:
return [];
}