Skip to content

bug: KNN space_type and method parameters cause OpenSearch 400 error #12294

@abhay-agarwal

Description

@abhay-agarwal

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Using the following index template in opensearch causes a 400 error in localstack:

{
    "template": {
        "settings": {
            "index": {
                "knn": true
            }
        },
        "mappings": {
            "test": {
                "type": "knn_vector",
                "dimension": 1024,
                "space_type": "innerproduct",
                "method": {
                    "name": "hnsw",
                    "engine": "faiss"
                }
            }
        }
    }
}

When the space_type and method parameters are removed, the command succeeds. This is due likely to these parameters not being supported by the latest supported OpenSearch version. However, the version of opensearch that localstack relies on (opensearch-py) doesn't seem to have any such limitation.

Additionally, the latest supported version of opensearch according to the localstack documentation is 2.11. Is there any way that the integration could be updated to support up to 2.17, which is the latest supported by AWS currently.

Expected Behavior

The service should return {acknowledged: true} when a PUT request is sent to /_templates/my-template or /_index_templates/my-template.

How are you starting LocalStack?

With the localstack script

Steps To Reproduce

How are you starting localstack (e.g., bin/localstack command, arguments, or docker-compose.yml)

localstack start

Environment

- OS: MacOS / Windows
- LocalStack:
  LocalStack version: 4.1.1

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions