Hi,
I have an index named product in elastic search. Each document contains an attribute field. This is shown below.
{
"category": "xyx",
"name": "product-1",
"attribute": [
{
"unit": "mm",
"name": "Length",
"value": "10"
},
{
"unit": "",
"name": "Color",
"value": "Orange"
},
{
"unit": "cm",
"name": "Width",
"value": "34"
}
]
}
{
"category": "xyz",
"name": "product-2",
"attribute": [
{
"unit": "mm",
"name": "Length",
"value": "20"
},
{
"unit": "",
"name": "Color",
"value": "Red"
},
{
"unit": "cm",
"name": "Width",
"value": "45"
}
]
}
I want to get all attributes whose value be like
{"Length": [10,20],"Color": ["Orange","Red"], "width": [34,45]
Also need the unit of each attribute name. Can anyone help me to solve this problem?