I am looking for a solr solution of this model: Product (common fields) ->SKU (color, size) and STORE(store_name) <-(price)-> SKU Listing contains only products but other facets (store names, colors) and sorting (by min price) should work either.
I can have 3 types of docs: products, skus and relation store-sku-price. Or at least last 2 (product fields in sku docs with redundancy). Or we can make them nested. If i place them as nested docs then problems are: 1. Cannot figure out how to sort parent docs using function of nested doc field. (I want SKUs to be sorted by min price among all nested docs of this SKU). And then further sort documents by function among these sorted SKUs. 2. Cannot get facets from the lowest inner level (store_names) on the hightest parent level (documents). I.e. how to use facets formed retrieved on sku level (with child.facet.field facets) on document level? It seems that simpler approach is to keep product fields in sku documents. Then we get only two levels: sku and store_names/price. And skus then can be grouped to get documents and working pagination. But there are 2 problems again: 1. Still cannot figure out how to sort skus by min price of nested docs. 2. When grouping sku docs with group.facet=true facet counts of sku doc fields are grouped (so they relate to groups) while facet counts of fields from nested docs relate to sku docs, not groups: i.e. facets from child.facet.field are not grouped when sku field facets are grouped. Any help?