Fetch only matching result fields from Search query


(Paddy Mahadeva) #1

Hi,

I have a document with many text fields. I am running a search query on these fields using the below query

{
  "query": {
    "multi_match": {
      "query": "abc",
      "fields": ["UserName", "Company", "Email", "Phone"],
      "type" : "phrase_prefix"
    }
  }
}

which works well,

but I get the response in _source with the the whole data mapped to their keys, where as I need them in an array as comma seperated values, and also of only matching strings. How can I achieve the same?

Thanks
Paddy


(system) #2

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