在手动删除后处理修订版本
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
当 Cloud Search 收到删除项请求时,不会立即移除整个项。不过,Cloud Search 会执行软删除,即将相应项标记为已删除,并移除部分项信息,例如 ACL、内容、结构化数据和元数据。其他信息(例如商品版本)会保留。
如果重新编入索引的请求提供的版本大于现有值,则在软删除状态下重新编入相应商品的索引会恢复该商品。
内容在被标记为已删除后会保留 7-10 天,之后 Cloud Search 会执行硬删除操作,以永久删除该内容。相应商品不再存在,其版本号不再指代该特定商品。
保持商品版本一致
内容连接器应处理商品的版本控制。
不过,如果您使用 items.delete 在连接器逻辑之外删除某个项,则必须执行以下操作之一,以确保重新编制索引能够成功完成:
- 在硬删除(7-10 天)后重新为您的内容编制索引。
- 手动删除商品时,请使用实际的商品版本(可通过调用 items.get 获取),而不是随机字符串(例如“None”)。
如果您未遵循上述任一建议,则在编入索引期间会发生错误,并且编入索引会失败。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-29。
[null,null,["最后更新时间 (UTC):2025-08-29。"],[],[],null,["# Handle revisions after manual deletes\n\nWhen the Cloud Search gets a delete item request, it doesn't immediately remove\nthe entire item. Instead, Cloud Search performs a *soft delete* by marking the\nitem as deleted and removing a subset of item information, such as the ACLs,\ncontent, structured data, and metadata. Other information, such as the item\nversion, is retained.\n\nIf a re-indexing request provides a version greater than the existing value,\nre-indexing that item while it is in a soft delete state restores the item.\n\nAn item is marked as deleted for 7-10 days after which Cloud Search performs\na *hard delete* to permanently delete the item. The item ceases to exist and\nits version number no longer refers to that specific item.\n\nMaintain consistent item versions\n---------------------------------\n\nYour content connector should handle versioning of items.\nHowever, if you delete an item outside of your connector logic using\n[items.delete](/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items/delete)\nyou must do one of the following to ensure reindexing can be successful:\n\n- Reindex your content *after* the hard delete (7-10 days).\n- When manually deleting an item, use the actual item version, which you can obtain by calling [items.get](/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items/get) , instead of a random string, such as \"None.\".\n\nIf you don't follow one of these suggestions, an error occurs during indexing\nand indexing fails."]]