Blog available for sell
This blog is available for sale. Please 'contact us' if interested.
Advertise with us
kibana elastic-search   0   11947
Elastic Search with Kibana and Django

In this article we will see how to implement fast text search using elastic search instead of using MySQL or PostgreSQL.

System configurations:

- Ubuntu 16.04
- Python 3.5, Django 1.10
- Elastic Search v6.0.0
- Kibana v6.0.0

Elastic Search:

As per Wikipedia:

Elasticsearch is a search engine based on Lucene. It provides a distributed, multitenant-capable full-text search engine with an HTTP web interface and schema-free JSON documents.

ElasticSearch indexes documents for your data instead of using data tables like a regular relational database does.

There are two client libraries to interact with ElasticSearch with Python.
1. elasticsearch-py
2. elasticsearch-dsl

Installing Elastic Search:

Since ElasticSearch runs on Java you must ensure you have an updated JVM version. Check what version you have with java -version in the terminal.

1 - Make a directory. mkdir elasticsearch

2 - Download the tar file. wget

3 - Untar the compressed file. tar -xzf elasticsearch-6.0.0.tar.gz

4 - Start the elastic search. ./elasticsearch-6.0.0/bin/elasticsearch. Elastic search will print lots of output on terminal.

elastic search with kibana and django

To confirm if its working, go to your browser and hit http://localhost:9200/ .  You will get the response something like below.

elastic search with kibana and django

Elastic search is up and running. Lets setup the Kibana.


Kibana is an open source analytics and visualization platform designed to work with Elasticsearch. Its simple, browser-based interface enables you to quickly create and share dynamic dashboards that display changes to Elasticsearch queries in real time.

Installing Kibana:

Official documentation of Kibana explains in detail about the steps to install it. We are going to present you the short version of same.

We will be installing using the .deb file.

1 - Download the kibana v6.0.0 deb file. wget

2 - Compare the SHA produced by sha1sum or shasum with the published SHA. sha1sum kibana-6.0.0-amd64.deb

3 - Install kibana. sudo dpkg -i kibana-6.0.0-amd64.deb

Use below commands to start or stop kibana.

sudo systemctl start kibana.service 
sudo systemctl stop kibana.service

Use below commands to start kibana automatically when system boots up

sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable kibana.service

Now open the Kibana in browser. Go to http://localhost:5601 . If your elastic search was running and everything is fine then you will see all green on the kibana status page otherwise you may see some red flags.

elastic search with kibana and django

So now kibana and elastic search are up, connected and running. In next part of this article, we will setup a Django project and will link it to elastic search.


kibana elastic-search   0   11947
0 comments on 'Elastic Search With Kibana And Django'
Login to comment

Related Articles:
Elastic Search with Kibana and Django - part 2
Elastic search and kibana and Django. Fast free indexing in elastic search. Indexing Django project data in elastic search and using kibana....
DigitalOcean Referral Badge

© 2022-2023 Python Circle   Contact   Sponsor   Archive   Sitemap