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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.