A
A
AlexeyKuk2015-09-11 00:13:42
EAV
AlexeyKuk, 2015-09-11 00:13:42

Product attribute aggregation with Elasticsearch?

Friends, hello!
Having a similar problem as here:
stackoverflow.com/questions/23627105/how-to-aggreg...
I have an EAV model in the database. I'm doing data mapping on Elasticsearch. My situation is the same as in the above example.
The data is taken from the example above.

POST myindex/product/1
{
    "name": "Shirt 1",
    "manufacturer": "Adidas",
    "options":[
            {
                "id": 1,
                "name": "color",
                "values" : [
                        {
                            "id": 1,
                            "name": "blue"
                        }    ,
                        {
                            "id": 2,
                            "name": "green"
                        }   
                    ]
            },
            {
                "id": 2,
                "name": "Size",
                "values" : [
                        {
                            "id": 5,
                            "name": "M"
                        }    
                    ]
            }
        ],
    "price":100
}

How to do aggregation to get the following result:
- color (3)
-- blue (1
-- green (2)
-size (4)
-- M (2)
-- L (1)
-- XL (3
) please!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question