Mappings and Text Analysis
- Configure an index that implements a parent/child relationship
如何检索
-
image.png
-
datatype属于join
示例
PUT my_index
{
"mappings": {
"properties": {
"my_join_field": {
"type": "join",
"relations": {
"question": "answer"
}
}
}
}
}
PUT my_index/_doc/1?refresh
{
"text": "This is a question",
"my_join_field": {
"name": "question"
}
}
PUT my_index/_doc/2?refresh
{
"text": "This is another question",
"my_join_field": "question"
}
PUT my_index/_doc/3?routing=1&refresh=true
{
"text": "This is an answer",
"my_join_field": {
"name": "answer",
"parent": "1"
}
}
PUT my_index/_doc/4?routing=1&refresh=true
{
"text": "This is another answer",
"my_join_field": {
"name": "answer",
"parent": "1"
}
}
- name属性是写死的,不可变更,或者完全不写
网友评论