Tutorial Series: How To Use Elasticsearch With Python and Django

In this series, we create a basic Django app and populate a database with automatically generated data. We also add data to the elasticsearch index in bulk, write a basic command, and add a mapping to the elasticsearch index. Finally, we add some functional frontend items, write queries, allow the index to update, and discuss a bonus suggestion.

How To Use Elasticsearch With Python and Django ( Part 1 )

Django, thanks to its "included batteries" and wide ecosystem of packages, is a sound solution to build a web service. Also, as it's written in Python, you will have access to the wide variety of scientific packages (machine learning was there even before it have become so trendy) and other goodies, as it's quite a popular language.

If you go to the Django packages for search page you'll encounter many packages. If we don't filter out database-backed apps, the most popular is Haystack, as it supports lots of backends (Elasticsearch, Solr, Whoosh, Xapian...) and is quite Django-like. However, we won't use it, because it is difficult for bleeding-edge cases, for custom uses, and is generally much more difficult to debug than your own code. This is due to all of the classes and abstractions of Haystack. 

Instead, let us make a Django app with Elasticsearch integrated.

Keep reading

How To Use Elasticsearch With Python and Django ( Part 2 )

In this series, we are creating a Django app with Elasticsearch-based search integrated. The previous article focused on the creation of a basic Django app. As we cannot show the great applications of Elasticsearch features without data to use, we shall populate a database with automatically generated data in this post.

Keep reading

How To Use Elasticsearch With Python and Django ( Part 3 )

In the previous posts, we created a basic Django app, and populated a database with automatically generated data. In this post, we will add data to the elasticsearch index in bulk, write a basic command, and add a mapping to the elasticsearch index.

Keep reading

How To Use Elasticsearch With Python and Django ( Part 4 )

In the previous posts in this series we created a basic Django app and populated a database with automatically generated data. We also added data to the elasticsearch index in bulk, wrote a basic command, and added a mapping to the elasticsearch index. In this final article we will add functional frontend items, write queries, allow the index to update, and discuss a bonus tip. 

Keep reading