Answer a question

Does anyone know of an elasticsearch client library for iOS? Would be a bonus if it was written in swift as well.

The elastic search 'clients' section shows multiple libraries for a number of platforms but nothing for iOS, I feel like someone must have done this?

Cheers

Answers

I doubt that anyone has - last time I checked there were none and for good reasons. Keep in mind that in order to allow an IOS client (or Android for that matter) to use a client library to connect to Elasticsearch you'd have to open up your cluster for either an http or node access - which would allow anyone to do anything to your cluster.

Maybe you could proxy it to prevent deletions and insertions but even so it would open up your cluster's data and open you up to DoS attacks.

Generally a better idea is to create your own REST API that incorporates some type of authentication and authorization and does not open up your cluster to the world.

If you still feel strongly about moving forward you can always just hit the http interface of the REST API for ES. Or take a look at this project someone was working on a few years ago at least to give you a head start:

https://github.com/tallpsmith/ElasticSearchIOSHead

Some recent discussions on this topic:

http://elasticsearch-users.115913.n3.nabble.com/Objective-C-client-for-ElasticSearch-iphone-ipad-etc-td3911216.html

Running Elasticsearch server on a mobile device (android / iphone / ios)

Logo

欢迎大家访问Elastic 中国社区。由Elastic 资深布道师,Elastic 认证工程师,认证分析师,认证可观测性工程师运营管理。

更多推荐