# MethodProperty

Configuration for k-NN search method.

- Source: Generated at build time
- Type last changed: v2.217.0 · 25 Sep 2025

## 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';
const methodProperty: opensearchserverless.CfnIndex.MethodProperty = {
  name: 'name',

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

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

method_property = opensearchserverless.CfnIndex.MethodProperty(
    name="name",

    # the properties below are optional
    engine="engine",
    parameters=opensearchserverless.CfnIndex.ParametersProperty(
        ef_construction=123,
        m=123
    ),
    space_type="spaceType"
)
```

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

MethodProperty methodProperty = MethodProperty.builder()
        .name("name")

        // the properties below are optional
        .engine("engine")
        .parameters(ParametersProperty.builder()
                .efConstruction(123)
                .m(123)
                .build())
        .spaceType("spaceType")
        .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.OpenSearchServerless;

var methodProperty = new MethodProperty {
    Name = "name",

    // the properties below are optional
    Engine = "engine",
    Parameters = new ParametersProperty {
        EfConstruction = 123,
        M = 123
    },
    SpaceType = "spaceType"
};
```

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"

methodProperty := &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

- `engine`: string — The k-NN search engine to use.

- `name`: string (required) — The algorithm name for k-NN search.

- `parameters`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnIndex.ParametersProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_opensearchserverless.CfnIndex.ParametersProperty.html) — Additional parameters for the k-NN algorithm.

- `spaceType`: string — The distance function used for k-NN search.
