Skip to content

Add Support for Temporary Search Pipeline #1011

@tobiasschweizer

Description

@tobiasschweizer

Is your feature request related to a problem?

I was updating our TS code to @opensearch-project/opensearch 3.5.1 when I ran into an issue related to representing temporary search pipelines.

What solution would you like?

I would be great if a an API.Search_RequestBody had a property search_pipeline for a temporary score normalization processor used with hybrid queries.

What alternatives have you considered?

For now, I have made my own type:

export type HybridSearchRequest = API.Search_RequestBody & {
  search_pipeline: {
    phase_results_processors: any[];
  };
};

I've considered using Types.SearchPipeline_Common.SearchPipelineStructure, but parameters in ScoreCombination is not an object that could represent weights.

export type ScoreCombination = {
parameters?: number[];

Do you have any additional context?

The search request looks like this:

{
  "search_pipeline": {
    "phase_results_processors": [
      {
        "normalization-processor": {
          "normalization": {
            "technique": "min_max"
          },
          "combination": {
            "technique": "arithmetic_mean",
            "parameters": {
              "weights": [
                0.7,
                0.3
              ]
            }
          }
        }
      }
    ]
  },
  "query": {
    "hybrid": {
      "queries": [...]
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions