Skip to content

Change how max_matches affects target_field option. #47982

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

Merged
merged 6 commits into from
Oct 14, 2019

Conversation

martijnvg
Copy link
Member

Prior to this change the target_field would always be a json array
field in the document being ingested. This to take into account that
multiple enrich documents could be inserted into the target_field.

However the default max_matches is 1. Meaning that by default
only a single enrich document would be added to target_field json
array field.

This commit changes this; if max_matches is set to 1 then the single
document would be added as a json object to the target_field and
if it is configured to a higher value then the enrich documents will be
added as a json array (even if a single enrich document happens to be
enriched).

Prior to this change the `target_field` would always be a json array
field in the document being ingested. This to take into account that
multiple enrich documents could be inserted into the `target_field`.

However the default `max_matches` is `1`. Meaning that by default
only a single enrich document would be added to `target_field` json
array field.

This commit changes this; if `max_matches` is set to `1` then the single
document would be added as a json object to the `target_field` and
if it is configured to a higher value then the enrich documents will be
added as a json array (even if a single enrich document happens to be
enriched).
@martijnvg martijnvg added >non-issue :Data Management/Ingest Node Execution or management of Ingest Pipelines including GeoIP labels Oct 14, 2019
@martijnvg martijnvg requested review from hub-cap and jbaiera October 14, 2019 08:27
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features (:Core/Features/Ingest)

@martijnvg
Copy link
Member Author

@elasticmachine run elasticsearch-ci/2

@jrodewig
Copy link
Contributor

@martijnvg I pushed f047228, which included some additional doc changes that were needed.

Please feel free to adjust these. Thanks!

Copy link
Member

@jbaiera jbaiera left a comment

Choose a reason for hiding this comment

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

LGTM!

@martijnvg
Copy link
Member Author

@elasticmachine run elasticsearch-ci/packaging-sample

@martijnvg martijnvg merged commit ddf3bc2 into elastic:enrich Oct 14, 2019
martijnvg added a commit that referenced this pull request Oct 14, 2019
Prior to this change the `target_field` would always be a json array
field in the document being ingested. This to take into account that
multiple enrich documents could be inserted into the `target_field`.

However the default `max_matches` is `1`. Meaning that by default
only a single enrich document would be added to `target_field` json
array field.

This commit changes this; if `max_matches` is set to `1` then the single
document would be added as a json object to the `target_field` and
if it is configured to a higher value then the enrich documents will be
added as a json array (even if a single enrich document happens to be
enriched).
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.

4 participants