After creating an index, the next step is to add some mappings to it. We already saw how to include a mapping via the REST API in Chapter 3, Basic Operations. In this recipe, we will see how to manage mappings via a native client.
Managing mappings
Getting ready
You need an up-and-running Elasticsearch installation, as we described in Downloading and installing Elasticsearch recipe in Chapter 1, Getting Started.
An IDE that supports Scala programming, such as IntelliJ IDEA, with the Scala plugin should be installed globally.
The code for this recipe can be found in the ch14/elastic4s_sample file and the referred class is MappingExample.