How to make matched_fields generic while highlighting - Elasticsearch

(Nikesh) #1

Hi all,

I am having duplicity in highlighting as few of my searches are matching in both .keyword and text field as well. So i am trying to employ "matched_fields" on all such fields.Problem is i don't know these fields at query time and there are too many such fields(around 100) which make my query very huge.

  "fields": {
      "field1": {
        "matched_fields": [
    "field2": {
            "matched_fields": [

Is there a way to make this generic? or is there any method that i can employ?

(system) closed #2

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