Skip to content

Instantly share code, notes, and snippets.

@zhenghao1
Created August 20, 2012 07:54
Show Gist options
  • Save zhenghao1/3402020 to your computer and use it in GitHub Desktop.
Save zhenghao1/3402020 to your computer and use it in GitHub Desktop.
New Product mapper for ElasticSearch
{
"product": {
"_type": {"store": "yes"},
"_source": {"compress": true},
"index_analyzer": "standard",
"search_analyzer": "standard",
"dynamic_date_formats": ["date_time_no_millis", "date_optional_time"],
"properties": {
"_id": {"type": "string", "index": "not_analyzed"},
"key": {"type": "string"},
"type": {"type": "string"},
"type_short": {"type": "string", "index": "no"},
"deleted": {"type": "boolean", "null_value": false},
"created_at": {
"type": "date",
"format": "dateOptionalTime"
},
"created_by": {"type": "string"},
"updated_at": {
"type": "date",
"format": "dateOptionalTime"
},
"updated_by": {"type": "string"},
"status": {"type": "string", "index": "no"},
"comments": {"type": "string"},
"content": {
"type": "object",
"path": "full",
"properties": {
"key": {"type": "string"},
"name": {"type": "string"},
"description": {"type": "string", "index_name": "description"},
"brand": {
"type": "object",
"path": "just_name",
"index_name": "brand",
"properties": {
"abbreviation": {"type": "string", "index_name": "brand_abbreviation"},
"name": {"type": "string", "index_name": "brand_name"}
}
},
"hsCode": {"type": "string"},
"season": {"type": "string", "index_name": "season"},
"category": {"type": "string", "index_name": "category"},
"status": {"type": "string", "index_name": "status"},
"attributes": {
"type": "object",
"path": "full",
"properties": {
"color": {"type": "string"},
"size": {"type": "string"}
}
},
"image": {"type": "string"},
"quantity": {"type": "integer"},
"total": {"type": "double"},
"items": {
"type": "nested",
"properties": {
"EAN": {"type": "string", "index_name": "EAN"},
"attributes": {
"type": "object",
"properties": {
"color": {"type": "string", "index_name": "color"},
"size": {"type": "string", "index_name": "size"}
}
},
"dropped": {"type": "boolean", "index_name": "dropped"},
"priceGroup": {
"properties": {
"type": "object",
"properties": {
"name": {"type": "string", "index_name": "priceGroup_name"},
"value": {
"properties": {
"type": "object",
"properties": {
"currency": {"type": "string", "index_name": "currency"},
"price": {"type": "float", "index_name": "price"},
"country": {"type": "string"}
}
}
}
}
}
},
"deliveryPeriod": {
"type": "object",
"properties": {
"startDate": {"type": "date", "format": "date"},
"endDate": {"type": "date", "format": "date"}
}
},
"status": {"type": "string", "index_name": "status"},
"quantity": {"type": "integer"},
"total": {"type": "double"}
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment