mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[ML] Fixing info content detector field selection (#51914)
* [ML] Fixing info content detector field selection * fixing test
This commit is contained in:
parent
51c7922518
commit
1c6bd0992c
2 changed files with 16 additions and 1 deletions
|
@ -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"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
|
@ -135,6 +135,7 @@ async function combineFieldsAndAggs(
|
|||
rollupFields: RollupFields
|
||||
): Promise<NewJobCaps> {
|
||||
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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue