December 2017
Intermediate to advanced
434 pages
10h 29m
English
You can create an index and specify the number of shards and replicas to create:
PUT /catalog{ "settings": { "index": { "number_of_shards": 5, "number_of_replicas": 2 } }}
It is possible to specify a mapping for a type at the time of index creation. The following command will create an index called catalog with five shards and two replicas. Additionally, it also defines a type called my_type with two fields, one of the text type and another of the keyword type:
PUT /catalog{ "settings": { "index": { "number_of_shards": 5, "number_of_replicas": 2 } }, "mappings": { "my_type": { "properties": { "f1": { "type": "text" }, "f2": { "type": "keyword" } } } }}
Read now
Unlock full access