Skip to content

Radial search (min_score / max_distance) causing conflicting errors in Amazon OpenSearch but works in OpenSearch 3.3.2

0

We are observing inconsistent behavior with radial search (min_score / max_distance) in Amazon OpenSearch Service.

Issue

  • When using only min_score or max_distance:
Cannot invoke "java.lang.Integer.intValue()" because "this.k" is null
  • When adding k along with min_score / max_distance:
[knn] requires exactly one of k, distance or score to be set

This creates a conflicting situation where:

  • Execution appears to require k
  • Validation explicitly forbids it

Note: According to the OpenSearch documentation, [knn] requires exactly one of k, distance or score to be set is expected behavior, as only one of k, min_score, or max_score can be used at a time.

Cluster / Version Details

{
    "version": {
        "number": "7.10.2",
        "build_type": "tar",
        "build_hash": "unknown",
        "build_date": "2025-12-22T16:42:07.599198842Z",
        "build_snapshot": false,
        "lucene_version": "10.3.1",
        "minimum_wire_compatibility_version": "2.19.0",
        "minimum_index_compatibility_version": "2.0.0"
    }
}

Additional information: The AWS console shows the service software version as OpenSearch_3_3_R20260217-P1 (latest)

Comparison with local setup

The same query works correctly in OpenSearch version 3.3.2 (Docker):

  • min_score / max_distance works without requiring k
  • No conflicting validation/runtime errors

Example k-NN query tested successfully locally

PUT verify-radial-search
{
    "settings": {
        "index.knn": true
    },
    "mappings": {
        "properties": {
            "text_vector": {
                "type": "knn_vector",
                "dimension": 3,
                "space_type": "l2",
                "method": {
                    "name": "hnsw",
                    "engine": "faiss",
                    "parameters": {
                        "ef_construction": 100,
                        "m": 16
                    }
                }
            }
        }
    }
}


POST _bulk
{"index": {"_index": "verify-radial-search"}}
{"text_vector": [1.0, 2.0, 3.0]}
{"index": {"_index": "verify-radial-search"}}
{"text_vector": [4.0, 5.0, 6.0]}


GET verify-radial-search/_search
{
  "query": {
    "knn": {
      "text_vector": {
        "vector": [1.5, 2.5, 3.5],
        "max_distance": 10
      }
    }
  }
}


GET verify-radial-search/_search
{
  "query": {
    "knn": {
      "text_vector": {
        "vector": [1.5, 2.5, 3.5],
        "min_score": 0.1
      }
    }
  }
}

Questions

  • Is radial search (min_score / max_distance) fully supported in Amazon OpenSearch Service?
  • Is this conflicting behaviour a known limitation or bug?
  • Are there recommended workarounds or plans to align with OpenSearch 3.x behaviour?
asked a month ago31 views
1 Answer
1

Based on the information available about Amazon OpenSearch Service and OpenSearch 3.3, I can provide some context, though the specific radial search issue you're experiencing isn't directly addressed in the current documentation.

Amazon OpenSearch Service does support OpenSearch version 3.3, which includes several improvements to vector search capabilities through the Neural Search plugin. The service has made enhancements to make semantic search more efficient and provide optimization options for specific data, performance, and relevance needs.

However, there are important considerations when working with k-NN functionality in Amazon OpenSearch Service, particularly regarding deprecated index settings. When upgrading to OpenSearch 3.x, certain k-NN related index settings that were deprecated in 2.x can cause validation failures:

  • index.knn.algo_param.ef_construction
  • index.knn.algo_param.m
  • index.knn.space_type

These deprecated settings need to be removed before upgrading to OpenSearch 3.x. If your domain contains indexes with these settings, you may need to reindex your data.

The conflicting behavior you're experiencing with radial search parameters (min_score/max_distance requiring k, but validation forbidding it) suggests there may be an inconsistency between the validation logic and execution logic in your specific version. Since your local OpenSearch 3.3.2 instance works correctly with the same queries, this points to a potential service-specific issue.

For troubleshooting configuration-related issues in Amazon OpenSearch Service, you can perform a dry run validation check using the console or API to ensure your domain is eligible for updates and to identify any specific issues that need resolution.

I recommend opening a support case with AWS to report this specific behavior, as it appears to be a discrepancy between the managed service implementation and the open-source OpenSearch 3.3.2 behavior. The AWS support team can investigate whether this is a known issue and provide guidance on workarounds or timelines for resolution.
Sources
Upgrading Amazon OpenSearch Service domains - Amazon OpenSearch Service
Amazon OpenSearch Service now supports OpenSearch version 3.3 - AWS
Making configuration changes in Amazon OpenSearch Service - Amazon OpenSearch Service

answered a month ago
EXPERT
reviewed a month ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.