Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

using elastic-search as database in django

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.

like image 743
mustafa.yavuz Avatar asked May 26 '14 07:05

mustafa.yavuz


People also ask

Can we use elasticsearch in django?

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.

Is elasticsearch a database?

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.

What is elasticsearch query?

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.


1 Answers

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.

like image 57
jxstanford Avatar answered Oct 18 '22 17:10

jxstanford