Elasticsearch nested aggregation filters - product catalog


#1

I have following objects in my elasticsearch index and I want to create aggregations based on option_groups_value. This is described here in last snippet of this post http://distinctplace.com/2014/07/29/build-zappos-like-products-facets-with-elasticsearch/

[
    {
    id: 1,
    "option_groups_value": [
        {
          "group": "color",
          "option": "black",
        },
        {
          "group": "material",
          "option": "wood",
        },
        ...
      ]
    ...
},
...
   ]

I created aggregations, but there are missing that conditions, that are described in last section. here

"aggs": {
    "option_groups_value": {
      "nested": {
        "path": "option_groups_value"
      },
      "aggs": {
        "group": {
          "aggs": {
            "value": {
              "terms": {
                "size": 40,
                "field": "option_groups_value.option.raw"
              }
            }
          },
          "terms": {
            "size": 40,
            "field": "option_groups_value.group.raw"
          }
        }
      }
    }
  }

How can I include that filters in my aggregations ?


(system) #2

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.