Elastic4s - how to express "matched_fields"

266 views Asked by At

I want to implement the following query in Elastic4s. Don't see any way to implement the matched_fields clause in the highlighter. Any help?

{
  "query": {
    "multi_match": {
      "type": "most_fields",
      "query": "hello world",
      "fields": [ "text", "text.human" ]
    }
  },
  "highlight": {
    "order": "score",
    "fields": {
      "text": {
        "matched_fields": [ "text", "text.human" ],
        "fragment_size": 100,
        "number_of_fragments": 10
      }
    }
  }
}
1

There are 1 answers

2
sksamuel On BEST ANSWER

A question with a very simple answer. You can't do it yet in elastic4s :)

So, I've just added it: https://github.com/sksamuel/elastic4s/commit/3f8a4e47ae603b7a3263bc3d31c27f2b6706cd8e

This will be in the next 1.5.x release and 1.6.0.