Es中处理父子关系的两种方式
1.nested类型
将goods类型设置为nested
这时候就可以查到数据了。
2.join类型
在mapping中指定字段类型为join
定义父子关系属性
PUT order
{
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0
},
"mappings": {
"properties": {
"id":{
"type": "keyword",
"doc_values": false,
"similarity": "boolean",
"norms": false
},
"name":{
"type": "text"
},
"ctime":{
"type": "long"
},
"pay":{
"type": "double"
},
"num":{
"type": "short"
},
"join_field":{
"type": "join",
"relations":{
"parent":"child"
}
}
}
}
}
标签:两种,join,number,父子关系,false,type,Es From: https://www.cnblogs.com/lisus2000/p/17273959.html