<property name="createPagerIndice">
<![CDATA[{
"settings": {
"number_of_shards": 6,
"index.refresh_interval": "5s"
},
"mappings": {
"properties": {
"name": { ## 问题或者答案、评论名称
"type": "text",
"fields": { ##dsl注释 定义精确查找的内部keyword字段
"keyword": {
"type": "keyword"
}
}
},
"content": { ## 问题或者答案、评论内容
"type": "text",
"fields": { ##dsl注释 定义精确查找的内部keyword字段
"keyword": {
"type": "keyword"
}
}
},
"datatype": { ## 问题或者答案、评论类型 0 问题 1 答案 2 评论
"type": "integer"
},
"person": { ## 问题或者答案、评论创建人
"type": "text",
"fields": { ##dsl注释 定义精确查找的内部keyword字段
"keyword": {
"type": "keyword"
}
}
},
"created_date": { ## 注册日期
"type": "date",
"format": "yyyy-MM-dd HH:mm:ss.SSS||yyyy-MM-dd'T'HH:mm:ss.SSS||yyyy-MM-dd HH:mm:ss||epoch_millis"
},
"question_join": {
"type": "join",
"relations": {
"question": ["answer","comment"] ## 问题答案,问题评论,两个children
}
}
}
}
}]]>
</property>
如上,先创建正确的mapping