mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
This commit is contained in:
parent
207c773f21
commit
5ff09e72c5
3 changed files with 13 additions and 8 deletions
|
@ -23,3 +23,11 @@ export function getTermsFields(fields) {
|
|||
return field.aggregatable && ['number', 'boolean', 'date', 'ip', 'string'].includes(field.type);
|
||||
});
|
||||
}
|
||||
|
||||
// Returns filtered fields list containing only fields that exist in _source.
|
||||
export function getSourceFields(fields) {
|
||||
return fields.filter(field => {
|
||||
// Multi fields are not stored in _source and only exist in index.
|
||||
return field.subType !== 'multi';
|
||||
});
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ import { ES_SEARCH, ES_GEO_FIELD_TYPE, ES_SIZE_LIMIT } from '../../../../common/
|
|||
import { i18n } from '@kbn/i18n';
|
||||
import { getDataSourceLabel } from '../../../../common/i18n_getters';
|
||||
import { ESTooltipProperty } from '../../tooltips/es_tooltip_property';
|
||||
import { getTermsFields } from '../../../index_pattern_util';
|
||||
import { getSourceFields } from '../../../index_pattern_util';
|
||||
|
||||
import { DEFAULT_FILTER_BY_MAP_BOUNDS } from './constants';
|
||||
|
||||
|
@ -325,7 +325,8 @@ export class ESSearchSource extends AbstractESSource {
|
|||
|
||||
async getLeftJoinFields() {
|
||||
const indexPattern = await this._getIndexPattern();
|
||||
return getTermsFields(indexPattern.fields)
|
||||
// Left fields are retrieved from _source.
|
||||
return getSourceFields(indexPattern.fields)
|
||||
.map(field => {
|
||||
return { name: field.name, label: field.name };
|
||||
});
|
||||
|
|
|
@ -15,7 +15,7 @@ import { TooltipSelector } from '../../../components/tooltip_selector';
|
|||
|
||||
import { indexPatternService } from '../../../kibana_services';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { getTermsFields } from '../../../index_pattern_util';
|
||||
import { getTermsFields, getSourceFields } from '../../../index_pattern_util';
|
||||
import { ValidatedRange } from '../../../components/validated_range';
|
||||
|
||||
export class UpdateSourceEditor extends Component {
|
||||
|
@ -74,11 +74,7 @@ export class UpdateSourceEditor extends Component {
|
|||
|
||||
this.setState({
|
||||
dateFields,
|
||||
tooltipFields: indexPattern.fields.filter(field => {
|
||||
// Do not show multi fields as tooltip field options
|
||||
// since they do not have values in _source and exist for indexing only
|
||||
return field.subType !== 'multi';
|
||||
}),
|
||||
tooltipFields: getSourceFields(indexPattern.fields),
|
||||
termFields: getTermsFields(indexPattern.fields),
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue