Managing mappings
After creating an index, the next step is to add some type mappings to it. We saw how to put a mapping via the REST API in Chapter 4, Basic Operations. In this recipe, we will see how to manage mappings via the official Python client and PyES.
Getting ready
You need a working ElasticSearch cluster and the required packages that are used in the Creating a client recipe in this chapter.
The code of this recipe is present in chapter_11/mapping_management.py
and chapter_11/mapping_management_pyes.py
file, which is available in the code bundle of this book and on GitHub (https://github.com/aparo/elasticsearch-cookbook-second-edition).
How to do it...
After you have initialized a client and created an index, the following actions are available ...
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.