Skip to content

Conversation

@markharwood
Copy link
Contributor

Added calls to DocValueFormat.parse methods to handle parsing of user-supplied include and exclude strings in terms and significant_terms aggregations into a form that can be compared with doc values

Closes #17705

@jpountz
Copy link
Contributor

jpountz commented May 17, 2016

Could you also test that regexp-based filtering on ips is not supported? I think convertToStringFilter and convertToOrdinalsFilter should fail when the format is not DocValueFormat.RAW? Otherwise it looks good to me.

if ((includeExclude != null) && (includeExclude.isRegexBased()) && format != DocValueFormat.RAW) {
throw new AggregationExecutionException("Aggregation [" + name + "] cannot support regular expression style include/exclude "
+ "settings as they can only be applied to string fields. Use an array of values for include/exclude clauses");
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jpountz rather than adding a specialized test for IP field types I test for regex && format!=DocValueFormat.RAW && (valuesSource instanceof ValuesSource.Bytes)
Is this too broad?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sounds right!

@jpountz
Copy link
Contributor

jpountz commented May 18, 2016

LGTM

@markharwood
Copy link
Contributor Author

Pushed in a846ff9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants