Mapping Data Source Fields - Amazon Kendra

Amazon Kendra is in preview release. This documentation is subject to change.

Mapping Data Source Fields

When the source of you data is a Microsoft SharePoint site or a database you can map SharePoint attributes or database columns to fields in your index. For example if you have a SharePoint attribute or a database column that contains department information for a document, you can map it to an index field called "Department" so that you can use the field in queries.

If you are storing your documents in an Amazon S3 bucket, or if you are using an Amazon S3 data source, you use custom attributes for the same purpose. For more information, see Creating Custom Document Attributes.

Mapping your data source attributes or columns to an index field is a three step process:

  1. Create an index. For more information, see Creating an Index.

  2. Update the index to add custom fields.

  3. Create a data source that maps attributes or columns to the index fields.

To update the index to add custom fields, you use the console or the UpdateIndex operation.

When you are using the console, you can choose to map a database column to one of the seven reserved field names, or you can choose to create a new index field that maps to the column. If the name of the database column matches the name of a reserved field, the field and column are automatically mapped.

With the API, you add custom and reserved fields using the DocumentMetadataConfigurationUpdates parameter.

The following JSON example is a DocumentMetadataConfigurationUpdates structure that adds a field called "Department" to the index.

"DocumentmetadataConfigurationUpdates": [ { "Name": "Department", "Type": "STRING_VALUE" } ]

When you create the field you have the option of setting how the field should be used in searches. You can choose from the following:

  • Displayable – determines whether the field is returned in the query response. The default is true.

  • Facetable – indicates that the field can be used to create facets. The default is false.

  • Searchable – Determines whether the field is used in the search. The default is true for string fields and false for number and date fields.

The following JSON example is a DocumentMetadataConfigurationUpdates structure that adds a field called "Department" to the index and marks it as facetable.

"DocumentMetadataConfigurationUpdates": [ { "Name": "Department", "Type": "STRING_VALUE", "Search": { "Facetable": "true" } } ]

Amazon Kendra has six reserved fields that you can map to database columns or SharePoint attributes. The fields are:

  • _category (String)

  • _created_at (ISO 8601 encoded string)

  • _file_type (String)

  • _last_updated_at (ISO 8601 encoded string)

  • _source_uri (String)

  • _view_count (Long)

Once you have created the index fields, you can map the fields to database columns or SharePoint attributes.

To map fields to a database data source, see Using a Database Data Source.

To map fields to a SharePoint data source, see Using a Microsoft SharePoint Data Source.