Managing documents
The APIs for managing documents (indexing, updating, and deleting) are the most important APIs after the search ones. In this recipe, we will see how to use them in a standard way and in bulk actions to improve performance.
Getting ready
You need a working ElasticSearch cluster and the packages used in the Creating a client recipe of this chapter.
The full code of this recipe is in the chapter_11/document_management.py
and chapter_11/document_management_pyes.py
files, available in the code bundle of this book and on GitHub (https://github.com/aparo/elasticsearch-cookbook-second-edition).
How to do it...
There are three main operations to manage documents, as follows:
index
: This stores a document in ElasticSearch. It is mapped on ...
Get ElasticSearch Cookbook - Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.