The Cava configuration in Advanced Configurations enables the Cava plugin for the engine. You can upload Cava scripts to customize functions, scorers, and summaries.
Add Cava configuration
-
To create or modify an online configuration, navigate to Configuration Center > Advanced Configurations > Cava configuration.
-
Select the version to edit and click Edit.
You can create directories or upload files here.
File upload requirements:
-
The file size cannot exceed 20 MB.
-
Supported file formats: .cava, .json, .txt, and .xml.
Directory name requirements:
-
The name can contain letters, numbers, and underscores (_).
-
The name cannot exceed 100 characters.
-
After you upload the Cava script, return to the Cava configuration page and publish the edited version.
Publishing the version automatically generates a new Cava configuration version.
To apply the changes, you must push the online configuration.
-
Push the online configuration: Navigate to O&M > Configuration Update, select the online configuration, find the newly published Cava configuration version, select the target cluster, and click OK.
-
You can monitor the deployment progress under Change History > cluster change.
The configuration update progresses through the following stages: check, merge task creating, merging, updating target, and config loaded. The progress for each cluster is displayed independently.
After this Finite State Machine (FSM) process is complete, the Cava configuration file takes effect in the engine.
Activate Cava configuration
-
After you upload the Cava script to the instance, you must modify the Cava-related parameters in the
default_biz.jsonfile, which is located under Advanced Configurations > query configuration. This step makes the Cava configuration available to the instance for queries.
Parameters:
-
cava_alloc_size_limit: The maximum memory that can be allocated for a query. You can omit this parameter to use the default value. -
cava_compile_thread_num -
cava_config -
cava_loop_and_func_limit -
cava_max_variable_count -
cava_module_cache_size: The maximum number of source code entries from queries to cache. If the limit is exceeded, the least recently used (LRU) entries are evicted. You can omit this parameter to use the default value. -
enable_cava: Specifies whether to enable the Cava feature.
The following directory structure corresponds to the default_biz.json configuration:
├── AliTokenizer.conf
├── analyzer.json
├── cava
│ ├── cache
│ │ └── SampleScorer2.cava
│ ├── lib
│ │ ├── Feature1.cava
│ │ ├── Feature2.cava
│ │ └── FeatureLib.cava
│ └── src
│ ├── DefaultScorer.cava
│ ├── MultiValueScorer.cava
│ ├── MultValueSetScorer.cava
│ ├── SampleScorer.cava
│ ├── ScorerAudition.cava
│ └── UseFeatureLib.cava
├── qrs.json
├── schemas
│ └── simple_schema.json
└── zones
└── simple
└── default_biz.json
-
After you finish editing, publish the edited query configuration.
Publishing the configuration automatically generates a new query configuration version.
-
To apply the modified query configuration, push the online configuration. Navigate to O&M > Configuration Update, select the online configuration, find the newly published query configuration version, select the target cluster, and click OK.
-
You can monitor the deployment progress under Change History > cluster change.
The query configuration update also progresses through the check, merge task creating, merging, updating target, and config loaded stages.
After this FSM process is complete, the Cava configuration file becomes available in the engine.
Delete Cava configuration
-
You can delete a Cava configuration version if its status is Not Used. To do so, navigate to the Advanced Configurations > Cava configuration page and click Delete.
You cannot directly delete a Cava configuration version that is In Use; you can only View it. To delete it, go to O&M Center > O&M > Configuration Update. Select a different Cava configuration to apply and click OK. Once the original version's status changes to Not Used, you can delete it.
Notes
-
You can only view Cava configuration versions that are in use. You cannot delete them directly.