

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# Amazon Kendra 中的索引
<a name="hiw-index"></a>

索引會保留文件的內容，並以可搜尋文件的方式建構。本節提供支援的索引類型和索引功能的概觀。

**Topics**
+ [Amazon Kendra 中的索引類型](hiw-index-types.md)
+ [在 Amazon Kendra 中將文件新增至索引](hiw-index-adding-docs.md)
+ [使用 Amazon Kendra 預留或通用文件欄位](index-reserved-fields-hiw.md)
+ [從 Amazon Kendra 中的索引擷取回應](index-searching.md)

# Amazon Kendra 中的索引類型
<a name="hiw-index-types"></a>

Amazon Kendra 有三種索引類型：GenAI Enterprise Edition 索引、Enterprise Edition 索引和 Developer Edition 索引。下列各節說明每個索引的功能。

**Topics**
+ [Amazon Kendra GenAI Enterprise Edition 索引](#kendra-gen-ai-index)
+ [Amazon Kendra Enterprise Edition 索引](#kendra-enterprise-index)
+ [Amazon Kendra 開發人員版本索引](#kendra-developer-index)

## Amazon Kendra GenAI Enterprise Edition 索引
<a name="kendra-gen-ai-index"></a>

Amazon Kendra GenAI Enterprise Edition 索引可為擷取 API 操作和擷取增強生成 (RAG) 使用案例提供最高的準確性。它採用最新的資訊擷取技術，例如混合搜尋 （關鍵字和向量）、語意內嵌和重新排名模型，並已跨各種資料集進行測試。與 Amazon Kendra Developer Edition 和 Amazon Kendra Enterprise Edition 索引相比，查詢 API 操作可為 Amazon Kendra GenAI Enterprise Edition 索引提供類似的準確性。

Amazon Kendra GenAI Enterprise Edition 索引可讓您跨 AWS 生成式 AI 服務移動索引資料。使用此功能，您可以無縫重複使用投資，而無需重建索引。您可以在 [Amazon Bedrock 知識庫](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base.html)中將其用作受管擷取器，並將其與客服人員和提示流程等 Amazon Bedrock 工具整合，以建置進階 AI 助理。您也可以將其與 搭配使用[Amazon Q Business](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/what-is.html)，以進行全受管數位助理。

與其他兩種索引類型相比，Amazon Kendra GenAI Enterprise Edition 索引提供更小、更精細的容量單位和較低的起始價格。這可協助您更有效率地使用容量。

**注意**  
為了獲得最佳體驗和準確性，我們建議您選擇 Amazon Kendra GenAI Enterprise Edition 索引。

**Topics**
+ [支援的功能](#kendra-gen-ai-index-features)
+ [限制](#genai-index-limitations)

### 支援的功能
<a name="kendra-gen-ai-index-features"></a>

如果您針對 RAG 使用案例使用[擷取](https://docs.aws.amazon.com/kendra/latest/APIReference/API_Retrieve.html) API 操作，Amazon Kendra GenAI Enterprise Edition 索引支援下列功能：
+ **完整支援** – [可信度分數儲存貯](https://docs.aws.amazon.com/kendra/latest/APIReference/API_QueryResultItem.html#Kendra-Type-QueryResultItem-ScoreAttributes)體、[篩選](https://docs.aws.amazon.com/kendra/latest/dg/filtering.html)、[面向](https://docs.aws.amazon.com/kendra/latest/dg/filtering.html#search-facets)、[相關性調校](https://docs.aws.amazon.com/kendra/latest/dg/tuning.html)、[自訂文件擴充](https://docs.aws.amazon.com/kendra/latest/dg/custom-document-enrichment.html)、[自訂中繼資料](https://docs.aws.amazon.com/kendra/latest/dg/custom-attributes.html)，以及[調整查詢容量和文件容量](https://docs.aws.amazon.com/kendra/latest/dg/adjusting-capacity.html)。
+ **部分支援** – [資料來源連接器](https://docs.aws.amazon.com/kendra/latest/dg/data-source.html)和[使用者內容篩選](https://docs.aws.amazon.com/kendra/latest/dg/user-context-filter.html)。如需部分支援功能的詳細資訊，請參閱[限制](https://docs.aws.amazon.com/kendra/latest/dg/hiw-index-types.html#genai-index-limitations)。

如果您使用[查詢](https://docs.aws.amazon.com/kendra/latest/APIReference/API_Query.html) API 操作搜尋使用案例，Amazon Kendra GenAI Enterprise Edition 索引支援下列功能：
+ **完整支援** – [文件排名](https://docs.aws.amazon.com/kendra/latest/dg/search-service-rerank.html)、[擷取問題回答](https://docs.aws.amazon.com/kendra/latest/dg/searching-example.html)、[可信度分數儲存貯](https://docs.aws.amazon.com/kendra/latest/APIReference/API_QueryResultItem.html#Kendra-Type-QueryResultItem-ScoreAttributes)體、[篩選](https://docs.aws.amazon.com/kendra/latest/dg/filtering.html)、[面向](https://docs.aws.amazon.com/kendra/latest/dg/filtering.html#search-facets)、[排序](https://docs.aws.amazon.com/kendra/latest/dg/tuning-sorting-responses.html#sorting-responses)、[摺疊和擴展查詢結果](https://docs.aws.amazon.com/kendra/latest/dg/expand-collapse-query-results.html)、[索引瀏覽](https://docs.aws.amazon.com/kendra/latest/dg/browsing.html)、[布林查詢](https://docs.aws.amazon.com/kendra/latest/dg/searching-example.html#searching-index-query-syntax)、[完全相符](https://docs.aws.amazon.com/kendra/latest/dg/searching-example.html#searching-index-query-syntax)、[萬用字元查詢](https://docs.aws.amazon.com/kendra/latest/dg/searching-example.html#searching-index-query-syntax)、[查詢建議](https://docs.aws.amazon.com/kendra/latest/dg/query-suggestions.html)、[查詢拼字檢查程式](https://docs.aws.amazon.com/kendra/latest/dg/query-spell-check.html)、[相關性調校](https://docs.aws.amazon.com/kendra/latest/dg/tuning.html)、[增量學習](https://docs.aws.amazon.com/kendra/latest/dg/submitting-feedback.html)、[自訂文件擴充](https://docs.aws.amazon.com/kendra/latest/dg/custom-document-enrichment.html)、[自訂中繼資料](https://docs.aws.amazon.com/kendra/latest/dg/custom-attributes.html)、[調整查詢容量和文件容量](https://docs.aws.amazon.com/kendra/latest/dg/adjusting-capacity.html)，以及[搜尋體驗](https://docs.aws.amazon.com/kendra/latest/dg/deploying.html)。
+ **部分支援** – [資料來源連接器](https://docs.aws.amazon.com/kendra/latest/dg/data-source.html)和[使用者內容篩選](https://docs.aws.amazon.com/kendra/latest/dg/user-context-filter.html)。如需部分支援功能的詳細資訊，請參閱[限制](https://docs.aws.amazon.com/kendra/latest/dg/hiw-index-types.html#kendra-gen-ai-index)。

### 限制
<a name="genai-index-limitations"></a>

以下概述 Amazon Kendra GenAI Enterprise Edition 索引的已知限制：
+ Amazon Kendra GenAI Enterprise Edition 索引僅適用於美國東部 （維吉尼亞北部） 和美國西部 （奧勒岡）。
+ Amazon Kendra GenAI Enterprise Edition 索引僅支援英文內容。
+ Amazon Kendra GenAI Enterprise Edition 索引僅支援 v2.0 Amazon Kendra 資料來源連接器。
+ 在 Amazon Kendra GenAI Enterprise Edition 索引中，您只能使用[使用者屬性](https://docs.aws.amazon.com/kendra/latest/dg/user-context-filter.html#context-filter-attribute)來依使用者內容篩選搜尋結果。
+ Amazon Kendra GenAI Enterprise Edition 索引不支援權[杖型使用者存取控制](https://docs.aws.amazon.com/kendra/latest/dg/create-index-access-control.html)或[使用者 ID 和群組型使用者對文件的存取控制](https://docs.aws.amazon.com/kendra/latest/dg/user-context-filter.html#context-filter-user-incl-datasources)。
+ Amazon Kendra GenAI Enterprise Edition 索引已停用 [CreateAccessControlConfiguration](https://docs.aws.amazon.com/kendra/latest/APIReference/API_CreateAccessControlConfiguration.html) API 操作。
+ 如果您使用 Amazon Kendra GenAI Enterprise Edition 索引搭配 Amazon Q Business，請注意下列有關控制最終使用者存取文件的事項：

  Amazon Q Business 使用使用者電子郵件 ID 來判斷最終使用者對 索引中文件的存取權。當您將 Amazon Kendra 索引連線至 時 Amazon Q Business， 會將使用者識別電子郵件 ID Amazon Q Business 重鋪至 Amazon Kendra，以啟用最終使用者的文件篩選。如果連接到 Amazon Kendra 索引的資料來源未使用電子郵件 ID 型文件篩選，或電子郵件 ID 不存在，則 只會從公有文件 Amazon Q Business 產生回應。

## Amazon Kendra Enterprise Edition 索引
<a name="kendra-enterprise-index"></a>

Amazon Kendra Enterprise Edition 索引提供語意搜尋功能，並提供適用於生產工作負載的高可用性服務。

**Topics**
+ [支援的功能](#kendra-ent-index-features)
+ [限制](#ent-index-limitations)

### 支援的功能
<a name="kendra-ent-index-features"></a>

如果您使用 RAG 使用案例的[擷取](https://docs.aws.amazon.com/kendra/latest/APIReference/API_Retrieve.html) API 操作，Amazon Kendra Enterprise Edition 索引支援下列功能：使用[進階查詢語法](https://docs.aws.amazon.com/kendra/latest/dg/searching-example.html#searching-index-query-syntax)進行查詢、查詢[的建議拼字修正](https://docs.aws.amazon.com/kendra/latest/dg/query-spell-check.html)、[面向](https://docs.aws.amazon.com/kendra/latest/dg/filtering.html#search-facets)、自動完成搜尋查詢的[查詢建議](https://docs.aws.amazon.com/kendra/latest/dg/query-suggestions.html)，以及[增量學習](https://docs.aws.amazon.com/kendra/latest/dg/submitting-feedback.html)。

如果您使用[查詢](https://docs.aws.amazon.com/kendra/latest/APIReference/API_Query.html) API 操作搜尋使用案例，Amazon Kendra Enterprise Edition 索引支援所有功能。

### 限制
<a name="ent-index-limitations"></a>

以下概述 Amazon Kendra Enterprise Edition 索引的已知限制：
+ 如果您搭配 使用 Amazon Kendra Enterprise Edition 索引 Amazon Q Business，請注意下列有關控制最終使用者存取文件的事項：

  Amazon Q Business 使用使用者電子郵件 ID 來判斷最終使用者對 索引中文件的存取權。當您將 Amazon Kendra 索引連線至 時 Amazon Q Business， 會將使用者識別電子郵件 ID Amazon Q Business 重鋪至 Amazon Kendra，以啟用最終使用者的文件篩選。如果連接到 Amazon Kendra 索引的資料來源未使用電子郵件 ID 型文件篩選，或電子郵件 ID 不存在，則 只會從公有文件 Amazon Q Business 產生回應。

## Amazon Kendra 開發人員版本索引
<a name="kendra-developer-index"></a>

Amazon Kendra Developer Edition 索引也提供語意搜尋功能，供您測試使用案例。不過，我們不建議將其用於生產使用案例。

**Topics**
+ [支援的功能](#kendra-dev-index-features)
+ [限制](#dev-index-limitations)

### 支援的功能
<a name="kendra-dev-index-features"></a>

如果您使用 RAG 使用案例的[擷取](https://docs.aws.amazon.com/kendra/latest/APIReference/API_Retrieve.html) API 操作：使用[進階查詢語法](https://docs.aws.amazon.com/kendra/latest/dg/searching-example.html#searching-index-query-syntax)查詢、查詢[的建議拼字修正](https://docs.aws.amazon.com/kendra/latest/dg/query-spell-check.html)、[面向](https://docs.aws.amazon.com/kendra/latest/dg/filtering.html#search-facets)、自動完成搜尋查詢的[查詢建議](https://docs.aws.amazon.com/kendra/latest/dg/query-suggestions.html)，以及[增量學習](https://docs.aws.amazon.com/kendra/latest/dg/submitting-feedback.html)，Amazon Kendra 開發人員版本索引支援下列功能。

如果您使用[查詢](https://docs.aws.amazon.com/kendra/latest/APIReference/API_Query.html) API 操作搜尋使用案例，Amazon Kendra 開發人員版本索引支援所有功能。

### 限制
<a name="dev-index-limitations"></a>

以下概述 Amazon Kendra 開發人員版本索引的已知限制：
+ 如果您搭配 使用 Amazon Kendra Developer Edition 索引 Amazon Q Business，請注意下列有關控制最終使用者存取文件的事項：

  Amazon Q Business 使用使用者電子郵件 ID 來判斷最終使用者對 索引中文件的存取權。當您將 Amazon Kendra 索引連線至 時 Amazon Q Business， 會將使用者識別電子郵件 ID Amazon Q Business 重鋪至 Amazon Kendra，以啟用最終使用者的文件篩選。如果連接到 Amazon Kendra 索引的資料來源未使用電子郵件 ID 型文件篩選，或電子郵件 ID 不存在，則 只會從公有文件 Amazon Q Business 產生回應。

# 在 Amazon Kendra 中將文件新增至索引
<a name="hiw-index-adding-docs"></a>

將文件新增至索引的方式取決於存放文件的方式。
+ 如果您將文件存放在某種儲存庫中，例如 Amazon S3 儲存貯體或 Microsoft SharePoint 網站，您可以使用[資料來源連接器](https://docs.aws.amazon.com/kendra/latest/dg/data-source.html)從儲存庫為文件編製索引。
+ 如果您未將文件存放在儲存庫中，您可以使用 [BatchPutDocument](https://docs.aws.amazon.com/kendra/latest/APIReference/API_BatchPutDocument.html) API 操作來直接索引文件。
+ 對於必須存放在 Amazon Kendra (Amazon S3) 儲存貯體中的常見問答集問題和答案，您可以從儲存貯體上傳它們。

您可以使用 Amazon Kendra 主控台、 AWS CLI或 AWS SDK 建立索引。如需可編製索引的文件類型資訊，請參閱[文件類型](https://docs.aws.amazon.com/kendra/latest/dg/index-document-types.html)。

# 使用 Amazon Kendra 預留或通用文件欄位
<a name="index-reserved-fields-hiw"></a>

使用 [UpdateIndex](https://docs.aws.amazon.com/kendra/latest/APIReference/API_UpdateIndex.html) API 操作，您可以建立預留或常用欄位。若要這樣做，您可以使用 `DocumentMetadataConfigurationUpdates`，並指定要映射至同等文件屬性/欄位名稱的 Amazon Kendra 預留索引欄位名稱。您也可以建立自訂欄位。

如果您使用資料來源連接器，大多數包含將資料來源文件欄位映射至 Amazon Kendra 索引欄位的欄位映射。如果您使用 主控台，您可以透過選取資料來源、選取編輯動作，然後繼續在欄位映射區段旁設定資料來源來更新欄位。

您可以設定 `Search` 物件，將欄位設定為可顯示、可面向、可搜尋和可排序。您可以設定 `Relevance` 物件來設定欄位的排名順序、提升持續時間或時段，以套用至映射至特定欄位值的提升、新鮮度、重要性值和重要性值。

如果您使用 主控台，您可以透過選取導覽功能表中的面向選項來設定欄位的搜尋設定。若要設定相關性調校，請選取導覽選單中搜尋索引的選項，輸入查詢，然後使用側邊面板選項調校搜尋相關性。您無法在建立欄位之後變更欄位類型。

Amazon Kendra 具有下列預留或常用文件欄位，您可以使用：
+ `_authors` – 負責文件內容的一或多個作者清單。
+ `_category` – 在特定群組中放置文件的類別。
+ `_created_at` – 文件建立的日期和時間，以 ISO 8601 格式表示。例如，2012-03-25T12 日下午 12：30 （加上 10 秒），2012 年 3 月 25 日中歐時間的 ISO 8601 日期時間格式為 2012 年 3 月 25 日。
+ `_data_source_id` – 包含文件的資料來源的識別碼。
+ `_document_body` – 文件的內容。
+ `_document_id` – 文件的唯一識別碼。
+ `_document_title` – 文件的標題。
+ `_excerpt_page_number` – PDF 檔案中文件摘錄出現的頁碼。如果您的索引是在 2020 年 9 月 8 日之前建立的，您必須先重新索引文件，才能使用此屬性。
+ `_faq_id` – 如果這是問答類型文件 (FAQ)，則為常見問答集的唯一識別符。
+ `_file_type` – 文件的檔案類型，例如 pdf 或 doc。
+ `_last_updated_at` – 文件上次更新的日期和時間，以 ISO 8601 格式表示。例如，2012-03-25T12 日下午 12：30 （加上 10 秒），2012 年 3 月 25 日中歐時間的 ISO 8601 日期時間格式為 2012 年 3 月 25 日。
+ `_source_uri` – 文件可用的 URI，例如公司網站上的文件 URI。
+ `_version` – 文件特定版本的識別碼。
+ `_view_count` – 文件的檢視次數。
+ `_language_code` （字串） – 適用於文件的語言程式碼。如果您未指定語言，則預設為英文。如需支援語言的詳細資訊，包括其代碼，請參閱[新增英文以外語言的文件](https://docs.aws.amazon.com/kendra/latest/dg/in-adding-languages.html)。

您可以使用 `DocumentMetadataConfigurationUpdates` 搭配 `UpdateIndex` API 操作建立自訂欄位，就像建立預留或常用欄位一樣。您必須為自訂欄位設定適當的資料類型。

如果您使用 主控台，您可以透過選取資料來源、選取編輯動作，然後在欄位映射區段旁繼續設定資料來源，來更新欄位。有些資料來源不支援新增欄位或自訂欄位。您無法在建立欄位之後變更欄位類型。

以下是您可以為自訂欄位設定的類型：
+ Date
+ Number
+ String
+ 字串清單

如果您使用 [BatchPutDocument](https://docs.aws.amazon.com/kendra/latest/APIReference/API_BatchPutDocument.html) API 操作將文件新增至索引， 會`Attributes`列出文件的欄位/屬性，並使用 `DocumentAttribute` 物件建立欄位。

對於從 Amazon S3 資料來源編製索引的文件，您可以使用包含欄位資訊的 [JSON 中繼資料檔案](https://docs.aws.amazon.com/kendra/latest/dg/s3-metadata.html)建立欄位。

如果您使用支援的資料庫做為資料來源，您可以使用欄位[映射選項來設定欄位](https://docs.aws.amazon.com/kendra/latest/dg/data-source-database.html#data-source-procedure-database)。

# 從 Amazon Kendra 中的索引擷取回應
<a name="index-searching"></a>

建立索引後，您可以開始搜尋文件。

若要搜尋 Amazon Kendra 索引，您可以使用[擷取](https://docs.aws.amazon.com/kendra/latest/APIReference/API_Retrieve.html) API 操作或[查詢](https://docs.aws.amazon.com/kendra/latest/APIReference/API_Query.html) API 操作。

擷取 API 操作非常適合擷取增強產生 (RAG) 使用案例。對於指定的查詢，它會傳回最多 200 個字符單字的語意相關段落排名清單。您可以將它們傳送到大型語言模型 (LLM)，以使用 RAG 產生答案。如需詳細資訊，請參閱[搜尋索引](https://docs.aws.amazon.com/kendra/latest/dg/searching.html)。

查詢 API 操作最適合文件搜尋使用案例。對於指定的查詢，它會傳回與查詢相關的 100 個字詞摘錄的排名文件清單。這對於使用者瀏覽排名文件清單的傳統文件搜尋使用案例非常有用。

若要查看每個索引類型的擷取和查詢 API 操作支援哪些功能，請參閱[索引類型](https://docs.aws.amazon.com/kendra/latest/dg/hiw-index-types.html)。