diff --git a/x-pack/legacy/plugins/ml/server/models/job_service/new_job_caps/__mocks__/results/farequote_job_caps.json b/x-pack/legacy/plugins/ml/server/models/job_service/new_job_caps/__mocks__/results/farequote_job_caps.json index c005d9a5b5aaa..9c10f9083be5e 100644 --- a/x-pack/legacy/plugins/ml/server/models/job_service/new_job_caps/__mocks__/results/farequote_job_caps.json +++ b/x-pack/legacy/plugins/ml/server/models/job_service/new_job_caps/__mocks__/results/farequote_job_caps.json @@ -397,6 +397,7 @@ "min": "min" }, "fieldIds": [ + "airline", "responsetime" ] }, @@ -411,6 +412,7 @@ "min": "min" }, "fieldIds": [ + "airline", "responsetime" ] }, @@ -425,6 +427,7 @@ "min": "min" }, "fieldIds": [ + "airline", "responsetime" ] }, @@ -479,7 +482,10 @@ "aggIds": [ "distinct_count", "high_distinct_count", - "low_distinct_count" + "low_distinct_count", + "info_content", + "high_info_content", + "low_info_content" ] }, { diff --git a/x-pack/legacy/plugins/ml/server/models/job_service/new_job_caps/field_service.ts b/x-pack/legacy/plugins/ml/server/models/job_service/new_job_caps/field_service.ts index 2521250642ac3..0de5fe14bb346 100644 --- a/x-pack/legacy/plugins/ml/server/models/job_service/new_job_caps/field_service.ts +++ b/x-pack/legacy/plugins/ml/server/models/job_service/new_job_caps/field_service.ts @@ -135,6 +135,7 @@ async function combineFieldsAndAggs( rollupFields: RollupFields ): Promise { const keywordFields = getKeywordFields(fields); + const textFields = getTextFields(fields); const numericalFields = getNumericalFields(fields); const ipFields = getIpFields(fields); const geoFields = getGeoFields(fields); @@ -148,6 +149,10 @@ async function combineFieldsAndAggs( case ML_JOB_AGGREGATION.LAT_LONG: geoFields.forEach(f => mix(f, a)); break; + case ML_JOB_AGGREGATION.INFO_CONTENT: + case ML_JOB_AGGREGATION.HIGH_INFO_CONTENT: + case ML_JOB_AGGREGATION.LOW_INFO_CONTENT: + textFields.forEach(f => mix(f, a)); case ML_JOB_AGGREGATION.DISTINCT_COUNT: case ML_JOB_AGGREGATION.HIGH_DISTINCT_COUNT: case ML_JOB_AGGREGATION.LOW_DISTINCT_COUNT: @@ -220,6 +225,10 @@ function getKeywordFields(fields: Field[]): Field[] { return fields.filter(f => f.type === ES_FIELD_TYPES.KEYWORD); } +function getTextFields(fields: Field[]): Field[] { + return fields.filter(f => f.type === ES_FIELD_TYPES.TEXT); +} + function getIpFields(fields: Field[]): Field[] { return fields.filter(f => f.type === ES_FIELD_TYPES.IP); }