Package Exports
- elasticsearch-browser
- elasticsearch-browser/elasticsearch.angular.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (elasticsearch-browser) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
elasticsearch
Elasticsearch client builds for bower.
Install
Install with bower
bower install elasticsearchAdd a <script> to your html file and off you go!:
<script src="/bower_components/elasticsearch/elasticsearch.js"></script>
<script>
var client = elasticsearch.Client({
host: 'localhost:9200'
});
</script>If you are using Angular
Use elasticsearch.angular.js 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'
});