When updating to the last 6.x-2.x-dev (still using it while waiting for stable 6.x-3.x) I noticed that the facet count is wrong on the empty search (when displaying the facets in browse mode) because it does not respect the node access rules (all nodes are counted). However, facet count is correct when a regular search is conducted (node access rules are respected)

Upon investigation, I discovered that some code had been moved from apachesolr_modify_query to apachesolr_search_finalize_query in #883106

Function apachesolr_search_browse is calling apachesolr_modify_query, but since some code has moved, it also has to call apachesolr_search_finalize_query which it is not doing right now.

So the solution is to add the following after apachesolr_modify_query($query, $params, 'apachesolr_search'); on line 317

apachesolr_search_finalize_query($query, $params);

6.x-2.x-dev is no longer being maintained, so I am not going to make a patch, but I thought I would share if it helps others...

Comments

dawansv’s picture

Status: Needs review » Closed (fixed)

Published this for reference. Closing my own issue this since 6.x-2.x branch is unsupported.

dawansv’s picture

For reference, the "more like this" block does not respect node access either.

The same call to apachesolr_search_finalize_query needs to be added on line 2204 in function apachesolr_mlt_suggestions (apachesolr.module);