Overview

Updated at:

Cava-based plug-ins are supported only for exclusive applications.

Introduction

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. Compared with the expressions that OpenSearch supports natively, Cava-based sort plug-ins offer the following advantages:

  • Greater customization: Cava provides richer syntax features than expressions, such as for loops, function definitions, and class definitions, so you can implement your own business logic.

  • Easier maintenance: Cava-based sort plug-ins are more readable than expressions, making them easier to maintain.

  • Low learning curve: Cava uses Java-like syntax, so if you are familiar with Java, you can get started with Cava easily.

The following topics cover Cava syntax in detail, along with the various Cava libraries provided by OpenSearch.