We also provide builds of the elasticsearch.js client for use in the browser. These versions of the client are currently experimental. We test these builds using saucelabs in Chrome, Firefox, and Internet Explorer 10, and 11.
While there is a way to get it working in IE 9, the browser severely limits what you can do with cross-domain requests. Because of these limits, many of the API calls and other functionality do not work.
-
Registers an
esFactory
factory in the"elasticsearch"
module -
Uses Angular’s
$http
service -
Returns promises using Angular’s
$q
service to properly trigger digest cycles within Angular
Note
|
Checkout an example that integrates elasticsearch.js with angular on GitHub |
Include the
"elasticsearch"
module in your appvar myApp = angular.module('myApp', ['elasticsearch']);
Create a client instance and register it as a service
module.service('client', function (esFactory) {
return esFactory({
host: 'localhost:9200',
// ...
});
});