2

The query for getting data using elastic search and highlighting is this

GET /autocomplete_test/doc/_search
{
     "size": 10,
     "query": {
        "match": {
           "_all": {
              "query": "lor",
              "operator": "and"
           }
        }
     },
     "highlight": { 
       "fields": { 
       "_all":{} 
      } 
    }
}

This query returns the data that I want exactly correct but when I use this url

  GET /autocomplete_test/doc/_search/?q=lor&highlight=(fields:_all)&pretty=True

it does not return the highlight in the response so what do I need to write in the url to get the correct response as I am getting from the query?

Val
  • 207,596
  • 13
  • 358
  • 360
Johnny F
  • 21
  • 2
  • Hi, this could be helpful for you, no? http://stackoverflow.com/questions/12195017/different-result-when-using-get-post-in-elastic-search you could send your query like it's described in accepted answer – Evaldas Buinauskas May 21 '15 at 17:15
  • I'd go as @EvaldasBuinauskas said, i.e. inline your query in the URL using the `?source=...` parameter, because the `highlight` parameter is not supported. – Val May 21 '15 at 21:20
  • @EvaldasBuinauskas - I was looking for the exact thing. Thanks for directing me to the correct answer. It worked smooth. – Johnny F May 26 '15 at 13:13

0 Answers0