Raw Data
Below is the raw data used throughout this chapter. Following is the mapping for the "insured" table (index):
{ "insured": { "mappings": { "properties": { "name": { "type":"string" }, "address": { "street": { "type":"string" }, "city": { "type":"string" }, "state": { "type":"string" } }, "insured_ages": { "type": "integer" }, "vehicles": { "type": "nested", "properties": { "year": { "type":"integer" }, "make": { "type":"string" }, "model": { "type":"string" }, "body_style" { "type": "string" } } } } } } }
The following is the sample data set for the "insured" table (index):
{ "hits": { "total": 2, "max_score": 1, "hits": [ { "_index": "insured", "_type": "_doc", "_id": "1", "_score": 1, "_source": { "name": "John Smith", "address": { "street": "Main Street", "city": "Chapel Hill", "state": "NC" }, "insured_ages": [ 17, 43, 45 ], "vehicles": [ { "year": 2015, "make": "Dodge", "model": "RAM 1500", "body_style": "TK" }, { "year": 2015, "make": "Suzuki", "model": "V-Strom 650 XT", "body_style": "MC" }, { "year": 1992, "make": "Harley Davidson", "model": "FXR", "body_style": "MC" } ] } }, { "_index": "insured", "_type": "_doc", "_id": "2", "_score": 1, "_source": { "name": "Joseph Newman", "address": { "street": "Oak Street", "city": "Raleigh", "state": "NC" }, "insured_ages": [ 23, 25 ], "vehicles": [ { "year": 2010, "make": "Honda", "model": "Accord", "body_style": "SD" }, { "year": 2008, "make": "Honda", "model": "Civic", "body_style": "CP" } ] } } ] } }