大佬教程收集整理的这篇文章主要介绍了在 Elasticsearch 6.6 中将“父”转换为“子”,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
在 6.6 索引中,我有一个像这样的连接字段“关系”:
"relation": {
"type": "join","relations": {
"parent": "child"
}
数百个父文档需要成为另一个现有父文档的子文档。我有“降级”文档和“获胜者”文档的所有相关 _ID 值的列表。例如,我需要让 5678 成为 5677 的孩子
{
"_index": "myindex","_type": "place","_ID": "5678","_source": {
"children": [],"relation": {
"name": "parent"
}
}
},{
"_index": "myindex","_ID": "5677","relation": {
"name": "parent"
}
}
}
目前,所有子记录都包含“_routIng”:“1”。我不记得为什么我这样配置它,例如
{
"_index": "myindex","_ID": "6368962","_routIng": "1","relation": {
"parent": "13005543","name": "child"
}
}
}
所以降级文档的目标是...
{
"_index": "myindex","relation": {
"parent": "5677","name": "child"
}
}
}
我已经在 Kibana 控制台中尝试了这个 _update
POST myindex/place/5678/_update
{"script":{
"source": """
ctx._source.relation=params.relation;
ctx._source.children=params.children;""","lang": "painless","params":{
"relation": {"name":"child","parent":"5677"},"children": [] }
}}
并得到这个错误:
"[routIng] is missing for join fIEld [relation]"
我尝试将 ctx._routIng=1;
添加到脚本中,但没有效果。
有没有办法将父级“降级”为子级并指定其新父级?
谢谢
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)
以上是大佬教程为你收集整理的在 Elasticsearch 6.6 中将“父”转换为“子”全部内容,希望文章能够帮你解决在 Elasticsearch 6.6 中将“父”转换为“子”所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。