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

Change exact match processor to match processor. #46041

Merged
merged 6 commits into from Sep 4, 2019

Conversation

martijnvg
Copy link
Member

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` setting
is added to the enrich processor.

Relates elastic#32789
@martijnvg martijnvg added >non-issue :Data Management/Ingest Node Execution or management of Ingest Pipelines including GeoIP labels Aug 27, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features

@martijnvg
Copy link
Member Author

@elasticmachine update branch

Copy link
Contributor

@hub-cap hub-cap left a 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,
Copy link
Contributor

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);
Copy link
Contributor

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?

@martijnvg
Copy link
Member Author

@elasticmachine run elasticsearch-ci/2

@martijnvg martijnvg merged commit 43ede36 into elastic:enrich Sep 4, 2019
martijnvg added a commit that referenced this pull request Sep 4, 2019
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Data Management/Ingest Node Execution or management of Ingest Pipelines including GeoIP >non-issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants