This is a
playground to test code. It runs a full
Node.js environment and already has all of
npm’s 400,000 packages pre-installed, including
slingshot with all
npm packages installed. Try it out:
This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.
Slingshot provides a really simple set of command line tools for managing ElasticSearch data and mappings. It uses the ElasticSearch scan query and the bulk index API to make data import/export really fast.
Install slingshot globally so it's available on your system path with the following command, it requires node and NPM to be installed.
sudo npm install -g slingshot
Most commands accept and return data via UNIX pipes, making them highly composable and flexible to your workflow.
slingshot export -i twitter -t tweet > tweets.json - Stream all items in a given index and type to a JSON file.
slingshot import -i twitter -t tweet < tweets.json - Stream all items back into a given index and type from a JSON file.
These two commands allow you to quickly iterate when developing and testing mappings without incurring the massive overhead of re-crawling every time.