Chapter 3. Managing Mapping

In this chapter, we will cover the following topics:

  • Using explicit mapping creation
  • Mapping base types
  • Mapping arrays
  • Mapping an object
  • Mapping a document
  • Using dynamic templates in document mapping
  • Managing nested objects
  • Managing a child document
  • Mapping a multifield
  • Mapping a GeoPoint field
  • Mapping a GeoShape field
  • Mapping an IP field
  • Mapping attachment field
  • Adding generic data to mapping
  • Mapping different analyzers

Introduction

Mapping is the most important concept in ElasticSearch, as it defines how a search engine should process a document.

Search engines are mainly composed of two parts:

  • Indexing: This action takes a document and stores/indexes/processes it in an index
  • Searching: This action retrieves the data from the index

These two parts are strictly connected; an error in the indexing step leads to unwanted or missing search results.

ElasticSearch has explicit mapping on an index/type level. When indexing, if mapping is not provided, a default mapping is created, guessing the structure from the data fields that compose the document. Then, this new mapping is automatically propagated to all cluster nodes.

The default type mapping has sensible default values, but when you want to change their behavior you need to provide a new mapping definition.

In this chapter, we'll see all the possible types that compose the mappings.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.118.211