[[about]] == About === Features * One-to-one mapping with REST API * Configurable, automatic discovery of cluster nodes * Persistent, Keep-Alive connections * Intelligent handling of node/connection failure * Load balancing (with plug-able selection strategy) across all available nodes. * Works great in node, as well as modern browsers (many thanks to https://github com/substack/node-browserify[browserify]!!). * Generalized, plug-able, and highly configurable architecture. You can change anything! See <> === Install in Node [source,shell] -------- npm install --save elasticsearch -------- === Browser Builds To download a build of elasticsearch.js which functions well within modern browsers, use the links below. These versions of the client are currently ***experimental***. They will break from time to time and should probably not be used on public-facing websites (it's a whopping 150kb of code). * v1.1.0 [https://download.elasticsearch.org/elasticsearch/elasticsearch-js/elasticsearch-js-1.1.0.zip[zip]] [https://download.elasticsearch.org/elasticsearch/elasticsearch-js/elasticsearch-js-1.1.0.tar.gz[tarball]] * master [https://download.elasticsearch.org/elasticsearch/elasticsearch-js/elasticsearch-js-master.zip[zip]] [https://download.elasticsearch.org/elasticsearch/elasticsearch-js/elasticsearch-js-master.tar.gz[tarball]] WARNING: The entire API is compatible with IE 10+, Chrome, Firefox, Safari, and Opera. The majority of the API will also work in IE 8 & 9, but those browsers limit cross domain requests to just GET and POST. IE versions before 8 do not support cross-domain requests nativly. ==== Angular Build (elasticsearch.angular.js) * Registers the elasticsearch object as a factory `esFactory` * Uses Angular's `$http` service * Returns promises using Angular's `$q` service to properly trigger digest cycles within Angular .Create a client instance and register it as a service [source,js] ------------------- module.service('es', function (esFactory) { return esFactory({ host: 'localhost:9200', // ... }); }); ------------------- ==== jQuery Build (elasticsearch.jquery.js) * Uses jQuery's `.ajax()` functionality * Returns jQuery "promises" * Registers the module at `jQuery.es` .Create a client with the jQuery build [source,js] ------------------- var client = new $.es.Client({ hosts: 'localhost:9200' }); -------------------