Add Post | Search Results |
---|---|
Demo app displaying how to use Elasticsearch to implement 'search' functionality from a model containing user-generated data.
- Save user posts in database
- Search for user posts
- Display relevant search results
- Flask
- Elasticsearch
- See requirements file for specific details
Unfortunately, the search functionality may not work in the demo link. Payment is required to enable such a service, which at the moment is not really necessary. You can run the application in your local machine to test it out.
-
Clone this repo:
$ git clone git@github.com:GitauHarrison/search-functionality-in-flask.git
-
Change directory to the cloned repo:
$ cd search-functionality-in-flask
-
Create and activate a virtual environment:
$ mkvirtualenv venv # I am using virtualenvwrapper
-
Install project dependencies in your active virtual environment:
(venv)$ pip3 install -r requirements.txt
-
Update environment variables:
(venv)$ cp .env-template .env
-
Configure elasticsearch (see reference section below)
-
Run your Flask server:
(venv) flask run
-
Paste the localhost URL into your favorite browser to access the GUI application
-
Use the search form to query for data