December 2017
Intermediate to advanced
434 pages
10h 29m
English
A type can be added within an index after the index is created. The mappings for the type can be specified as follows:
PUT /catalog/_mapping/category{ "properties": { "name": { "type": "text" } }}
This command creates a type called category, with one field of the text type in the existing index catalog. Let us add a couple of documents after creating the new type:
POST /catalog/category{ "name": "books"}POST /catalog/category{ "name": "phones"}
After a few documents are indexed, you realize that you need to add fields for storing the description of the category. Elasticsearch will assign a type automatically based on the value that you insert for the new field. It takes into consideration only the ...
Read now
Unlock full access