I am trying to use ElasticSearch as a NoSQL database in my Django project.
The goal is to plug Kibana
on the other side and be able to visualize my data there.
I do not have a choice of adding another database and using ElasticSearch only for indexing as my project is plugging to an existing infrastructure.
So I have installed the following two modules:
- django-haystack
- elasticsearch
I was expecting to not need SQLite (or any other database) for storage and to use ElasticSearch as a NoSQL storage (is that wrong?)
I added the Haystack connections settings to my project settings and then, looked for getting rid of "DATABASES" or replacing it with values pointing to my ElasticSearch with no success :(
Here is what I'm stuck with:
settings.py:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
HAYSTACK_CONNECTIONS = {
'default': {
'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine',
'URL': 'http://127.0.0.1:9200/',
'INDEX_NAME': 'haystack'
},
}
On all the answers I could find on StackOverflow and code snippets I would never see these DATABASES settings changed, so I assume people were using a database for storage and ElasticSearch only for their search engine/indexing which is not what I am looking for.
Is there a way I can have ElasticSearch as my storage DB (just like I would with MongoDB), not breaking the Models and interface of Django?