弹性搜索不返回突出显示结果

ren*_*rof 1 elasticsearch

我正在发送这样的请求:

{
    "from": 0, 
    "query": {
        "match": {
            "_all": "presidencia"
        }
    }
    ,
    "aggs": {
        //... some aggregations 
    }
    ,
    "highlight": {
        "fields": {
            "nomeOrgaoSuperior": {}
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

但是我的回答并不包含突出显示字段。响应:

{
    "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 ...
    }
}
Run Code Online (Sandbox Code Playgroud)

我是否需要对索引进行一些额外的配置?

ren*_*rof 5

找到了问题。我试图在分析器未分析的字段上使用高光。因此,对我的搜索进行了分析,但我没有尝试突出显示的字段没有。这使得荧光笔永远不会返回匹配。