The official low-level Elasticsearch client, for use in the browser.
npm install elasticsearch-browserElasticsearch client builds for bower.
Install with bower
```
bower install elasticsearch
Add a
`
instead. This will create an elasticsearch module with an esFactory that you can use.
`
/*
* create your app module, specify "elasticsearch" as a dependency
*/
var app = angular.module('myApp', ['elasticsearch']);/*
* create a service, which provides your elasticsearch client
* to other parts of your application
*/
app.service('es', function (esFactory) {
return esFactory({
host: 'localhost:9200',
// ...
});
});
`If you are using jQuery
Use elasticsearch.jquery.js instead. Rather than a global elasticsearch it will create a jQuery.es namespace.
`
var client = new $.es.Client({
hosts: 'localhost:9200'
});
``