I am working on a project that involves Elasticsearch. So far I can get most function to work except highlight. I am using Laravel + Elasticsearch official PHP client.
Previously I thought it was a problem of my PHP code, and asked a question here: highlight field missing from Elasticsearch results, PHP
Later when I tried with elasticsearch-head in browser, I still cannot see highlight field in results, so I guess there must be something wrong with either my settings of elasticsearch or the way I indexed the documents.
Here is the query I entered into elasticsearch-head:
{
"query" : {
"match" : {
"combined" : "DNA"
}
},
"highlight": {
"fields" : {
"combined" : {}
}
}
}
And I don't see "highlight" after "_source" in hits returned by elasticsearch.
What might I did wrong here?
Please advise,
Thanks.
Update: I'm running Elasticsearch 2.3.3, on Ubuntu 16.04 LTS desktop, JDK 1.8.
Documentation says "store" in mapping needs to be set true. I did so, and re-indexed a bunch of documents. This didn't fix the problem.