Angular Build

edit
  • 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

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',
    // ...
  });
});