O'Reilly logo

Elasticsearch 5.x Cookbook - Third Edition by Alberto Paro

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Managing documents

The APIs for managing a document (index, update, and delete) are the most important after the search ones. In this recipe, we will see how to use them in a standard way and in bulk actions to improve performances.

Getting ready

You need an up-and-running Elasticsearch installation, as we described in the Downloading and installing Elasticsearch recipe in Chapter 2, Downloading and Setup.

You also need the Python installed packages of Creating a client recipe of this chapter.

The full code for this recipe can be found in the chapter_16/document_management.py file.

How to do it…

The three main operations to manage the documents are as follows:

  • index: This operation stores a document in Elasticsearch. It is mapped on the index API call. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required