Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ML] Fixing info content detector field selection #51914

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@
"min": "min"
},
"fieldIds": [
"airline",
"responsetime"
]
},
Expand All @@ -411,6 +412,7 @@
"min": "min"
},
"fieldIds": [
"airline",
"responsetime"
]
},
Expand All @@ -425,6 +427,7 @@
"min": "min"
},
"fieldIds": [
"airline",
"responsetime"
]
},
Expand Down Expand Up @@ -479,7 +482,10 @@
"aggIds": [
"distinct_count",
"high_distinct_count",
"low_distinct_count"
"low_distinct_count",
"info_content",
"high_info_content",
"low_info_content"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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:
Expand Down Expand Up @@ -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);
}
Expand Down