Mapping an object
The object is the base structure (also called as record in SQL). ElasticSearch extends the traditional use of object, allowing recursive embedded objects.
Getting ready
You will require a working ElasticSearch cluster.
How to do it...
We can rewrite the order mapping of the Mapping base types recipe using an array of items as shown in the following code:
{ "order" : { "properties" : { "id" : {"type" : "string", "store" : "yes", "index":"not_analyzed"}, "date" : {"type" : "date", "store" : "no", "index":"not_analyzed"}, "customer_id" : {"type" : "string", "store" : "yes", "index":"not_analyzed"}, "sent" : {"type" : "boolean", "store" : "no", "index":"not_analyzed"}, "item" : { "type" : "object", "properties" : { "name" : {"type" : "string", "store" : "no", "index":"analyzed"}, "quantity" : {"type" : "integer", "store" : "no", "index":"not_analyzed...