Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gentics/elasticsearch-java-client
Minimalistic Elasticsearch Java Client based on OkHttp
https://github.com/gentics/elasticsearch-java-client
async-client elasticsearch elasticsearch-client rest-client
Last synced: about 2 months ago
JSON representation
Minimalistic Elasticsearch Java Client based on OkHttp
- Host: GitHub
- URL: https://github.com/gentics/elasticsearch-java-client
- Owner: gentics
- License: apache-2.0
- Created: 2018-01-24T13:48:11.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-06-25T10:58:00.000Z (6 months ago)
- Last Synced: 2024-06-25T12:14:45.183Z (6 months ago)
- Topics: async-client, elasticsearch, elasticsearch-client, rest-client
- Language: Java
- Size: 97.7 KB
- Stars: 5
- Watchers: 17
- Forks: 4
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Minimalistic Elasticsearch Java Client
The aim of this project is to provide an alternative Java REST client for elasticsearch.
This client is model agnostic and thus does not provide any models. Use the [high level REST client](https://www.elastic.co/guide/en/elasticsearch/client/java-rest/master/java-rest-high.html) if you need those models.
The client is also JSON parser agnostic. You can configure your own JSON parser via the `Client#setConverterFunction` method.
## Async API via RxJava 2
```java
Client client = new Client<>("http", "localhost", 9200);
client.setConverterFunction(JsonObject::new);JsonObject doc = client.createIndex("dummy", new JsonObject()).async().toCompletable()
.andThen(client.storeDocument("blub", "default", "one", new JsonObject().put("key1", "value1"))).async().toCompletable()
.andThen(client.readDocument("blub", "default", "one").async()).blockingGet();assertEquals("value1", doc.getJsonObject("_source").getString("key1"));
```## Blocking API
```java
Client client = new Client<>("http", "localhost", 9200);
client.setConverterFunction(JsonObject::new);client.createIndex("dummy", new JsonObject()).sync();
client.storeDocument("blub", "default", "one", new JsonObject().put("key1", "value1")).sync();JsonObject doc = client.readDocument("blub", "default", "one").sync();
assertEquals("value1", doc.getJsonObject("_source").getString("key1"));
```## TODOs
* Add Scroll API support
* Support for multiple ES instances
* More tests