您位於此處:
準備現有檔案以供取用
建立中繼資料側卡檔案,以便搜尋服務將現有的 Amazon S3 物件與 Salesforce 檔案相關聯。
開始之前,請確定您具有:
- 設定的 Amazon Bedrock Knowledge 庫或 Amazon Kendra 索引。
- Amazon S3 庫存報告或資料清單,可識別要處理的現有物件。
- 建立 Lambda 函數和 Amazon S3 批次作業工作的權限。
- 讀取對應檔案、來源物件和現有側車的權限。
- 將中繼資料側卡寫入至來源分類的權限。
- 識別要處理的現有 S3 物件。
-
產生對應檔案,將每個現有檔案與其 Salesforce ContentDocumentId 和 Amazon S3 位置相關聯。
請參閱針對外部儲存的檔案產生批次對應檔案。
-
為每個現有檔案建立側列中繼資料檔案。
中繼資料會將檔案與其 Salesforce 記錄相關聯。如需中繼資料需求,請參閱 AWS 文件中的 Knowledge 庫的 中繼資料和篩選。
- 將相關聯的 Salesforce ContentDocumentId 值新增至每個側卡。
-
確認每個側列皆遵循適用的 Amazon Bedrock 或 Kendra 中繼資料格式。
如需詳細資訊,請參閱 AWS 文件中的 將中繼資料新增至 Knowledge 庫的檔案,並參閱 AWS 文件中的 S3 文件中繼資料。
-
儲存中繼資料側卡:
- Amazon Kendra: 儲存在來源 S3 分類中的
__sfdcroot__/__metadata__/下。 - Amazon Bedrock: 將中繼資料側卡儲存在來源物件旁邊。
- Amazon Kendra: 儲存在來源 S3 分類中的
-
透過 Amazon S3 批次事件叫用 Lambda 函數。
如需指示,請參閱透過 Amazon S3 批次事件 叫用 Lambda 函數。
備註 Amazon Kendra 不會從音訊、視訊或影像內容產生文字記錄或摘要。請先使用適當的模型為這些檔案建立可搜尋文字內容,Amazon Kendra 才會將這些檔案採取。例如,Amazon Bedrock 資料自動化。請參閱 Amazon Bedrock 資料自動化。下列範例說明側卡更新邏輯:
1. Load mapping file 2. For each file in S3: a. Look up the salesforce content document Ids from mapping file b. Create sidecar metadata json file c. Populate the content document Ids in the json file according the correct Bedrock / Kendra format d. Make sure the metadata attribute key is "contentDocumentIds" and is an array of 15 digit Id strings - 授與 Lambda 函數來源分類的存取權。
- 建立並執行 Amazon S3 批次作業工作,以針對現有物件叫用 Lambda 函數。
- 為外部儲存的檔案產生批次對應檔案
透過產生將 Salesforce 檔案與其 Amazon S3 位置相關聯的對應檔案,為 Amazon Bedrock 或 Amazon Kendra 準備現有檔案。只有在您想要搜尋的 Amazon S3 中有現有檔案時,才必須完成此工作。
