Elasticsearch Loop is package are made your elasticsearch full paging loop is easier. Just few line of code you could loop all paging and take action with your data in elasticsearch
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
README.md
index.js
package.json

README.md

Elasticsearch loop

Elasticsearch Loop is package are made your elasticsearch full paging loop is easier. Just few line of code you could loop all paging and take action with your data in elasticsearch

Installation

npm install elasticsearch-loop

Example

var elasticLoop = require("elasticsearch-loop");

// Connect Elasticsearch
elasticLoop.connect({
    host: 'localhost:9200'
});

//Remove comment when you want to debug
//elasticLoop.debugMode();

elasticLoop.query({
        index: 'main',
        q: 'time:[2016-01-01 TO 2016-12-31]',
},function(data){
    //What do you want to do with each data.
},function(data){
    //What do you want to do when your loop is success finish.
},function(data){
    //What do you want to do when query is error.
});

Remark