A tool to map Django models to ElasticSearch mappings
Homepage Repository PyPI Python
pip install django-elasticmodels==1.0.2
django-elasticmodels is a convenient tool to map your Django models to ElasticSearch mappings.
Code: | https://bitbucket.org/jvennik/django-elasticmodels |
---|---|
Documentation: | # |
Issue tracker: | https://bitbucket.org/jvennik/django-elasticmodels/issues |
License: | BSD 3-clause; see LICENSE file |
Latest released version:
$ pip install django-elasticmodels
To use django-elasticmodels in your Django project:
- Add
'elasticmodels'
to yourINSTALLED APPS
setting.- Add
'ELASTICSEARCH_HOST'
(string)- Add
'ELASTICSEARCH_MODELS'
(list) >>'["yourapp.yourmodel",]'
to your settings file- [Optional] Add
'ELASTICSEARCH_CUSTOM_TYPES'
(dict) to your settings file if you want to specify a specific field type yourself >> Example:'"geo_location": {"type": "geo_point"}'
- [Optional] Add
'ELASTICSEARCH_NON_MODEL_FIELDS'
(list). Here you can add fields that are not present on your model >> Example:'{"snippet": {"type": "string"}}'
- Run ./manage.py create_indexes
Examples will be added at a later date.