elasticsearch-search-stream

elasticsearch search results returned as readable stream

Showing:

Popularity

Downloads/wk

3

GitHub Stars

2

Maintenance

Last Commit

6yrs ago

Contributors

2

Package

Dependencies

1

Size (min+gzip)

8.4KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

Elasticsearch Search Stream

Stream search results from elastic search

Installation

npm install --save elasticsearch-search-stream

Requirements

Any elasticsearch client supporting search and scroll.

Verified against elasticsearch@3.1.0+

Options

client

An elasticsearch client

An elasticsearch search

Usage

var SearchStream = require('elasticsearch-search-stream')
var elasticsearch = require('elasticsearch')
var stringify = require('csv-stringify')
var fs = require('fs')

var client = new elasticsearch.Client({
  host: 'localhost:9202',
  log: 'trace'
})

// a scroll of '30s' will be applied by default
var search = {
  index: '2731107',
  body: {
    filter: {
      prefix: {
        firstName: 'a'
      }
    }
  }
}

var searchStream = new SearchStream({ client: client, search: search })

searchStream
.pipe(stringify())
.pipe(fs.createWriteStream("my_file.txt"))

Alternatives

Inspired by node-pg-query-stream

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100