Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gulp-elasticsearch-indexer

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-elasticsearch-indexer

Index json documents in Elastic Search with Gulp

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

gulp-elasticsearch-indexer

NPM Version

Index json documents in Elastic Search with Gulp

Usage

Install

npm install --save-dev gulp-elasticsearch-indexer

Example

var gulp = require('gulp');
var gulpElasticSearchIndexer = require('gulp-elasticsearch-indexer');

gulp.task('fixtures', function () {
    return gulp.src('data/**/*.json')
        .pipe(gulpElasticSearchIndexer());
});

Connection configuration

Options are passed to the elastic search client so anything which adheres to the official documentation is supported. This includes the defaults specified in the official configuration.

var gulp = require('gulp');
var gulpElasticSearch = require('gulp-elasticsearch-indexer');

gulp.task('fixtures', function () {
    return gulp.src('data/**/*.json')
        .pipe(gulpElasticSearchIndexer());
});

// is the same as

gulp.task('fixtures', function () {
    return gulp.src('data/**/*.json')
        .pipe(gulpElasticSearchIndexer({host: 'http://localhost:9200'}));
});

Document indexing

The index, type and id of the document are determined from the file path automatically. The id is determined from the filename of the document (without the extension) then the type is the parent folder name and the index is the grandparent folder name.

**/{index}/{type}/{id}.json

These values can be overwritten by passing setting the index, type and id options of the elastic search indexer.

var gulp = require('gulp');
var gulpElasticSearch = require('gulp-elasticsearch-indexer');

gulp.task('fixtures', function () {
    return gulp.src('data/**/*.json')
        .pipe(gulpElasticSearchIndexer({index: 'foo', type: 'bar', id: 'baz'}));
});

Additionally all supported options for client.index() passed into the constructor will be used when indexing the document.

Keywords

FAQs

Package last updated on 16 Aug 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc