renanleandrof
renanleandrof

Reputation: 6997

Elastic Search don't return highlight results

I'm sending a request like this:

{
    "from": 0, 
    "query": {
        "match": {
            "_all": "presidencia"
        }
    }
    ,
    "aggs": {
        //... some aggregations 
    }
    ,
    "highlight": {
        "fields": {
            "nomeOrgaoSuperior": {}
        }
    }
}

But my response doesn't come with highlight field. Response:

{
    "took": 68,
    "timed_out": false,
    "_shards": {"total": 15, "successful": 15, "failed": 0},
    "hits": {
        "total": 692785,
        "max_score": 0.48536316,
        "hits": [
            //Some hits...
        ]
    },
    "aggregations": {
        //some aggs ...
    }
}

Do i need some extra configuration on my index or what?

Upvotes: 1

Views: 2112

Answers (1)

renanleandrof
renanleandrof

Reputation: 6997

Found the problem. I was trying to use highlight on field that wasn't analysed by my analyser. So, my search was analysed and the fields i was trying to get the highlight wasn't. That made the highlighter to never return a match.

Upvotes: 6

Related Questions