Multi platform kotlin client for Elasticsearch & Opensearch with easily extendable Kotlin DSLs for queries, mappings, bulk, and more.
Kt-search is a Kotlin Multi Platform library to search across the Opensearch and Elasticsearch ecosystem on any platform that kotlin can compile to. It provides Kotlin DSLs for querying, defining mappings, bulk indexing, index templates, index life cycle management, index aliases, and much more. The key goal for this library is to provide a best in class developer experience for using Elasticsearch and Opensearch.
Indices, Settings, Mappings, and Aliases
Deep Paging Using search_after and scroll
Efficiently Ingest Content Using Bulk Indexing
Migrating from the old Es Kotlin Client
This manual documents how to use the kotlin search client and all of its features. As a manual like this contains a lot of code samples, I ended up writing a mini framework to allow me to generate markdown from Kotlin.
The project for this is called Kotlin4Example. Most of the documentation you will find here has correct code samples that get tested and compiled whenever this project is built and whenever something gets refactored that would affect one of the code samples.
There are several libraries that build on kt-search:
kt-search
with kotlinx-cli
to make scripting really easy. Combined with the out of the box support for managing snapshots, creating template mappings, bulk indexing, data-streams, etc. this is the perfect companion to script all your index operations. Additionally, it’s a great tool to e.g. query your data, or build some health checks against your production indices.Additionally, I also maintain a few other search related projects that you might find interesting.