Skip to content

Conversation

@dnhatn
Copy link
Member

@dnhatn dnhatn commented May 12, 2023

We are developing a new component that enriches the search results during query time. The idea is to leverage the enrich policies and indices already used during indexing time. However, for the new component to function properly, we require the mapping types and doc_values of the enrich fields.

Currently, an enrich index can have multiple source indices, and any mapping conflicts that arise between the enrich fields of these source indices are ignored. However, with the upcoming changes, the enrich policy execution will fail if any mapping conflicts occur. We consider this change not as a breaking change, but rather as addressing a validation bug, as enrich fields should be consistent across source indices.

@dnhatn dnhatn added :Data Management/Ingest Node Execution or management of Ingest Pipelines including GeoIP >enhancement labels May 12, 2023
@elasticsearchmachine
Copy link
Collaborator

Hi @dnhatn, I've created a changelog YAML for you.

@dnhatn dnhatn requested review from jbaiera and martijnvg May 12, 2023 06:30
@dnhatn dnhatn marked this pull request as ready for review May 12, 2023 06:30
@elasticsearchmachine elasticsearchmachine added the Team:Data Management Meta label for data/management team label May 12, 2023
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

@dnhatn dnhatn requested a review from nik9000 May 12, 2023 15:44
Copy link
Member

@nik9000 nik9000 left a comment

Choose a reason for hiding this comment

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

The tests sure look like what we want.

@dnhatn
Copy link
Member Author

dnhatn commented May 13, 2023

@jbaiera @martijnvg I have updated this PR to maintain the current behavior. Populating the mapping for enrich fields is now a best-effort, which means we will ignore mapping conflicts that arise between the enrich fields of these source indices. I will have a follow-up to adjust this validation. Would you please take a look? Thank you!

Copy link
Member

@martijnvg martijnvg left a comment

Choose a reason for hiding this comment

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

LGTM

I think having the enrich fields mapped is a good change in general.
Enabling doc values by default does increase the size of the enrich index.
This shouldn't be too bad, given that an enrich index is designed to contain reference data set for lookups, an enrich index usually isn't that large. And it allows enrich to be used at query time for join like functionality. Down the line enrich indices could be configured to not store _source or the synthesise _source at runtime.

@dnhatn
Copy link
Member Author

dnhatn commented May 16, 2023

@nik9000 @martijnvg Thank you for reviews.

@dnhatn dnhatn merged commit 00afc5b into elastic:main May 16, 2023
@dnhatn dnhatn deleted the enrich-mappings branch May 16, 2023 16:55
dnhatn added a commit to dnhatn/elasticsearch that referenced this pull request Aug 21, 2023
dnhatn added a commit that referenced this pull request Aug 23, 2023
We implemented a mapping change to enrich indices to support enrich in ESQL. Unfortunately, that change does not interact well with object fields. While we are actively addressing this issue, a comprehensive solution will take some time. To mitigate the impact of this bug, this PR will revert the mapping change for 8.9 and 8.10. The reason is that enrich for ESQL isn't required until 8.11. Relates #98019
dnhatn added a commit to dnhatn/elasticsearch that referenced this pull request Aug 23, 2023
We implemented a mapping change to enrich indices to support enrich in ESQL. Unfortunately, that change does not interact well with object fields. While we are actively addressing this issue, a comprehensive solution will take some time. To mitigate the impact of this bug, this PR will revert the mapping change for 8.9 and 8.10. The reason is that enrich for ESQL isn't required until 8.11. Relates elastic#98019
elasticsearchmachine pushed a commit that referenced this pull request Aug 23, 2023
We implemented a mapping change to enrich indices to support enrich in ESQL. Unfortunately, that change does not interact well with object fields. While we are actively addressing this issue, a comprehensive solution will take some time. To mitigate the impact of this bug, this PR will revert the mapping change for 8.9 and 8.10. The reason is that enrich for ESQL isn't required until 8.11. Relates #98019
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 >enhancement Team:Data Management Meta label for data/management team v8.9.0

4 participants