2023
ZIO Elasticsearch
The Type-Safe Elasticsearch Client the ZIO Ecosystem Needed
Our roleLibrary development, backend development, open source contribution
ZIO Elasticsearch is a ZIO-native library for communicating with Elasticsearch clusters - type-safe, composable, and designed to feel like a natural part of the ZIO stack. LambdaWorks identified the gap, built the library, and released it as an open-source contribution to the ecosystem.
The gap in the ZIO ecosystem
No first-class Elasticsearch clientDevelopers combining ZIO and Elasticsearch were working around the problem: Java clients that didn't compose cleanly with ZIO's effect system, or thin wrappers that gave up type safety.
Production standard requiredNeither option was acceptable for production use at the standard ZIO teams expect.
What we built
Type-safe API - Full type safety across indexing, querying, and aggregation. Compile-time guarantees that catch errors before runtime. No stringly-typed query construction.
Document indexing - Add, update, and delete documents with type-safe operations composing naturally with ZIO's effect system.
Query DSL - Composable query construction for search, filter, and aggregation operations. Builds queries the way ZIO code is written, not the way Java clients force it.
Result decoding - Structured decoding of Elasticsearch responses into typed Scala models via ZIO Json.
Highlights and inner hits - Retrieve contextual match data alongside primary results.
Typed aggregations - Build and decode aggregation pipelines with full type information end-to-end.
The stack
Built on ZIO core, ZIO Schema, ZIO Prelude, and ZIO Json for ecosystem consistency. Sttp as the HTTP client layer. Designed to the conventions ZIO developers already know - not a Java client with a Scala wrapper on top.
Why it's open source
Open-source infrastructure libraries are foundational to ecosystem health. LambdaWorks built ZIO Elasticsearch because the gap mattered - and contributed it back because the ZIO community benefits from it existing. For teams evaluating LambdaWorks' Scala depth, this is the reference: a production-grade library built to ZIO's own standards, used by the ecosystem.