mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[ML] Fix geo_shape not aggregetable and misaligned examples list in other_content (#92198)
This commit is contained in:
parent
5ab2d25006
commit
50b23e2176
8 changed files with 21 additions and 5 deletions
|
@ -9,6 +9,7 @@ export const ML_JOB_FIELD_TYPES = {
|
|||
BOOLEAN: 'boolean',
|
||||
DATE: 'date',
|
||||
GEO_POINT: 'geo_point',
|
||||
GEO_SHAPE: 'geo_shape',
|
||||
IP: 'ip',
|
||||
KEYWORD: 'keyword',
|
||||
NUMBER: 'number',
|
||||
|
|
|
@ -52,6 +52,7 @@ export const FieldTypeIcon: FC<FieldTypeIconProps> = ({
|
|||
color = 'euiColorVis7';
|
||||
break;
|
||||
case ML_JOB_FIELD_TYPES.GEO_POINT:
|
||||
case ML_JOB_FIELD_TYPES.GEO_SHAPE:
|
||||
iconType = 'tokenGeo';
|
||||
color = 'euiColorVis8';
|
||||
break;
|
||||
|
|
|
@ -52,6 +52,7 @@ export const IndexBasedDataVisualizerExpandedRow = ({
|
|||
return <DateContent config={config} />;
|
||||
|
||||
case ML_JOB_FIELD_TYPES.GEO_POINT:
|
||||
case ML_JOB_FIELD_TYPES.GEO_SHAPE:
|
||||
return (
|
||||
<GeoPointContent
|
||||
config={config}
|
||||
|
|
|
@ -38,12 +38,13 @@ export const GeoPointContent: FC<{
|
|||
indexPattern?.id !== undefined &&
|
||||
config !== undefined &&
|
||||
config.fieldName !== undefined &&
|
||||
config.type === ML_JOB_FIELD_TYPES.GEO_POINT
|
||||
(config.type === ML_JOB_FIELD_TYPES.GEO_POINT ||
|
||||
config.type === ML_JOB_FIELD_TYPES.GEO_SHAPE)
|
||||
) {
|
||||
const params = {
|
||||
indexPatternId: indexPattern.id,
|
||||
geoFieldName: config.fieldName,
|
||||
geoFieldType: config.type as ES_GEO_FIELD_TYPE.GEO_POINT,
|
||||
geoFieldType: config.type as ES_GEO_FIELD_TYPE,
|
||||
query: {
|
||||
query: combinedQuery.searchString,
|
||||
language: combinedQuery.searchQueryLanguage,
|
||||
|
@ -65,7 +66,7 @@ export const GeoPointContent: FC<{
|
|||
<ExpandedRowContent dataTestSubj={'mlDVIndexBasedMapContent'}>
|
||||
<DocumentStatsTable config={config} />
|
||||
|
||||
<EuiFlexItem>
|
||||
<EuiFlexItem style={{ maxWidth: '50%' }}>
|
||||
<ExamplesList examples={stats.examples} />
|
||||
</EuiFlexItem>
|
||||
<EuiFlexItem className={'mlDataVisualizerMapWrapper'}>
|
||||
|
|
|
@ -17,6 +17,7 @@ export const ML_JOB_FIELD_TYPES_OPTIONS = {
|
|||
[ML_JOB_FIELD_TYPES.BOOLEAN]: { name: 'Boolean', icon: 'tokenBoolean' },
|
||||
[ML_JOB_FIELD_TYPES.DATE]: { name: 'Date', icon: 'tokenDate' },
|
||||
[ML_JOB_FIELD_TYPES.GEO_POINT]: { name: 'Geo point', icon: 'tokenGeo' },
|
||||
[ML_JOB_FIELD_TYPES.GEO_SHAPE]: { name: 'Geo shape', icon: 'tokenGeo' },
|
||||
[ML_JOB_FIELD_TYPES.IP]: { name: 'IP address', icon: 'tokenIP' },
|
||||
[ML_JOB_FIELD_TYPES.KEYWORD]: { name: 'Keyword', icon: 'tokenKeyword' },
|
||||
[ML_JOB_FIELD_TYPES.NUMBER]: { name: 'Number', icon: 'tokenNumber' },
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
*/
|
||||
|
||||
import React, { FC } from 'react';
|
||||
import { EuiFlexItem } from '@elastic/eui';
|
||||
import type { FieldDataRowProps } from '../../types/field_data_row';
|
||||
import { ExamplesList } from '../../../index_based/components/field_data_row/examples_list';
|
||||
import { DocumentStatsTable } from './document_stats';
|
||||
|
@ -17,7 +18,11 @@ export const OtherContent: FC<FieldDataRowProps> = ({ config }) => {
|
|||
return (
|
||||
<ExpandedRowContent dataTestSubj={'mlDVOtherContent'}>
|
||||
<DocumentStatsTable config={config} />
|
||||
{Array.isArray(stats.examples) && <ExamplesList examples={stats.examples} />}
|
||||
{Array.isArray(stats.examples) && (
|
||||
<EuiFlexItem>
|
||||
<ExamplesList examples={stats.examples} />
|
||||
</EuiFlexItem>
|
||||
)}
|
||||
</ExpandedRowContent>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -35,6 +35,10 @@ export function kbnTypeToMLJobType(field: IFieldType) {
|
|||
case KBN_FIELD_TYPES.GEO_POINT:
|
||||
type = ML_JOB_FIELD_TYPES.GEO_POINT;
|
||||
break;
|
||||
case KBN_FIELD_TYPES.GEO_SHAPE:
|
||||
type = ML_JOB_FIELD_TYPES.GEO_SHAPE;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@ import {
|
|||
import { AggCardinality } from '../../../common/types/fields';
|
||||
import { getDatafeedAggregations } from '../../../common/util/datafeed_utils';
|
||||
import { Datafeed } from '../../../common/types/anomaly_detection_jobs';
|
||||
import { isPopulatedObject } from '../../../common/util/object_utils';
|
||||
|
||||
const SAMPLER_TOP_TERMS_THRESHOLD = 100000;
|
||||
const SAMPLER_TOP_TERMS_SHARD_SIZE = 5000;
|
||||
|
@ -638,7 +639,7 @@ export class DataVisualizer {
|
|||
filter: filterCriteria,
|
||||
},
|
||||
},
|
||||
aggs: buildSamplerAggregation(aggs, samplerShardSize),
|
||||
...(isPopulatedObject(aggs) ? { aggs: buildSamplerAggregation(aggs, samplerShardSize) } : {}),
|
||||
...runtimeMappings,
|
||||
};
|
||||
|
||||
|
@ -648,6 +649,7 @@ export class DataVisualizer {
|
|||
size,
|
||||
body: searchBody,
|
||||
});
|
||||
|
||||
const aggregations = body.aggregations;
|
||||
const totalCount = body.hits.total.value;
|
||||
const stats = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue