File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -520,18 +520,16 @@ async function searchESWithScroll (mustQuery) {
520
520
console . log ( `totalHits: ${ totalHits } ` )
521
521
// eslint-disable-next-line camelcase
522
522
let scrollId = _scroll_id
523
- let currentHits = hits . hits
524
523
525
- while ( currentHits . length < totalHits ) {
526
- console . log ( `currentHits.length: ${ currentHits . length } ` )
524
+ while ( hits . hits . length < totalHits ) {
525
+ console . log ( `currentHits.length: ${ hits . hits . length } ` )
527
526
const nextScrollResponse = await esClient . scroll ( {
528
527
scroll : scrollTimeout ,
529
528
scroll_id : scrollId
530
529
} )
531
530
532
531
scrollId = nextScrollResponse . _scroll_id
533
- currentHits = nextScrollResponse . hits . hits
534
- hits . hits = [ ...hits . hits , ...currentHits ]
532
+ hits . hits = [ ...hits . hits , ...nextScrollResponse . hits . hits ]
535
533
}
536
534
537
535
await esClient . clearScroll ( {
You can’t perform that action at this time.
0 commit comments