elasticsearch-scroll-stream
Advanced tools
Comparing version 1.1.4 to 1.1.5
@@ -9,2 +9,3 @@ /** | ||
var allowed_extrafields = ['_id', '_score', '_type', '_index', '_parent', '_routing', 'inner_hits']; | ||
@@ -27,3 +28,2 @@ /** | ||
var allowed_extrafields = ['_id', '_score', '_type', '_index', '_parent', '_routing']; | ||
optional_fields.forEach(function(entry) { | ||
@@ -30,0 +30,0 @@ if (allowed_extrafields.indexOf(entry) == -1) { |
@@ -49,4 +49,9 @@ /** | ||
// set the total matching documents | ||
self._total = response.hits.total; | ||
// Set the total matching documents | ||
// For Elasticsearch greater then 7.x hits.total is an object: | ||
// { | ||
// value: 20, | ||
// relation: "eq" | ||
// } | ||
self._total = (typeof response.hits.total === 'object') ? response.hits.total.value : response.hits.total; | ||
@@ -71,3 +76,3 @@ var objectMode = self._readableState.objectMode; | ||
if ((response.hits.total !== self._counter) && (!self._forceClose)) { | ||
if ((self._total !== self._counter) && (!self._forceClose)) { | ||
self._client.scroll({ | ||
@@ -79,3 +84,3 @@ scroll: self._options.scroll, | ||
// trigger an asyncronous clearScroll for the current _scroll_id | ||
self._client.clearScroll({ scrollId: response._scroll_id }, function(err, res) {}); | ||
self._client.clearScroll({ scrollId: [response._scroll_id] }, function(err, res) {}); | ||
@@ -82,0 +87,0 @@ // end correctly |
{ | ||
"name": "elasticsearch-scroll-stream", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"description": "Elasticsearch Scroll query results as a Stream", | ||
@@ -30,5 +30,5 @@ "repository": { | ||
"elastical": "0.0.13", | ||
"elasticsearch": "^15.2.0", | ||
"elasticsearch": "^16.0.0", | ||
"mocha": "^5.2.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
25148
481