Skip to content

Introduce mapping transformer to allow transform mappings during index create/update or index template create/update #17635

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

Conversation

bzhangam
Copy link
Contributor

Description

In this PR we introduce the mapping transformer to the core to allow transforming the mapping during index create/update and index template create/update. We want to do this because we have a use case in neural search plugin where we want to auto generate the semantic fields(e.g. knn_vector or rank_feature) in the mappings based on the model id defined in the semantic field(A new field type introduced by neural search plugin). In this way we can simplify the neural search set up.

Potentially in future this feature can be leveraged by other plugins to auto transform the mapping based on the certain config defined by users.

Related Issues

Resolves #[17500] - Proposal to introduce the mapping transformer into core.

#[803] - Proposal to support semantic field in neural search.
#[1211] - HLD of the semantic field.

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Copy link
Contributor

❕ Gradle check result for ceabd64: UNSTABLE

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

Copy link

codecov bot commented Apr 10, 2025

Codecov Report

Attention: Patch coverage is 83.59375% with 21 lines in your changes missing coverage. Please review.

Project coverage is 72.53%. Comparing base (5799fe7) to head (c57fbf4).
Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
...earch/index/mapper/MappingTransformerRegistry.java 80.48% 8 Missing ⚠️
...put/TransportPutComposableIndexTemplateAction.java 82.35% 1 Missing and 2 partials ⚠️
.../template/put/TransportPutIndexTemplateAction.java 85.00% 3 Missing ⚠️
...rg/opensearch/index/mapper/MappingTransformer.java 0.00% 3 Missing ⚠️
...plate/put/TransportPutComponentTemplateAction.java 87.50% 0 Missing and 2 partials ⚠️
...java/org/opensearch/cluster/metadata/Template.java 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #17635      +/-   ##
============================================
- Coverage     72.57%   72.53%   -0.05%     
- Complexity    67066    67103      +37     
============================================
  Files          5470     5475       +5     
  Lines        309697   309903     +206     
  Branches      45045    45065      +20     
============================================
+ Hits         224776   224790      +14     
- Misses        66602    66711     +109     
- Partials      18319    18402      +83     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

❕ Gradle check result for 077b13c: UNSTABLE

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

@bzhangam bzhangam force-pushed the introduceMappingTransformer branch from 12721cf to c88378f Compare April 14, 2025 17:37
Copy link
Contributor

❌ Gradle check result for c88378f: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

❌ Gradle check result for c88378f: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

❌ Gradle check result for 70be6d0: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@bzhangam bzhangam force-pushed the introduceMappingTransformer branch from afcad68 to c57fbf4 Compare April 15, 2025 17:06
Copy link
Contributor

❕ Gradle check result for c57fbf4: UNSTABLE

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

Copy link
Member

@saratvemulapalli saratvemulapalli left a comment

Choose a reason for hiding this comment

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

Thanks for taking care of the feedback @bzhangam !

@github-project-automation github-project-automation bot moved this from 🏗 In progress to 👀 In review in Cluster Manager Project Board Apr 15, 2025
@saratvemulapalli saratvemulapalli merged commit aa0e724 into opensearch-project:main Apr 15, 2025
31 checks passed
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Cluster Manager Project Board Apr 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cluster Manager enhancement Enhancement or improvement to existing feature or request Plugins
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

[RFC] Introduce Mapping Transformer
3 participants