Mapping base types

Using explicit mapping allows to be faster in starting to insert the data using a schema less approach without being concerned of the field types, so as to achieve better results and performance in indexing, it's required to manually define a mapping.

Fine-tuning mapping brings some advantages such as:

  • Reducing the index size on the disk (disabling functionalities for custom fields)
  • Indexing only interesting fields (general speed up)
  • Precooking data for fast search or real-time analytics (such as facets)
  • Correctly defining whether a field must be analyzed in multiple tokens or considered as a single token

Elasticsearch allows using base fields with a wide range of configurations.

Getting ready

You need an up-and-running Elasticsearch ...

Get Elasticsearch 5.x Cookbook - Third 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.