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
Change exact match processor to match processor. #46041
Change exact match processor to match processor. #46041
Conversation
Besides a rename, this changes allows to processor to attach multiple enrich docs to the document being ingested. Also in order to control the maximum number of enrich docs to be included in the document being ingested, the `max_matches` setting is added to the enrich processor. Relates elastic#32789
Pinging @elastic/es-core-features |
@elasticmachine update branch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question below. other than that lgtm.
String matchField, | ||
boolean ignoreMissing, | ||
boolean overrideEnabled, | ||
int maxMatches) { | ||
this( | ||
tag, | ||
createSearchRunner(client), | ||
policyName, | ||
field, | ||
targetField, | ||
matchField, ignoreMissing, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not your change but it might be nice to put these on 2 lines too
if (searchHits.length == 1) { | ||
// If a document is returned, add its fields to the document | ||
Map<String, Object> enrichDocument = searchHits[0].getSourceAsMap(); | ||
ingestDocument.setFieldValue(targetField, enrichDocument); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this return the same structure (a list of maps) even with only 1 hit so the output is the same from the processor regardless of that field?
@elasticmachine run elasticsearch-ci/2 |
Besides a rename, this changes allows to processor to attach multiple enrich docs to the document being ingested. Also in order to control the maximum number of enrich docs to be included in the document being ingested, the `max_matches` setting is added to the enrich processor. Relates #32789
Besides a rename, this changes allows to processor to attach multiple
enrich docs to the document being ingested.
Also in order to control the maximum number of enrich docs to be
included in the document being ingested, the
max_matches
settingis added to the enrich processor.
Relates #32789