I've just upgrade search_api module from 7.x-1.6 to 7.x-1.20. And it seems that in facet block, the child facets are not displayed when the parent is active.

In my setup, it was like that when the parent category is selected in facets block, it was displaying all the sub-categories facet under that.

After upgrading search_api to recent version, it doesn't display sub-categories, it just displays parent category with "-" (minus) sign.

Any help will be greatly appreciated.

CommentFileSizeAuthor
#2 7.x.1.20.png172.86 KBsajalsoni
#2 7.x.1.6.png172.75 KBsajalsoni

Comments

sajalsoni created an issue. See original summary.

sajalsoni’s picture

StatusFileSize
new172.75 KB
new172.86 KB
drunken monkey’s picture

Category: Bug report » Support request
Priority: Major » Normal

This still works fine for me with the latest module version, and no-one else has complained either (as far as I know). It probably has something to do with your setup.
The first thing I notice is that the facet filter value is very weird – not just the taxonomy term ID, but a concatenation of (I guess) vocabulary, term ID and term name. Where does that come from? Does it work without that?
You can also try just re-saving the facet display configuration form and see whether that helps.
Otherwise, try newly setting up the search (on a test copy of the site, of course) and see whether you can reproduce the error that way.
But my current best tip is that it has got something to do with that custom facet filter value.

sajalsoni’s picture

Ah Thanks for the reply.

But, I got it fixed anyways, and the issue was the re-ordering of elements when it's passed to 'hierarchy callback'.

In the newer version, the active facet is the first element in array, while in the older version it was not. And my custom hierarchy callback was assuming that the children elements will always follows the parent element in array. In newer version, it's moved to top, so I had to change the logic a bit in my callback code.

drunken monkey’s picture

Status: Active » Fixed

OK, good to hear. Thanks for reporting back!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.