Copy PUT /products-v1
{
"mappings": {
"dynamic": "strict",
"properties": {
"id": { "type": "keyword" },
"name": {
"type": "text",
"fields": {
"keyword": { "type": "keyword", "ignore_above": 256 }
}
},
"description": { "type": "text" },
"active": { "type": "boolean" },
"quantity": { "type": "integer" },
"total_views": { "type": "long" },
"price": { "type": "scaled_float", "scaling_factor": 100 },
"rating": { "type": "double" },
"created_at": { "type": "date", "format": "strict_date_optional_time||epoch_millis" },
"source_ip": { "type": "ip" },
"tags": { "type": "keyword" },
"scores": { "type": "float" },
"dimensions": {
"type": "object",
"properties": {
"height_cm": { "type": "double" },
"width_cm": { "type": "double" }
}
},
"contacts": {
"type": "object",
"properties": {
"type": { "type": "keyword" },
"value": { "type": "keyword" }
}
},
"variants": {
"type": "nested",
"properties": {
"sku": { "type": "keyword" },
"color": { "type": "keyword" },
"price": { "type": "scaled_float", "scaling_factor": 100 }
}
},
"metadata": { "type": "flattened" },
"location": { "type": "geo_point" },
"payload": { "type": "binary" }
}
}
}
POST /products-v1/_doc/product-42
{
"id": "product-42",
"name": "Mechanical Keyboard",
"description": "Low-profile wireless keyboard",
"active": true,
"quantity": 120,
"total_views": 98420,
"price": 129.99,
"rating": 4.8,
"created_at": "2026-09-04T12:00:00Z",
"source_ip": "203.0.113.42",
"tags": ["hardware", "wireless"],
"scores": [0.91, 0.87, 0.82],
"dimensions": {
"height_cm": 2.1,
"width_cm": 35.4
},
"contacts": [
{ "type": "email", "value": "[email protected] " },
{ "type": "phone", "value": "+48-22-555-0100" }
],
"variants": [
{ "sku": "KB-BLACK", "color": "black", "price": 129.99 },
{ "sku": "KB-WHITE", "color": "white", "price": 134.99 }
],
"metadata": {
"warehouse": "waw-1",
"campaign": "autumn"
},
"location": { "lat": 52.2297, "lon": 21.0122 },
"payload": "SGVsbG8gV29ybGQ="
}