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

Aggregations fix: support include/exclude strings for IP and dates #18408

Closed
wants to merge 2 commits into from

Conversation

Projects
None yet
2 participants
@markharwood
Copy link
Contributor

commented May 17, 2016

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

This comment has been minimized.

Copy link
Contributor

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.

markharwood added some commits May 17, 2016

Aggregations fix: support include/exclude strings formatted for IP an…
…d date fields in terms and significant_terms aggregations.

Closes #17705

@markharwood markharwood force-pushed the markharwood:fix/17705 branch to 786a470 May 17, 2016

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");
}

This comment has been minimized.

Copy link
@markharwood

markharwood May 18, 2016

Author Contributor

@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?

This comment has been minimized.

Copy link
@jpountz

jpountz May 18, 2016

Contributor

This sounds right!

@jpountz

This comment has been minimized.

Copy link
Contributor

commented May 18, 2016

LGTM

@markharwood markharwood removed the review label May 18, 2016

@markharwood

This comment has been minimized.

Copy link
Contributor Author

commented May 18, 2016

Pushed in a846ff9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.