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

Translate Processor: Changed non-exact matching logic #3046

Merged
merged 1 commit into from
Jul 28, 2023

Conversation

vishalboin
Copy link
Contributor

Description

Previously when exact option is false, if there is a non-exact match, the target field will be populated with mapped value. This logic has been changed to:
If there is a non-exact match, the mapped value will be replaced in the source value in all occurences and placed in the target field.

For the following config:

  translate - 
    mappings:
      - source: status
        targets:
          - target: result
            regex:
              exact: false
              patterns:
                foo: bar
      - source: status2
        targets:
          - target: result2
            regex:
              exact: false
              patterns:
                foo: bar

Log:

{ 
  "status" : "footer", 
  "status2" : "foofoo"
}

Will be translated to:

{ 
  "status" : "footer", 
  "status2" : "foofoo",
  "result" : "barter", 
  "result2" : "barbar"
}

Issues Resolved

#1914

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • New functionality has javadoc added
  • Commits are signed with a real name per the DCO

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.

Signed-off-by: Vishal Boinapalli <[email protected]>
@vishalboin vishalboin changed the title Translate Processor: Changed non-exact mathching logic Translate Processor: Changed non-exact matching logic Jul 22, 2023
@kkondaka kkondaka merged commit 8c9c9ab into opensearch-project:main Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants