在手動刪除後處理修訂版本
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
Cloud Search 收到刪除項目要求時,不會立即移除整個項目,Cloud Search 會改為執行虛刪除,將項目標示為已刪除,並移除部分項目資訊,例如存取控制清單、內容、結構化資料和中繼資料。系統會保留其他資訊,例如商品版本。
如果重新建立索引要求提供的版本大於現有值,則在虛刪除狀態下重新建立該項目的索引,即可還原該項目。
項目會標示為已刪除,並在 7 到 10 天後由 Cloud Search 永久刪除。該項目會消失,且版本號碼不再指向該特定項目。
維持一致的項目版本
內容連結器應處理項目的版本管理。
不過,如果您使用 items.delete 在連接器邏輯外刪除項目,請務必採取下列其中一項做法,確保重新建立索引成功:
- 在實刪除 (7 到 10 天) 後,重新為內容建立索引。
- 手動刪除項目時,請使用實際的項目版本 (可透過呼叫 items.get 取得),而非隨機字串 (例如「None」)。
如果不按照這些建議操作,建立索引時就會發生錯誤,導致索引建立失敗。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-29 (世界標準時間)。
[null,null,["上次更新時間: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."]]