Company
Date Published
Author
Konrad Beiske
Word count
1266
Language
English
Hacker News points
None

Summary

This article by Konrad Beiske discusses the process of extending the Elasticsearch scripting module by adding support for new scripting languages through plugins. It focuses on creating a language plugin using the JSR-223 API, which is designed for various scripting engines on the JVM, rather than any specific language. The article details the implementation of the ScriptEngineService interface, which involves defining the script types and extensions, compiling scripts, and ensuring thread safety. It explains how to integrate the new scripting engine with Elasticsearch's ScriptService, which handles caching and invocation of scripts. The process includes using Guice's multibinder feature for registering multiple engines and demonstrating a basic plugin implementation with engines such as Luaj, AppleScript, and Mozilla Rhino. Although the implementation is primarily a proof of concept, it serves as a foundational example for developing plugins compatible with JSR-223 interfaces, with further customization required for optimal integration with Elasticsearch.