父子表修改mapping文件增加新的子表关联
原始的mapping
PUT join_ext_index1
{
"mappings": {
"_doc": {
"properties": {
"my_join_field": {
"type": "join",
"relations": {
"question": ["answer", "comment"]
}
}
}
}
}
查看mapping
GET join_ext_index1/_mapping
{
"join_ext_index1" : {
"mappings" : {
"_doc" : {
"properties" : {
"my_join_field" : {
"type" : "join",
"eager_global_ordinals" : true,
"relations" : {
"question" : [
"answer",
"comment"
]
}
}
}
}
}
}
}
修改mapping,新增子表关联
PUT join_ext_index1/_mapping/_doc
{
"properties": {
"my_join_field": {
"type": "join",
"relations": {
"question": ["answer", "comment","test"]
}
}
}
}
查看mapping
GET join_ext_index1/_mapping
{
"join_ext_index1" : {
"mappings" : {
"_doc" : {
"properties" : {
"my_join_field" : {
"type" : "join",
"eager_global_ordinals" : true,
"relations" : {
"question" : [
"answer",
"test",
"comment"
]
}
}
}
}
}
}
}
参考文章: