Add range match policy type for enrich#65781
Add range match policy type for enrich#65781probakowski wants to merge 15 commits intoelastic:masterfrom
Conversation
|
Pinging @elastic/es-core-features (Team:Core/Features) |
martijnvg
left a comment
There was a problem hiding this comment.
In general this looks good and the change is smaller than I thought it would be.
Can you also add docs for this new enrich policy type?
Maybe also add a rest test to CommonEnrichRestTestCase?
| } | ||
|
|
||
| if (EnrichPolicy.RANGE_MATCH_TYPES.contains(policyType)) { | ||
| // range match uses the same processor as simple match |
There was a problem hiding this comment.
Maybe extend the comment here by including that a term query on a range field is translated into a range query with the values as lower and upper value. If multiple values are provided then each value is translates into a range query and that is then combined into a boolean query with should clauses, which means that on of the provided values need to fall into the range of the range field.
jbaiera
left a comment
There was a problem hiding this comment.
Had just a few comments. +1 on adding some docs, but otherwise looks pretty good.
| private static final ParseField INDICES = new ParseField("indices"); | ||
| private static final ParseField MATCH_FIELD = new ParseField("match_field"); | ||
| private static final ParseField ENRICH_FIELDS = new ParseField("enrich_fields"); | ||
| private static final ParseField FORMAT = new ParseField("elasticsearch_version"); |
There was a problem hiding this comment.
I think this should use a different field name in the constructor
|
|
||
| private XContentBuilder resolveEnrichMapping(final EnrichPolicy policy) { | ||
| @SuppressWarnings("unchecked") | ||
| private XContentBuilder resolveEnrichMapping(final EnrichPolicy policy, GetIndexResponse getIndexResponse) { |
There was a problem hiding this comment.
is getIndexResponse used in this method?
|
@probakowski - can this be closed in favor of #76110 ? |
The tests got reused, and I think all functionality is covered, please reopen if these assumptions are false |
This change adds new policy types to support all range types as enrich fields. It also adds new
formatfield in enrich policy definition that lets you specify date format that will be used during creation of enrich indexCloses #59037