Mapping a document
The document is also referred as the root object. It has special parameters to control its behavior, mainly used internally to do special processing, such as routing or time-to-live of documents.
In this recipe, we'll take a look at these special fields and learn how to use them.
Getting ready
You need an up-and-running Elasticsearch installation as we described in the Downloading and installing Elasticsearch recipe in Chapter 2, Downloading and Setup.
To execute curl
via the command line, you need to install curl
for your operative system.
How to do it...
We can extend the preceding order example adding some of the special fields, for example:
{ "order": { "_id": { "index": true }, "_type": { "store": "yes" }, "_source": { "store": "yes" }, "_all": { "enable": false }, "_routing": { "required": true }, "_index": { "enabled": true }, "_size...