I'm quite new to ElasticSearch, and I think I'm making some mistakes in my mind, on how it's supposed to work. I can't really find help through Google, and am not sure if it's because of me, or because ElasticSearch is still quite new.
We're an ecommerce company. We have a solid platform on which clients can manage and sell products. They can have more than one subplatform, and they can enable/disable products per subplatform.
So, each ElasticSearch filter (aggregation, facet, whatever the name is - I could really go for a ES dictionary) must filter on this subplatform ID by default. For Solr, I could look up what each document was supposed to look like, but no joy so far with ES.
I assume it would be something along the lines of
<doc>
<field name="subplatforms">[1, 120, 360]</field>
<field name="name">Product 1</field>
<field name="categories">['Apparel', 'Shoes', 'Nike']</field>
</doc>
This is what an XML file in Solr is supposed to look like, but as ES doesn't have such things, I've just written it out like this.
To show filters for each selected category, the search would be something along the lines of:
curl -XPOST "http://localhost:9200/products/_search" -d'
{
"size": 0,
"aggregations": {
"filter": {
"term": { "category": "Shoes"
}
}
}
}'
Right? We wouldn't want to show buckets for categories, as that is done outside of ElasticSearch. But, we do want to show all aggregations, in buckets, for each possible selection in the selected category. For each product with the category 'Shoes', it should find all possible aggregations (how to define them?) like shoe size, shoe lace colour, shoe lace type (flat/round), etc etc.
I'm quite stuck, and none of the resources I've found helped me so far. Newbie documentation is really lacking.