Skip to content

Commit

Permalink
[ML] Fixing info content detector field selection
Browse files Browse the repository at this point in the history
  • Loading branch information
jgowdyelastic committed Nov 29, 2019
1 parent 1c2906c commit 31f00b6
Showing 1 changed file with 9 additions and 0 deletions.
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

0 comments on commit 31f00b6

Please sign in to comment.