[英]Delete Document from AWS CloudSearch
I am attempting to delete a single document in AWS CloudSearch using the following batch document: 我正在尝试使用以下批处理文档删除AWS CloudSearch中的单个文档:
[{
"type": "delete",
"id": "532177"
}]
but I get the following error from AWS: 但我从AWS收到以下错误:
and when download the SDF it returns the following: 并在下载SDF时返回以下内容:
[
{
type: "add",
id: "delete_img_json",
version: 1406072053,
lang: "en",
fields: {
content: "[{ "type": "delete", "id": "532177" }]",
resourcename: "Delete_IMG.json",
content_encoding: "ISO-8859-2",
content_type: "application/json"
}
}
]
All I am attempting to do is remove a single document from my CloudSearch index. 我试图做的就是从我的CloudSearch索引中删除单个文档。
I get the same error as you when I try to upload a single document that is not part of a batch: 当我尝试上传不属于批处理的单个文档时,我得到的错误与您相同:
{
"type": "delete",
"id": "4e41b5a6f3d94aa4891ab8f9abca94e6"
}
But it succeeds if it's part of a batch: 但如果它是批次的一部分,它会成功:
[{
"type": "delete",
"id": "4e41b5a6f3d94aa4891ab8f9abca94e6"
}]
I realize that you show a json array in your example above, but it is worth double-checking since you're getting the exact same error you'd get when trying to post a single document that is not part of an array. 我意识到你在上面的例子中显示了一个json数组,但值得仔细检查,因为你在尝试发布不属于数组的单个文档时会得到完全相同的错误。 It would be an easy mistake to make since their own documentation on preparing data for submission shows a partial example where the delete is not part of an array (see the "To delete a document from a search domain" section). 这是一个容易犯的错误,因为他们自己准备提交数据的文档显示了一个部分示例,其中删除不是数组的一部分(请参阅“从搜索域中删除文档”部分)。
you can use simple xml file. 你可以使用简单的xml文件。 (file extension should .XML) (文件扩展名应为.XML)
<batch>
<delete id="4e41b5a6f3d94aa4891ab8f9abca94e6" />
</batch>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.