Circular category issue-No products displayed in parent cat
Posted: Sun Aug 09, 2015 11:05 pm
Reason:
Category hierarchy is not build correctly for circular category. So that product's category will be not indexed.
Because of this line in recursive method SolrIndexDaoImpl.readFullCategoryHierarchy(), it overwrites the correct category hierarchy (categoryHierarchy - built before) by empty one (nextLevel - built later with empty content).
Solution:
Merge nextLevel into categoryHierarchy instead of overwrite.
Category hierarchy is not build correctly for circular category. So that product's category will be not indexed.
Because of this line in recursive method SolrIndexDaoImpl.readFullCategoryHierarchy(), it overwrites the correct category hierarchy (categoryHierarchy - built before) by empty one (nextLevel - built later with empty content).
Code: Select all
// nextLevel contains empty content.
categoryHierarchy.putAll(nextLevel);
Solution:
Merge nextLevel into categoryHierarchy instead of overwrite.
Code: Select all
// merge nextLevel into categoryHierarchy if valid
addAll(nextLevel, categoryHierarchy);