I want to use elastic-search
as database in my project which I build on django
framework. As I learn, elastic search
is used with together a database through haystack
where elastic-search
is used for only indexing and fast retrieval issues. Here it is explained how to integrate a database and elastic-search
with haystack
However, I would like to use elastic-search
without a database, in other words I will index all data. I did not see anything like below that you can use elastic-search
as database backend in django
settings module.
# settings.py
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'OPTIONS': {
'read_default_file': '/path/to/my.cnf',
},
}
}
Is not it possible to use only elastic-search
with model layer of django
?
Here is the django-elasticsearch
backend and in the examples section it does in the way I would like to do but I do not know whether it is storing first in a database and indexing on elastic-search
or just store and indexing on elastic-search
.
Elasticsearch Setup To integrate Elasticsearch with Django, we need to install the following packages: elasticsearch - official low-level Python client for Elasticsearch. elasticsearch-dsl-py - high-level library for writing and running queries against Elasticsearch.
Elasticsearch is a document oriented database. The entire object graph you want to search needs to be indexed, so before indexing your documents, they must be denormalized.
Elasticsearch provides a full Query DSL (Domain Specific Language) based on JSON to define queries. Think of the Query DSL as an AST (Abstract Syntax Tree) of queries, consisting of two types of clauses: Leaf query clauses.
I think the short answer to your question is "no." I looked into this a while ago, and found that there was a project to create an elasticsearch database engine (https://github.com/aparo/django-elasticsearch), but with a last commit in 2011, I would not think that it is viable with post 1.0 versions of ES, and possibly 1.6.x versions of Django.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With