-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Elasticsearch 8.x Cookbook
By :

After creating an index, the next step is to add some mappings to it. We already learned 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.
You need an up-and-running Elasticsearch installation, as described in the Downloading and installing Elasticsearch recipe of Chapter 1, Getting Started.
Additionally, 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
directory; the referred class is MappingExample
.
In the following code, we add a mytype
mapping to a myindex
index via the native client:
import com.sksamuel.elastic4s.ElasticDsl._
object MappingExample extends App with...