A Swift Elasticsearch Client built on top of SwiftNIO
33
stars
130
commits
Swift
primary language
Jul 1, 2026
updated
An Elasticsearch client for Swift based on SwiftNIO and AsyncHTTPClient. If you're interested in using this with AWS you may want to check out Soto Elasticsearch NIO Client.
First add the library as a dependency in your dependencies array in Package.swift:
.package(url: "https://github.com/brokenhandsio/elasticsearch-nio-client.git", from: "0.1.0"),
Then add the dependency to the target you require it in:
.target(
name: "App",
dependencies: [
// ...
.product(name: "ElasticsearchNIOClient", package: "elasticsearch-nio-client")
],
)
Creating an instance of ElasticsearchClient depends on your environment, but you should be able to work it out depending on what you need. For Vapor, for example, you'd do something like:
let elasticsearchClient = ElasticsearchClient(httpClient: req.application.http.client.shared, eventLoop: req.eventLoop, logger: req.logger, host: host)
Currently the library supports:
If you'd like to add extra functionality, either open an issue and raise a PR. Any contributions are gratefully accepted!
The library has been tested again Elasticsearch 8.4, but should work for the most part against older versions.
A Swift Elasticsearch Client built on top of SwiftNIO
33
stars
130
commits
Swift
primary language
Jul 1, 2026
updated
An Elasticsearch client for Swift based on SwiftNIO and AsyncHTTPClient. If you're interested in using this with AWS you may want to check out Soto Elasticsearch NIO Client.
First add the library as a dependency in your dependencies array in Package.swift:
.package(url: "https://github.com/brokenhandsio/elasticsearch-nio-client.git", from: "0.1.0"),
Then add the dependency to the target you require it in:
.target(
name: "App",
dependencies: [
// ...
.product(name: "ElasticsearchNIOClient", package: "elasticsearch-nio-client")
],
)
Creating an instance of ElasticsearchClient depends on your environment, but you should be able to work it out depending on what you need. For Vapor, for example, you'd do something like:
let elasticsearchClient = ElasticsearchClient(httpClient: req.application.http.client.shared, eventLoop: req.eventLoop, logger: req.logger, host: host)
Currently the library supports:
If you'd like to add extra functionality, either open an issue and raise a PR. Any contributions are gratefully accepted!
The library has been tested again Elasticsearch 8.4, but should work for the most part against older versions.
Swift
100.0%