Pilih preferensi cookie Anda

Kami menggunakan cookie penting serta alat serupa yang diperlukan untuk menyediakan situs dan layanan. Kami menggunakan cookie performa untuk mengumpulkan statistik anonim sehingga kami dapat memahami cara pelanggan menggunakan situs dan melakukan perbaikan. Cookie penting tidak dapat dinonaktifkan, tetapi Anda dapat mengklik “Kustom” atau “Tolak” untuk menolak cookie performa.

Jika Anda setuju, AWS dan pihak ketiga yang disetujui juga akan menggunakan cookie untuk menyediakan fitur situs yang berguna, mengingat preferensi Anda, dan menampilkan konten yang relevan, termasuk iklan yang relevan. Untuk menerima atau menolak semua cookie yang tidak penting, klik “Terima” atau “Tolak”. Untuk membuat pilihan yang lebih detail, klik “Kustomisasi”.

UserContext - Amazon Kendra API Reference
Halaman ini belum diterjemahkan ke dalam bahasa Anda. Minta terjemahan

UserContext

Provides information about the user context for an Amazon Kendra index.

User context filtering is a kind of personalized search with the benefit of controlling access to documents. For example, not all teams that search the company portal for information should access top-secret company documents, nor are these documents relevant to all users. Only specific users or groups of teams given access to top-secret documents should see these documents in their search results.

You provide one of the following:

  • User token

  • User ID, the groups the user belongs to, and any data sources the groups can access.

If you provide both, an exception is thrown.

Important

If you're using an Amazon Kendra Gen AI Enterprise Edition index, you can use UserId, Groups, and DataSourceGroups to filter content. If you set the UserId to a particular user ID, it also includes all public documents.

Amazon Kendra Gen AI Enterprise Edition indices don't support token based document filtering. If you're using an Amazon Kendra Gen AI Enterprise Edition index, Amazon Kendra returns a ValidationException error if the Token field has a non-null value.

Contents

DataSourceGroups

The list of data source groups you want to filter search results based on groups' access to documents in that data source.

Type: Array of DataSourceGroup objects

Array Members: Minimum number of 1 item. Maximum number of 2048 items.

Required: No

Groups

The list of groups you want to filter search results based on the groups' access to documents.

Type: Array of strings

Array Members: Minimum number of 1 item. Maximum number of 2048 items.

Length Constraints: Minimum length of 1. Maximum length of 200.

Pattern: ^\P{C}*$

Required: No

Token

The user context token for filtering search results for a user. It must be a JWT or a JSON token.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 100000.

Pattern: ^\P{C}*$

Required: No

UserId

The identifier of the user you want to filter search results based on their access to documents.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 200.

Pattern: ^\P{C}*$

Required: No

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

PrivasiSyarat situsPreferensi cookie
© 2025, Amazon Web Services, Inc. atau afiliasinya. Semua hak dilindungi undang-undang.