This Django project explores the possibilities of full-text search and filtering using Elasticsearch.
The project depends on:
- Django ≥ 1.8
- Elasticsearch v6.2 - Server
- elasticsearch v6.2 - Python Elasticsearch Client
- elasticsearch-dsl v6.1 - Higher level library for the search queries
- django-elasticsearch-dsl v0.5.0 - Integration with Django package
- several other modules listed in the requirements.txt
-
Install and run Elasticsearch server. For example on macOS:
$ brew install elasticsearch $ brew services start elasticsearch
-
Clone this project
-
Create a virtual environment, activate it, and install Python dependencies
-
If you use pipenv, go to project's directory and run:
$ mkdir .venv $ pipenv install $ pipenv shell
-
Otherwise, proceed the good old way:
$ virtualenv venv $ source venv/bin/activate (venv)$ pip install -r requirements.txt
-
-
Build the search index for the database:
(venv)$ python manage.py search_index --rebuild
-
Run local webserver:
(venv)$ python manage.py runserver
-
Open http://127.0.0.1:8000 to play around with the search.