Java HTTP Client for ElasticSearch
Hi There is a brand new project just matching your needs. It Java based Rest API for Elasticsearch
Check it out! its name JEST
A new "official" REST-based java client will be available starting with v5.0.0-alpha4.
We just open sourced Flummi, a Java HTTP/REST client for Elastic Search. It imitates the transport client's API as closely as possible, making it easy to port existing code. It also provides a better abstraction level than Jest, because it reports all the errors with Exceptions. Give it a try!
Simple usage example:
Flummi flummi = new Flummi("http://elasticsearch.base.url:9200");
SearchResponse searchResponse = flummi
.prepareSearch("products")
.setQuery(
QueryBuilders.termQuery("color", "yellow").build()
)
.execute();
System.out.println("Found "
+ searchResponse.getHits().getTotalHits()
+ " products");
searchResponse.getHits()
.stream().map(hit -> hit.getSource().get("name").getAsString())
.forEach(name -> System.out.println("Name: " + name));