neural-search icon indicating copy to clipboard operation
neural-search copied to clipboard

[BUG] Plain highlighter fails with neural query and filter

Open tenpura-shrimp opened this issue 1 year ago • 3 comments

Describe the bug

Passing the filter parameter causes the search query to fail when the plain highlighter is enabled. I did a query with the filter parameter following the docs here: https://opensearch.org/docs/latest/query-dsl/specialized/neural/

The failure happens even when the filter is match_all, which shouldn't affect the results, so this appears to be a bug in the opensearch implementation.

Related component

Search

To Reproduce

Run the following query


GET /utterance-3/_search
{
  "highlight" : {
    "fields" : {
      "plainText" : {
        "type" : "plain"
      }
    },
    "fragment_size" : 10000,
    "post_tags" : [ "bbq" ],
    "pre_tags" : [ "wtf" ]
  },
  "query" : {
    "neural" : {
      "passage_embedding" : {
        "query_text" : "exam",
        "model_id" : "ubssVI4BA1L0FKVMp3Mf",
        "k" : 10,
        "filter" : {
          "match_all": {}
        }
      }
    }
  },
  "size" : 21
}

The result is the following failure:

{
  "took": 314,
  "timed_out": false,
  "_shards": {
    "total": 6,
    "successful": 3,
    "skipped": 0,
    "failed": 3,
    "failures": [
      {
        "shard": 0,
        "index": "utterance-3",
        "node": "bawq-EOJSFWPoEJNao2LUg",
        "reason": {
          "type": "unsupported_operation_exception",
          "reason": null
        }
      }
    ]
  },
  "hits": {
    "total": {
      "value": 60,
      "relation": "eq"
    },
    "max_score": 0.6048681,
    "hits": []
  }
}

Removing the filter makes it work

Expected behavior

The query should succeed

Additional Details

Plugins Please list all plugins currently enabled.

Screenshots If applicable, add screenshots to help explain your problem.

Host/Environment (please complete the following information):

  • OS: Amazon Opensearch Service
  • Version 2.11.1

Additional context Add any other context about the problem here.

tenpura-shrimp avatar May 06 '24 17:05 tenpura-shrimp

Thanks for reporting this. Try turning it into a REST test?

dblock avatar May 07 '24 06:05 dblock

@opensearch-project/triage Can this be transferred to https://github.com/opensearch-project/neural-search as this the neural query is executed by that plugin?

andrross avatar May 08 '24 15:05 andrross

@tenpura-shrimp can you please add the index mappings which you used to create the index.

navneet1v avatar May 08 '24 20:05 navneet1v

Neural query does not work with highlighting this is being tracked in #145 . Closing this one

jmazanec15 avatar Oct 02 '24 00:10 jmazanec15