ml-commons: [BUG] search pipeline doesn't support one or more provided configuration parameters [processors]

What is the bug? Cannot configure an ml_inference processor in a search pipeline,

How can one reproduce the bug?

PUT _search/pipeline/ml_inference_pipeline
{
  "description": "Generate passage_embedding for searched documents",
  "processors": [
    {
      "ml_inference": {
        "model_id": "<ID>",
        "input_map": [
          {
            "inputs": "query.term.label.value"
          }
        ],
        "output_map": [
          {
            "query.term.label.value": "label"
          }        ]      }    }  ]}

Error:

    "type": "parse_exception",
    "reason": "pipeline [ml_inference_pipeline] doesn't support one or more provided configuration parameters [processors]"

What is the expected behavior? The search pipeline is created

What is your host/environment?

  • OS: Ubuntu 22.04
  • Opensearch Version: 2.19.1, 2.18.0
  • Plugins: default

Do you have any additional context? I’m trying to configure a sparse embeddings search with a remote model. The ingest pipeline works, the documents get indexed properly with chunks and token expansion from the remote model. Now, I’m trying to configure the corresponding search pipeline.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 22 (3 by maintainers)

Most upvoted comments

Finally! That was a missing comma in the query_template:

"vector": ${modelPredictionOutcome},

So, the working example for Opensearch 2.18 + Ollama API:

PUT _search/pipeline/ml_inference_request_test
{
  "description": "Generate passage_embedding for searched documents",
  "request_processors": [
    {
      "ml_inference": {
        "model_id": "RcmL3pUBZx_iX3O5QAxE",
        "full_response_path": true,
        "query_template": """
          {
            "query": {
              "knn": {
                "title_embedding": {
                  "vector": ${modelPredictionOutcome},
                  "k": 5
                }}}}
        """,
        "input_map": [
          {
            "input": "query.terms.title_embedding"
          }
        ],
        "output_map": [
          {
            "modelPredictionOutcome": "$.inference_results.*.output.*.dataAsMap.embeddings[0].*"
          }
        ],
        "ignore_missing": true,
        "ignore_failure": true
      }}]}

Search:

GET testindex/_search?search_pipeline=ml_inference_request_test
{
"query": {
  "terms": {
    "title_embedding": ["hard work"]
    } }}

That took some doing … Thank you for your help!

Will wait for a multilingual sparse (splade) Opensearch model to have a new challenge! 😃

using the term query:

  • does not work: "input": "query.term.title_embedding.value.*"
  • works: "input": "$..title_embedding.value"

And with disabled "full_response_path": false the output_map config:

  • both work:
    • "modelPredictionOutcome": "embeddings[0]"
    • "modelPredictionOutcome": "embeddings[0].*"

Thank again!