Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

scrollgenerator

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scrollgenerator

is lite and quick set up package to scroll over elastic search index built using built in node js generator

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Scroll Generator

is lite and quick set up package to scroll over elastic search index built using built in node js generator

How it work

all you have to do to scroll over an index is to give two params and done
- first import your elastic search client 
example :
   import client from '../libs/elasticsearch'
- import scrollOverIndex :
   import scrollOverIndex from 'scrollgenerator'
- write your optional options parameter
let options = {
   client: client,
   index: 'new_artists_matches',
   query: {
       "match_all": {}
   },
   size: 500,
}
  • note : All of these options are required exepct size (default = 500)
  • finally write executable code with the imported scrollOverIndex function and scrollRun callback
async function main() {
   await scrollOverIndex(options, scrollRun)
   console.log('scroll done : ', data.length)
 }

 main()
  • the scrollRun will run in evey batch of hits
  • example of scrollRun callback :
   async function scrollRun(result) {
       for (let item of result.hits.hits) {
           console.log(`data length : ${data.length} || ${result.hits.total.value}`)
           console.log(item);
       }
       return
   }

Keywords

FAQs

Package last updated on 03 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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