栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

在Elasticsearch 2.3.3中添加突出显示不适用于has_child查询

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

在Elasticsearch 2.3.3中添加突出显示不适用于has_child查询

这与git
问题中指定的错误有关。线程中提到的解决方法是在

highlight_query

范例:

PUT test{   "mappings": {      "my_parent": {         "_all": { "store": true         }      },      "my_child": {         "_parent": { "type": "my_parent"         }      }   }}PUT test/my_parent/1 {  "text": "This is a parent document"}PUT test/my_child/2?parent=1 {  "text": "This is a child document"}POST test/my_parent/_search{   "query": {      "bool": {         "must": [ {    "has_child": {       "type": "my_child",       "query": {          "match": {  "text": "child document"          }       }    } }, {    "match": {       "_all": "parent"    } }         ]      }   },   "highlight": {      "fields": {         "_all": {}      },      "highlight_query": {         "match": { "_all": "parent"         }      }   }}

结果:

  { "_index": "test", "_type": "my_parent", "_id": "1", "_score": 1.016466, "_source": {    "text": "This is a parent document" }, "highlight": {    "_all": [       "This is a <em>parent</em> document "    ] }         }

在Java
Client中,您应该可以通过此api实现它



转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/380847.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号