New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

elasticsearch-scroll-stream

Package Overview
Dependencies
Maintainers
2
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

elasticsearch-scroll-stream - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

7

lib/elasticsearch-stream.js

@@ -45,3 +45,8 @@ /**

response.hits.hits.forEach(function(hit) {
self.push(JSON.stringify(hit.fields));
if(hit.fields) {
self.push(JSON.stringify(hit.fields));
} else {
self.push(JSON.stringify(hit._source));
}
self._counter++;

@@ -48,0 +53,0 @@ });

2

package.json
{
"name": "elasticsearch-scroll-stream",
"version": "1.0.3",
"version": "1.0.4",
"description": "Elasticsearch Scroll query results as a Stream",

@@ -5,0 +5,0 @@ "repository": {

@@ -126,3 +126,3 @@

Copyright (c) 2014 Francesco Valente
Copyright (c) 2016 Francesco Valente

@@ -129,0 +129,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy

@@ -56,3 +56,3 @@ /**

it('Lib Elasticsearch: should stream data correctly from elasticsearch', function(done) {
it('Lib Elasticsearch: should stream data correctly when fields are specified', function(done) {
this.timeout(10000);

@@ -100,3 +100,47 @@ var counter = 0;

});
it('Lib Elasticsearch: should stream data correctly when no fields are specified (full _source)', function(done) {
this.timeout(10000);
var counter = 0;
var current_doc;
var elasticsearch_client = new elasticsearch.Client();
var es_stream = new ElasticsearchScrollStream(elasticsearch_client, {
index: 'elasticsearch-test-scroll-stream',
type: 'test-type',
scroll: '10s',
size: '50',
body: {
query: {
bool: {
must: [
{
query_string: {
default_field: "_all",
query: 'name:third*'
}
}
]
}
}
}
});
es_stream.on('data', function(data) {
current_doc = JSON.parse(data.toString());
expect(current_doc.name).to.equal("third chunk name");
counter++;
});
es_stream.on('end', function() {
expect(counter).to.equal(20);
done();
});
es_stream.on('error', function(err) {
done(err);
});
});
});

Sorry, the diff of this file is not supported yet

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