ElasticSearch highlight搜索结果高亮显示(英文检索)
生活随笔
收集整理的這篇文章主要介紹了
ElasticSearch highlight搜索结果高亮显示(英文检索)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
高亮顯示搜索結果(使用highlight)
#高亮搜索結果 GET /lib3/user/_search {"query":{"match":{"interests": "changge" } }, "highlight": { "fields": {"interests":{}}}} {"took" : 2075,"timed_out" : false,"_shards" : {"total" : 5,"successful" : 5,"skipped" : 0,"failed" : 0},"hits" : {"total" : 3,"max_score" : 0.6931472,"hits" : [{"_index" : "lib3","_type" : "user","_id" : "2","_score" : 0.6931472,"_source" : {"name" : "zhaoming","address" : "bei jing hai dian qu qing he zhen","age" : 20,"birthday" : "1998-10-12","interests" : "xi huan hejiu, duanlian, changge"},"highlight" : {"interests" : ["xi huan hejiu, duanlian, <em>changge</em>"]}},{"_index" : "lib3","_type" : "user","_id" : "5","_score" : 0.2876821,"_source" : {"name" : "zhangsan","address" : "bei jing chao yang qu","age" : 29,"birthday" : "1988-10-12","interests" : "xi huan tingyinyue , changge , tiaowu"},"highlight" : {"interests" : ["xi huan tingyinyue , <em>changge</em> , tiaowu"]}},{"_index" : "lib3","_type" : "user","_id" : "3","_score" : 0.2876821,"_source" : {"name" : "lisi","address" : "bei jing hai dian qu qing he zhen","age" : 23,"birthday" : "1998-10-12","interests" : "xi huan hejiu,duanlian, changge"},"highlight" : {"interests" : ["xi huan hejiu,duanlian, <em>changge</em>"]}}]} }我們通過結果可知使用highlight的字段被加了一個標簽,這個標簽就是高亮顯示標簽
總結
以上是生活随笔為你收集整理的ElasticSearch highlight搜索结果高亮显示(英文检索)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: tensorflow.python.fr
- 下一篇: So Hard