# DataSourceToIndexFieldMappingProperty

Maps a column or attribute in the data source to an index field.

You must first create the fields in the index using the [UpdateIndex](https://docs.aws.amazon.com/kendra/latest/dg/API_UpdateIndex.html) operation.

- Source: Generated at build time
- Type last changed: v2.93.0 · 23 Aug 2023

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_kendra as kendra } from 'aws-cdk-lib';
const dataSourceToIndexFieldMappingProperty: kendra.CfnDataSource.DataSourceToIndexFieldMappingProperty = {
  dataSourceFieldName: 'dataSourceFieldName',
  indexFieldName: 'indexFieldName',

  // the properties below are optional
  dateFieldFormat: 'dateFieldFormat',
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_kendra as kendra

data_source_to_index_field_mapping_property = kendra.CfnDataSource.DataSourceToIndexFieldMappingProperty(
    data_source_field_name="dataSourceFieldName",
    index_field_name="indexFieldName",

    # the properties below are optional
    date_field_format="dateFieldFormat"
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.kendra.*;

DataSourceToIndexFieldMappingProperty dataSourceToIndexFieldMappingProperty = DataSourceToIndexFieldMappingProperty.builder()
        .dataSourceFieldName("dataSourceFieldName")
        .indexFieldName("indexFieldName")

        // the properties below are optional
        .dateFieldFormat("dateFieldFormat")
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Kendra;

var dataSourceToIndexFieldMappingProperty = new DataSourceToIndexFieldMappingProperty {
    DataSourceFieldName = "dataSourceFieldName",
    IndexFieldName = "indexFieldName",

    // the properties below are optional
    DateFieldFormat = "dateFieldFormat"
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

dataSourceToIndexFieldMappingProperty := &DataSourceToIndexFieldMappingProperty{
	DataSourceFieldName: jsii.String("dataSourceFieldName"),
	IndexFieldName: jsii.String("indexFieldName"),

	// the properties below are optional
	DateFieldFormat: jsii.String("dateFieldFormat"),
}
```

## Properties

- `dataSourceFieldName`: string (required) — The name of the field in the data source.

  You must first create the index field using the `UpdateIndex` API.

- `dateFieldFormat`: string — The format for date fields in the data source.

  If the field specified in `DataSourceFieldName` is a date field, you must specify the date format. If the field is not a date field, an exception is thrown.

- `indexFieldName`: string (required) — The name of the index field to map to the data source field.

  The index field type must match the data source field type.
