Giter Club home page Giter Club logo

bower-elasticsearch-js's Introduction

elasticsearch

Elasticsearch client builds for bower.

Install

Install with bower

bower install elasticsearch

Add 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 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:

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:

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.

bower-elasticsearch-js's People

Contributors

fabiocarneiro avatar lukasolson avatar mgreau avatar spalger avatar spenceralger avatar viranch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.