- This is a repo to to show examples of how to use ElasticSearch as a search engine backend with a Python Flask app
- We tokenise titles to enable more reactive searching when indexing the data
- Version 0.1
If you would like to use virtualenv as your Python package manager, you can setup the environment by doing the following:
Create and activate python3 virtual environment like:
virtualenv -p python3 _environment_name_
source _environtment_name_/bin/activate
pip install -r requirements.txt
If you would like to use pipenv, you can setup the environment using the followig:
Install pipenv in your machine:
`$ pip install pipenv`
Create a virtual environment and install the dependencies:
`$ pipenv sync --dev`
Activate the virtualenv:
`$ pipenv shell`
To exit the venv shell:
`$exit`
From the root directory of the repo, set the PYTHONPATH:
export PYTHONPATH="."
To bring up the ElasticSearch instance, simply do the following:
docker-compose up -d elasticsearch
There is a script to import some sample data into the ElasticSearch instance, run the following script to insert the data:
python scripts/titles2es.py --es-index titles
Remember to set the environment variables for the flask service:
export FLASK_DEBUG=1
export FLASK_APP=./dashboard/app.py
If using pipenv as package manager:
make pipenvrun
If using virtualenv:
make run
Now you should be able to access the application at:
http://127.0.0.1:5000/
Repo Owner:
[email protected]