我希望获得一个请求数据来构建这样的东西:
Categories:
- laptops (5)
- accessories (50)
- monitors (10)
-- above part is easy --
Attributest for actual category ex. laptops:
- card reder:
- MMC (1)
- SD (5)
- resolution:
- 1024x768 (2)
- 2048x1536 (3)
Run Code Online (Sandbox Code Playgroud)
首先,我在我的Elasticsearch上进行映射,如下所示:
{
"mappings": {
"product": {
"properties": {
"name": {
"type": "string"
},
"categoryName": {
"type": "string",
"index": "not_analyzed"
},
"priceBrutto": {
"type": "float"
},
"categoryCode": {
"type": "integer"
},
"productAttributeFields" : {
"properties" : {
"name" : {
"index" …Run Code Online (Sandbox Code Playgroud)