: There are following points about catgory and products to be considered, : 1.One product can belong to more than one categories. : 2.category is a hierarchical facet. : 3.More than one categories can share same name.
if multiple categories have the same name (presumably because the hierachy is important (ie: "Mens > Shoes; Womens > Shoes; etc...") then usually you have some unique id for each category (ie: "1:Mens > 33:Shoes; 2:Womens > 35:Shoes; etc...) so you just wnat to make sure you index the unique category ids. Depending on what type of navigation you want to support, you should also index all of the "ancestory" category IDs as well. If all of these IDs are indexed in a single multivalued field, it's easy to filter all products in category "Mens" or all products in category "Mens > Shoes" even if some of those products are also in "Womens > Shoes" More details about various hierarchical faceting strategies exist on the wiki... https://wiki.apache.org/solr/HierarchicalFaceting -Hoss