# bower-elasticsearch-js
**Repository Path**: mirrors_elastic/bower-elasticsearch-js
## Basic Information
- **Project Name**: bower-elasticsearch-js
- **Description**: Elasticsearch client for the browser
- **Primary Language**: Unknown
- **License**: Apache-2.0
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2020-08-08
- **Last Updated**: 2025-09-20
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# elasticsearch
Elasticsearch client builds for bower.
# Install
Install with `bower`
```
bower install elasticsearch
```
Add a `
```
## If you are using AngularJS
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 Angular2+
in your module:
```typescript
import * as es from 'elasticsearch-browser/elasticsearch'
@NgModule({
providers: [
{
provide: 'elasticsearch',
useFactory: () => {
return new es.Client({
host: 'https://localhost:9200',
});
},
deps: [],
}
]
})
export class AppModule {}
```
in your service:
```typescript
export class ExampleService {
constructor(@Inject('elasticsearch') private readonly elasticClient) {}
}
```
## 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'
});
```
# Submit Issues, Pull Requests, etc to [elasticsearch-js](https://github.com/elasticsearch/elasticsearch-js).