GithubHelp home page GithubHelp logo

esclient's Introduction

Installation

$ npm install pelias-esclient

NPM

Note: you will need node and npm installed first.

The easiest way to install node.js is with nave.sh by executing [sudo] ./nave.sh usemain stable

Configuration

see: https://github.com/pelias/config

Full configuration reference: http://www.elasticsearch.org/guide/en/elasticsearch/client/javascript-api/current/configuration.html

Usage

This library provides an elasticsearch client which is configured for bulk imports.

The API is exactly the same as https://github.com/elasticsearch/elasticsearch-js with the addition of a buffered streaming import named client.stream.

var esclient = require('pelias-esclient')();

var command = {
  _index: 'pelias', _type: 'myindex', _id: 'myrecordid',
  data: {
    my: 'properties'
  }
}

esclient.stream.write( command );
var esclient = require('pelias-esclient')();

some_other_stream.pipe( esclient.stream );

Contributing

Please fork and pull request against upstream master on a feature branch.

Pretty please; provide unit tests and script fixtures in the test directory.

Running Unit Tests

$ npm test

Continuous Integration

Travis tests every release against node version 0.10

Build Status

esclient's People

Contributors

missinglink avatar

Stargazers

 avatar Cory Armbrecht avatar

Watchers

Randy Meech avatar Brett Camper avatar Ivan Willig avatar Robert Marianski avatar David Riordan avatar  avatar Stephen Hess avatar  avatar Harish Krishna avatar James Cloos avatar Matt Blair avatar Richard Welty avatar Ekta Daryanani avatar Grace Bevilacqua avatar  avatar

esclient's Issues

Remove dependency of pelias-config

I would suggest that using pelias-config is counter intuitive to the end user. I expected that the config I pass esclient is passed directly to the elasticsearch client. Here is what I would propose:

module.exports = function( config ){

  // Create new esclient with settings
  var client = new elasticsearch.Client( config || {} );

and then a someone who wants to use pelias-config, would just do the following:

  var settings = require('pelias-config').generate();
  var esclient = require('pelias-esclient')(settings);

This seems a much cleaner separation to how I would expect as a consumer of esclient.

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.