Skip to content

Increase maxClauseCount in Opensearch Serverless

0

Is it possible to update the maxClauseCount setting for an OpenSearch Serverless collection?

We're trying to migrate from an older AWS Elasticsearch domain to an OpenSearch Serverless collection. We were able to increase the maxClauseCount setting for the older domain and our use case requires this setting to be larger than the default (1024).

When running the same queries on the new OpenSearch Serverless collection, this error message is received:

RequestError(400, 'search_phase_execution_exception', 'too_many_clauses: maxClauseCount is set to 1024')

asked 2 years ago946 views

1 Answer
0

Unfortunately, it is not currently possible to directly update the maxClauseCount setting for an Amazon OpenSearch Serverless collection. The maxClauseCount setting, which limits the number of clauses allowed in a query, is fixed at 1024 for OpenSearch Serverless collections and cannot be modified by users.

This limitation is due to the managed nature of OpenSearch Serverless, where many low-level configuration options are handled automatically by AWS to ensure optimal performance and stability across all collections.

To work around this limitation in your migration from an older AWS Elasticsearch domain to OpenSearch Serverless, you may need to consider the following options:

  1. Optimize your queries to reduce the number of clauses. This might involve restructuring your data or using alternative query techniques that achieve the same results with fewer clauses.

  2. Split your complex queries into multiple simpler queries that fall within the 1024 clause limit, and then combine the results in your application logic.

  3. If your use case absolutely requires a higher maxClauseCount and cannot be adapted to work within the 1024 limit, you may need to consider using a self-managed OpenSearch cluster or a managed OpenSearch Service domain instead of OpenSearch Serverless. These options would allow you to modify the maxClauseCount setting to match your requirements.

It's worth noting that while OpenSearch Serverless offers many advantages in terms of automatic scaling and management, it does come with some limitations on customization compared to self-managed or fully managed OpenSearch options. In cases where specific configuration changes are necessary, you may need to evaluate which OpenSearch deployment option best fits your needs.
Sources
Troubleshooting Amazon OpenSearch Service - Amazon OpenSearch Service
Opensearch Serverless scale related questions | AWS re:Post

answered 2 years ago

AWS
SUPPORT ENGINEER

reviewed 2 years 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.