Java ElasticSearch缺少文档异常
在我的ElasticSearch中对文档编制了索引,但在ElasticSearch中更新时,它会出现文档源缺失异常Java ElasticSearch缺少文档异常,java,elasticsearch,Java,elasticsearch,在我的ElasticSearch中对文档编制了索引,但在ElasticSearch中更新时,它会出现文档源缺失异常 GET /ps_topcat_24/products/_search { "query":{ "match": { "_id": "957680208f55e89f407c6a479c9f3c9d" } }, "fields":["price"] } 专家组的答复: { "took": 2, "timed_out": false, "_s
GET /ps_topcat_24/products/_search
{
"query":{
"match": {
"_id": "957680208f55e89f407c6a479c9f3c9d"
}
},
"fields":["price"]
}
专家组的答复:
{
"took": 2,
"timed_out": false,
"_shards": {
"total": 6,
"successful": 6,
"failed": 0
},
"hits": {
"total": 1,
"max_score": 1,
"hits": [
{
"_index": "ps_topcat_24",
"_type": "products",
"_id": "957680208f55e89f407c6a479c9f3c9d",
"_score": 1,
"fields": {
"price": [
28.99
]
}
}
]
}
}
这清楚地表明了文件的存在
但是更新不起作用
POST/ps_topcat_24/products/957680208f55e89f407c6a479c9f3c9d/_update
{
"doc":{
"matching_id":"test-sourabh"
}
}
它给
{
"error": {
"root_cause": [
{
"type": "document_source_missing_exception",
"reason": "[products][957680208f55e89f407c6a479c9f3c9d]: document source missing",
"shard": "2",
"index": "ps_topcat_24"
}
],
"type": "document_source_missing_exception",
"reason": "[products][957680208f55e89f407c6a479c9f3c9d]: document source missing",
"shard": "2",
"index": "ps_topcat_24"
},
"status": 400
}
有什么建议吗?如果您在查询中删除
“字段”:[“价格”]
,您会得到什么?响应保持不变,只是响应中没有显示价格您介意分享您在响应中看到的确切信息吗?我猜您没有存储文档源(即,映射中禁用了\u source)是\u source enabled是false。这会影响文档的索引吗?是的,这就是您无法运行部分更新的原因。您可以尝试重新索引完整文档(即将完整文档发布到/ps\u topcat\u 24/products/957680208f55e89f407c6a479c9f3c9d
),而不是只更新一个字段。