elasticsearch-search-stream

    1.0.2 • Public • Published

    Stream search results from elastic search

    Requirements

    Any elasticsearch client supporting search and scroll.

    Verified against elasticsearch@3.1.0+

    Options

    client

    An elasticsearch client

    search

    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"))

    Install

    npm i elasticsearch-search-stream

    DownloadsWeekly Downloads

    5

    Version

    1.0.2

    License

    MIT

    Last publish

    Collaborators

    • jyothis-qb
    • qburst-pratyush
    • cdrohithmqb
    • arunks_qburst
    • sudheeshqburst
    • davoodul
    • athul-qburst
    • mable-liza-mathew
    • sowmyab
    • anoop-kuttikkattu
    • munisa
    • dheerajds
    • arjunqb
    • ashishqburst
    • lanetix-system
    • manu-kodiyan-winmore
    • dnm-winmore
    • mkdyanugk
    • vigneshk7
    • soumyaarun
    • aswanth
    • sajith.qb
    • dhiluraj-qburst
    • anandqb
    • arun-dtk
    • vikasqb
    • acpradosh1234