Identifying what terms were matched in a match query

Consider the following example query where we match a percentage of terms

    GET /_search
    {
      "query": {
        "bool": {
          "should": [
            {
              "match" : {
                "body": {
                  "query": "hello world textthatwontbefoundhere",
                  "search_analyzer": "custom_analyzer",
                  "minimum_should_match": "50%" 
                }
              }
            }
          ]
        }
      }
    }

Is there a way to identify what terms inside of the query were matched against so that we can inform the user in our UI what terms we are ignoring or are actually using from their input? (e.g. "showing results for 'hello world' instead of 'hello world textthatwontbefoundhere'") without running a full explain on the search?

the solution you are searching for would mean that the showing results for would potentially change for every hit.

Maybe you can use something like highlighting to give the user some more context about a search hit and thus let him/her decide easier.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.