Wrecking your head on modeling product variables using ES (or Solr, for that matter)
Consider (a far-fetched example):
- miscellaneous goods (e.g. t-shirts)
- each product has a set of properties (productid, name, desc, brand, color, popular)
- each product has a set of product variables with properties (productvariantid (combi of productid ++ size), productid, size, availability, price)
This is apparently the standard parent-child relationship between product and productvariant. Therefore, I would like to simulate it as in ES.
I would like to be able to do the following:
but. Request for product variables (and return of all properties). No need to return product properties, just product properties.
- IN
. Each user request is limited, so no more than 1 product matches for each product (in the example above, this means that we restrict it to goods. Varize.size)
C. Filter for the price.
D. Filter by some product properties
E. Order by price
F. Order on a product property, such as popularity, or a combination of 2.
G. facet on productvariant.price
- N
. facet according to several product properties (parent)
Doing this with parent / child documents and has_parent in ES: AE + G.
However, what about F and H ? I looked at things like _scope for faces (although admittedly I can't find 100% possibilities) and everything else that comes to mind, but I donβt see an obvious solution to display the faces of product properties and be able to sort them with has_parent .
I tried other things (on paper) - has_child β You do not need an option - embedded documents (option inside the product) and return the entire product with all the options. He just feels awkward. Moreover, I am sure that I will not be able to somehow order the price.
Help appreciate
Geert-jan
source share