This guide will walk you through the steps to build and run TypeScript scripts to populate data into Elasticsearch DB using Docker Desktop.
Before you begin, ensure you have Node.js and npm installed on your system. Also, make sure you have Docker Desktop installed and Elasticsearch DB container running as per the setup mentioned in the previous section.
Follow these steps to set up TypeScript scripts for populating data into Elasticsearch DB:
-
Install dependencies:
npm install
-
Build TypeScript script:
npm run build
-
Run the script:
node dist/city_list.js
This script will add cities with geolocation from the local
data/city_list.xlsx
file to Elasticsearch DB.
-
Run the script:
node dist/event_generator.js
This script will generate dummy past events for different locations and populate them into Elasticsearch DB.
- Ensure that Elasticsearch DB container is running before executing the scripts.
- Modify the scripts if needed to match your Elasticsearch DB configuration or data format.