简体   繁体   English

Elasticsearch Delete API仅从一个分片中删除记录。 除非我手动删除并重建整个索引,否则仍然可以搜索该记录

[英]Elasticsearch delete api only deletes the record from one shard. The record still can be searched unless I manually delete & rebuild the whole index

Elasticsearch delete api only deletes the record from one shard. Elasticsearch Delete API仅从一个分片中删除记录。 The record still can be searched unless I manually delete & rebuild the whole index. 除非我手动删除并重建整个索引,否则仍然可以搜索该记录。

Following is the response of Delete API: 以下是Delete API的响应:

{"found":false,"_index":"companyindex","_type":"companydata","_id":"932","_version":1,"_shards":{"total":2,"successful":1,"failed":0}}

The issue was in document id. 问题出在文档ID中。 Actually, we were outputting user_id as document_id. 实际上,我们将user_id输出为document_id。 So the company_id was never going to be found. 因此,从未找到company_id。 Hence we got {"found : false} in the cURL response. 因此,我们在cURL响应中得到了{“ found:false}。

Sorry to say, question text also needs little bit modification. 抱歉地说,问题文本也需要一点修改。 Record was never deleted from 1 shard (after correcting myself, record exists on only node irrespective of how many shards it has) 记录从未从1个分片中删除(更正了自己之后,记录仅存在于节点上,而不管它有多少个分片)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM