From e825faa3ac5396f1d19bc323dad30301cb781bad Mon Sep 17 00:00:00 2001 From: Melissa Alvarez Date: Thu, 16 Apr 2020 11:29:32 -0400 Subject: [PATCH] ensure boolean shows up correctly.no sorting by feature importance --- .../regression_exploration/results_table.tsx | 12 ++++++++++-- .../regression_exploration/use_explore_data.ts | 2 -- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/results_table.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/results_table.tsx index 82bebf9f4f12d..43fa50b2e4df5 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/results_table.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/results_table.tsx @@ -65,7 +65,7 @@ interface Props { export const ResultsTable: FC = React.memo( ({ indexPattern, jobConfig, jobStatus, setEvaluateSearchQuery }) => { const needsDestIndexFields = indexPattern && indexPattern.title === jobConfig.source.index[0]; - + const resultsField = jobConfig.dest.results_field; const { errorMessage, fieldTypes, @@ -93,6 +93,7 @@ export const ResultsTable: FC = React.memo( // Built-in values are ['boolean', 'currency', 'datetime', 'numeric', 'json'] // To fall back to the default string schema it needs to be undefined. let schema; + let isSortable = true; const type = fieldTypes[field]; const isNumber = type !== undefined && @@ -109,9 +110,16 @@ export const ResultsTable: FC = React.memo( case 'geo_point': schema = 'json'; break; + case 'boolean': + schema = 'boolean'; + break; + } + + if (field === `${resultsField}.feature_importance`) { + isSortable = false; } - return { id: field, schema }; + return { id: field, schema, isSortable }; }); const docFieldsCount = tableFields.length; diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/use_explore_data.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/use_explore_data.ts index f54050fa8ecd4..c68fe5b2cbee8 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/use_explore_data.ts +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/use_explore_data.ts @@ -24,7 +24,6 @@ import { DataFrameAnalyticsConfig, EsFieldName, INDEX_STATUS, - SEARCH_SIZE, } from '../../../../common'; import { Dictionary } from '../../../../../../../common/types/common'; import { isKeywordAndTextType } from '../../../../common/fields'; @@ -188,7 +187,6 @@ export const useExploreData = ( const resp: SearchResponse7 = await ml.esSearch({ index: jobConfig.dest.index, - size: SEARCH_SIZE, body: { query, from: pageIndex * pageSize,