This repository contains the local files for the sample Algolia MongoDB Listings Application that is implemented as part of a blogpost series located here.
- A Python script to load an Algolia index with sample data from MongoDB. It is available both as a Jupyter Notebook and a Python script
- A Web application to query the Algolia index directly and display search results
To try the loading of the Algolia index based on the sample dataset, you need an Algolia API key, which you can obtain by:
- Registering for a free Algolia account, or Logging in to your existing account
- After signing in, an Algolia Application will automatically be created for you. You can either use the default (unnamed) application, or create a new application
- Go to your API Keys section of your application and retrieve your Application ID and Admin API Key You will need to use both the Application ID and Admin API Key in when connecting your Algolia account from the Python code below
Open either the:
- publicly hosted Notebook on Google collab
- local Jupyter Notebook
- local Python script They are all responsible for loading the Algolia index. Change the algolia_app_id and the algolia_admin_key variables to your API keys and run the script.
The script will:
- Connect to Algolia using the Algolia Python API and validate the connection
- Connect to a running MongoDB instance and retrieve sample data
- Prepare the Algolia index
- Load the dataset into Algolia from the MongoDB instance and replace the existing index
You can also easily try out the Search Web Application by either:
- opening the StackBlitz hosted version of the application on the cloud. This contains both the source and the created application and allows you to make modifications and see the changes real-time.
- opening the local files for the web application. You will need to have NodeJS on your machine and run npm install and npm start from the search-web-application directory to run the app.