Swiftpack.co -  brokenhandsio/elasticsearch-nio-client as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
brokenhandsio/elasticsearch-nio-client
A Swift Elasticsearch Client built on top of SwiftNIO
.package(url: "https://github.com/brokenhandsio/elasticsearch-nio-client.git", from: "0.4.1")

Elasticsearch NIO Client

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.

Installation and Usage

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)

Supported Features

Currently the library supports:

  • Document create
  • Document update
  • Document delete
  • Document search
  • Document count
  • Document retrieve
  • Bulk create/update/delete/index
  • Index delete
  • Index exists
  • Scripting

If you'd like to add extra functionality, either open an issue and raise a PR. Any contributions are gratefully accepted!

Elasticsearch Version

The library has been tested again Elasticsearch 7.6.2, but should work for the most part against older versions.

GitHub

link
Stars: 9
Last commit: Yesterday

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Release Notes

0.4.1
4 weeks ago

Add better complex search support

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API