# PropertyMappingProperty

Struct · External

Property mappings for the OpenSearch Serverless index.

- Source: Generated at build time
- Type last changed: v2.264.0 · 10 Aug 2026

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_opensearchserverless as opensearchserverless } from 'aws-cdk-lib';

declare const propertyMappingProperty_: opensearchserverless.CfnIndex.PropertyMappingProperty;
const propertyMappingProperty: opensearchserverless.CfnIndex.PropertyMappingProperty = {
  type: 'type',

  // the properties below are optional
  analyzer: 'analyzer',
  compressionLevel: 'compressionLevel',
  dataType: 'dataType',
  dimension: 123,
  index: false,
  method: {
    name: 'name',

    // the properties below are optional
    engine: 'engine',
    parameters: {
      efConstruction: 123,
      m: 123,
    },
    spaceType: 'spaceType',
  },
  properties: {
    propertiesKey: propertyMappingProperty_,
  },
  spaceType: 'spaceType',
  value: 'value',
};
```

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_opensearchserverless as opensearchserverless

# property_mapping_property_: opensearchserverless.CfnIndex.PropertyMappingProperty

property_mapping_property = opensearchserverless.CfnIndex.PropertyMappingProperty(
    type="type",

    # the properties below are optional
    analyzer="analyzer",
    compression_level="compressionLevel",
    data_type="dataType",
    dimension=123,
    index=False,
    method=opensearchserverless.CfnIndex.MethodProperty(
        name="name",

        # the properties below are optional
        engine="engine",
        parameters=opensearchserverless.CfnIndex.ParametersProperty(
            ef_construction=123,
            m=123
        ),
        space_type="spaceType"
    ),
    properties={
        "properties_key": property_mapping_property_
    },
    space_type="spaceType",
    value="value"
)
```

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.opensearchserverless.*;

PropertyMappingProperty propertyMappingProperty_;

PropertyMappingProperty propertyMappingProperty = PropertyMappingProperty.builder()
        .type("type")

        // the properties below are optional
        .analyzer("analyzer")
        .compressionLevel("compressionLevel")
        .dataType("dataType")
        .dimension(123)
        .index(false)
        .method(MethodProperty.builder()
                .name("name")

                // the properties below are optional
                .engine("engine")
                .parameters(ParametersProperty.builder()
                        .efConstruction(123)
                        .m(123)
                        .build())
                .spaceType("spaceType")
                .build())
        .properties(Map.of(
                "propertiesKey", propertyMappingProperty_))
        .spaceType("spaceType")
        .value("value")
        .build();
```

C#:

```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.OpenSearchServerless;

PropertyMappingProperty propertyMappingProperty_;

var propertyMappingProperty = new PropertyMappingProperty {
    Type = "type",

    // the properties below are optional
    Analyzer = "analyzer",
    CompressionLevel = "compressionLevel",
    DataType = "dataType",
    Dimension = 123,
    Index = false,
    Method = new MethodProperty {
        Name = "name",

        // the properties below are optional
        Engine = "engine",
        Parameters = new ParametersProperty {
            EfConstruction = 123,
            M = 123
        },
        SpaceType = "spaceType"
    },
    Properties = new Dictionary<string, object> {
        { "propertiesKey", propertyMappingProperty_ }
    },
    SpaceType = "spaceType",
    Value = "value"
};
```

Go:

```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"

var propertyMappingProperty_ PropertyMappingProperty

propertyMappingProperty := &PropertyMappingProperty{
	Type: jsii.String("type"),

	// the properties below are optional
	Analyzer: jsii.String("analyzer"),
	CompressionLevel: jsii.String("compressionLevel"),
	DataType: jsii.String("dataType"),
	Dimension: jsii.Number(123),
	Index: jsii.Boolean(false),
	Method: &MethodProperty{
		Name: jsii.String("name"),

		// the properties below are optional
		Engine: jsii.String("engine"),
		Parameters: &ParametersProperty{
			EfConstruction: jsii.Number(123),
			M: jsii.Number(123),
		},
		SpaceType: jsii.String("spaceType"),
	},
	Properties: map[string]interface{}{
		"propertiesKey": propertyMappingProperty_,
	},
	SpaceType: jsii.String("spaceType"),
	Value: jsii.String("value"),
}
```

## Properties

- `analyzer`: string — The analyzer to use for this field (for text and keyword fields).

- `compressionLevel`: string — The compression level for knn_vector fields.

- `dataType`: string — The data type for knn_vector fields (e.g. float, byte). Controls how vector values are stored.

- `dimension`: number — Dimension size for vector fields, defines the number of dimensions in the vector.

- `index`: boolean | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) — Whether a field should be indexed.

- `method`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnIndex.MethodProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_opensearchserverless.CfnIndex.MethodProperty.html) — Configuration for k-NN search method.

- `properties`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | { [key: string]: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnIndex.PropertyMappingProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_opensearchserverless.CfnIndex.PropertyMappingProperty.html) } — Defines the fields within the mapping, including their types and configurations.

- `spaceType`: string — The distance function used for k-NN search (field-level, outside Method).

- `type`: string (required) — The field data type.

  Must be a valid OpenSearch field type.

- `value`: string — Default value for the field when not specified in a document.
