Highlighting matched results on _all fields

前端 未结 4 1170
一生所求
一生所求 2021-01-05 00:51

I want the matched results to be highlighted. This works for me if I mention the field name and it returns the highlighted text, however if I give the field as \"_all\", it

4条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-05 01:46

    To avoid the need to add _all as a stored field in your index

    An alternative quick fix: use * instead of _all:

    curl -XGET "http://localhost:9200/my_index/my_type/_search?q=stackoverflow&size=999" -d '{
      "highlight":{
        "fields":{
          "*":{}
        }
      }
    }'
    

提交回复
热议问题