All Products
Search
Document Center

OpenSearch:cava configurations

Last Updated:Apr 01, 2026

Cava is OpenSearch's built-in scripting language for extending search behavior. Upload Cava scripts to the Cava Configurations tab to define custom functions, scorers, and summaries for your cluster.

How it works

A Cava configuration moves through four stages before it takes effect in queries:

StageActionResult
1. UploadCreate directories and upload script filesDraft version created
2. PublishClick Publish New VersionVersioned, immutable snapshot generated
3. ApplySelect the version and apply it to the clusterCluster update initiated
4. ActiveFinite-state machine (FSM) process completesCava script available for queries
Note

Note: Published versions are immutable. To update a configuration, modify a published version to create a new draft. The system saves only the latest draft — earlier unsaved drafts are discarded.

Prerequisites

Before you begin, ensure that you have:

  • An OpenSearch instance with Cluster Configuration access

  • Cava script files ready to upload

File requirements:

ConstraintLimit
Maximum file size20 MB
Allowed formats.cava, .json, .txt, .xml

Directory name requirements:

ConstraintRule
Allowed charactersLetters, digits, and underscores (_)
Length1–100 characters

Upload and publish a Cava configuration

  1. On your instance details page, choose Configuration Management > Cluster Configuration in the left-side pane.

  2. Click the Cava Configurations tab, find the version to modify, and click Modify in the Actions column.

  3. On the Modify page, create directories or upload your Cava script files.

  4. (Optional) Configure the Cava parameters listed in Cava configuration parameters.

  5. Click Publish New Version.

    The system generates a new versioned snapshot. To make further changes, modify the published version to create a new draft.

Cava configuration parameters

Configure these parameters on the Modify page before publishing:

ParameterDescription
enable_cavaEnables or disables the Cava feature for this cluster.
cava_alloc_size_limitMaximum memory allocated per query. Leave blank to use the default value.
cava_module_cache_sizeMaximum number of source code blocks passed to the cache query. When the limit is exceeded, the least recently used (LRU) algorithm evicts older entries. Leave blank to use the default value.
cava_compile_thread_num
cava_loop_and_func_limit
cava_max_variable_count
cava_config

Apply a Cava configuration to your cluster

After publishing a version, apply it to your cluster:

  1. Go to the Cluster Management page.

  2. In the Configuration Information section, click Update.

  3. In the Update Cluster Configuration panel, select the published Cava configuration version and confirm.

  4. Track the rollout on the Change History page in the Extended Features module.

After the FSM process completes, the Cava configuration is active and available for queries.

Delete a Cava configuration version

Only versions in the Unused state can be deleted. Versions in the In Use state are protected and cannot be deleted.

To delete an unused version, go to the Cava Configurations tab on the Cluster Configuration page, find the version with the Unused status, and delete it.