Note: Cava-based plug-ins are supported only for exclusive applications.
Cava is a programming language developed by the OpenSearch engine team, built on LLVM (Low-Level Virtual Machine). It uses Java-like syntax and delivers performance equivalent to C++. As an object-oriented language, Cava supports just-in-time (JIT) compilation and various security checks that make programs more robust.
Use Cava and the Cava libraries provided by OpenSearch to write custom sort plug-ins. When the expressions that OpenSearch supports natively cannot meet your business requirements, Cava-based sort plug-ins provide greater control. Cava-based sort plug-ins offer three advantages over native expressions:
Flexibility: Write for loops, define functions, and create classes to match any business logic — capabilities that native expressions do not support.
Maintainability: Cava code is more readable than expression syntax, making sort plug-ins easier to maintain.
Low learning curve: If you know Java, you can get started with Cava immediately.
The following topics cover Cava syntax and the Cava libraries provided by OpenSearch.