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

Onboard normalization processor #311

Merged
merged 1 commit into from
Aug 26, 2024

Conversation

ohltyler
Copy link
Member

@ohltyler ohltyler commented Aug 26, 2024

Description

Adds the normalization search phase results processor under the "Enhance search results" section on the form. Under the hood, this processor runs in between the query and fetch phases. We abstract out those details on the UI.

More details

  • adds new NormalizationProcessor config class to persist its parameters, all of which are optional
  • adds a dedicated NormalizationProcessorInputs component instead of defaulting to the ConfigFieldList. The reason for this, is we want to have special form logic for inputting the weight parameters. As mentioned in the code comment, we can expand this to potentially link the weights to the configured query, enforce the length, etc. For now, just add some helper text and a link to the documentation
  • adds special parsing logic on config_to_template_utils to set up the properly-formatted JSON config body

Demo video, showing the configuration of the normalization processor. The generated JSON is below that.

screen-capture.4.webm

Generated valid search pipeline:

{
  "search_pipeline_f1f73f72f0a53947": {
    "request_processors": [],
    "response_processors": [],
    "phase_results_processors": [
      {
        "normalization-processor": {
          "normalization": {
            "technique": "min_max"
          },
          "combination": {
            "technique": "arithmetic_mean",
            "parameters": {
              "weights": [
                0.5,
                0.3,
                0.2
              ]
            }
          }
        }
      }
    ]
  }
}

Issues Resolved

Resolves #219

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
  • Commits are signed per the DCO using --signoff

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.

@saimedhi saimedhi merged commit e913e41 into opensearch-project:main Aug 26, 2024
9 of 10 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Aug 26, 2024
Signed-off-by: Tyler Ohlsen <[email protected]>
(cherry picked from commit e913e41)
@ohltyler ohltyler deleted the normalization-processor branch August 26, 2024 20:52
ohltyler added a commit that referenced this pull request Aug 26, 2024
Signed-off-by: Tyler Ohlsen <[email protected]>
(cherry picked from commit e913e41)

Co-authored-by: Tyler Ohlsen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Workflow editor] Integrate with other required processors
3 participants