1
我想在ElasticSearch中創建一個嵌套的文檔。elasticsearch映射解析器異常
結構: 標題,名稱,評論 評論是一個嵌套的文件 - 內部 - 評論& Star_Rating。 內部評論,名稱和地址。
這裏是下面提到的查詢。
PUT /sounduu
{
"mappings": {
"blogpost": {
"properties": {
"title": {
"type": "string"
},
"name": {
"type": "string"
},
"comments": {
"properties": {
"comment": {
"properties": {
"name": {
"type": "string"
},
"address": {
"type": "string"
}
}
},
"star_rating": {
"type": "long"
}
}
}
}
}
}
}
PUT /sounduu/blogpost/1
{
"title": "someh_title",
"name":"soundy",
"comments": {
"comment":"kuu",
[{
"name":"juwww",
"address":"eeeey"
},
{
"name":"jj",
"address":oo"
}]
},
"star_rating":6
}
錯誤:
{
"error": {
"root_cause": [
{
"type": "mapper_parsing_exception",
"reason": "object mapping for [comments.comment] tried to parse field [comment] as object, but found a concrete value"
}
],
"type": "mapper_parsing_exception",
"reason": "object mapping for [comments.comment] tried to parse field [comment] as object, but found a concrete value"
},
"status": 400
}
任何人都可以在這方面幫助?
ryanlutgen - 感謝您的回覆。如何使用「文本」屬性更新映射並移動評論內容? –
我已經編輯了我的答案,並舉例說明了在這種情況下我會做什麼。 – ryanlutgen
感謝您的回答。同樣的情況也適用於我!但是我期待的是,例如,我期待在文本中嵌入更多的文檔。 –