- Elasticsearch 7.0 Cookbook(Fourth Edition)
- Alberto Paro
- 84字
- 2021-06-24 14:52:02
How to do it...
We can rewrite the mapping code found in the previous example recipe using an array of items:
PUT test/_doc/_mapping
{
"properties" : {
"id" : {"type" : "keyword"},
"date" : {"type" : "date"},
"customer_id" : {"type" : "keyword", "store" : "yes"},
"sent" : {"type" : "boolean"},
"item" : {
"type" : "object",
"properties" : {
"name" : {"type" : "text"},
"quantity" : {"type" : "integer"},
"price" : {"type" : "double"},
"vat" : {"type" : "double"}
}
}
}
}