May 2014 Summaries
2 posts from Elastic
Filter
Month:
Year:
Post Summaries
Back to Blog
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.
May 30, 2014
1,266 words in the original blog post.
Managing Elasticsearch fields when conducting searches is crucial for optimizing performance by controlling the amount of data transferred. By using the fields parameter, users can limit the fields returned for each search hit, significantly reducing data size and bandwidth usage. For example, minimizing document sizes from 20KB to 800 bytes can drastically decrease bandwidth needs from 20 MB/s to 800 KB/s for 100 requests per second. The source parameter, while enabled by default, can be filtered to include or exclude specific parts of a document, although this does not save CPU or disk resources. Nested fields require the use of the source field due to their non-leaf nature, while unstored fields can be accessed via fielddata_fields, which caches terms in memory, making it efficient if already used for sorting or faceting. Additionally, script fields allow for dynamic computation of field values, though they necessitate enabling dynamic scripts with associated security considerations. These strategies collectively enhance the efficiency of data retrieval in Elasticsearch.
May 13, 2014
1,020 words in the original blog post.