dropwizard-elasticsearch
dropwizard-elasticsearch copied to clipboard
Added a provider to allow the ES client to be accessed via the resource request scope
Hello,
You can now access the client via the the request scope:
By registering the provider in the application run method:
environment.jersey().register(EsProvider.binder(managedClient));
You will be able to access the client via an injected parameter in the resource method:
public List<Message> getMessages(@Context Client es) {
SearchResponse response = es.prepareSearch etc.
}
Please let me know If I haven't correctly implemented the provider...
Thank you for the project!
Coverage decreased (-7.2%) to 72.18% when pulling 0a5f469d3c6bb5bc60d36082236075a06ea0a65a on jamhall:master into 5a8e637aa595cf95a04bdc18873e0d6b4f93935e on dropwizard:master.
Coverage decreased (-7.2%) to 72.18% when pulling 0a5f469d3c6bb5bc60d36082236075a06ea0a65a on jamhall:master into 5a8e637aa595cf95a04bdc18873e0d6b4f93935e on dropwizard:master.