IMPORTANT: elasticsearch.js has been replaced by the new Elasticsearch JavaScript client. We strongly advise you to migrate to the new client. To learn more, see the migration guide.
Angular Build
edit
IMPORTANT: This documentation is no longer updated. Refer to Elastic's version policy and the latest documentation.
Angular Build
edit-
Registers an
esFactoryfactory in the"elasticsearch"module -
Uses Angular’s
$httpservice -
Returns promises using Angular’s
$qservice to properly trigger digest cycles within Angular
Checkout an example that integrates elasticsearch.js with angular on GitHub
Include the "elasticsearch" module in your app.
var 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',
// ...
});
});