My search results don't include taxonomy terms (tags and other taxonomies) for anonymous users. They have access to the terms, which are used as our main navigation.

If I disable Apache Solr Access, or if I search as admin, the taxonomy terms are included in the search results as expected.

Drupal 7.27
Apache Solr search is the only active search module.
I have Apache Solr Indexer for Taxonomy installed and enabled (7.x-1.x-dev). The taxonomy in question and the tags are checked for indexing.

Comments

nick_vh’s picture

Project: Apache Solr Search » Apachesolr Term
Version: 7.x-1.6 » 7.x-1.x-dev
Component: Node access » Code

This is an Apache Solr Term problem. Moving it

robbertnl’s picture

Whats the status? Same issue here.

jamesrward’s picture

We are experiencing the same issue. @Nick_vh any ideas where the issue lies in Apachesolr Term so we can try to resolve this ourselves?

jamesrward’s picture

jamesrward’s picture

I'm inclined to go back to blaming this on apachesolr_access since a change to this code will fix the issue:

function apachesolr_access_build_subquery($account) {
  if (!user_access('access content', $account)) {
    throw new Exception('No access');
  }
  $node_access_query = apachesolr_drupal_subquery();
  if (user_access('bypass node access', $account)) {
    // Access all content from the current site.
    $node_access_query->addFilter('hash', apachesolr_site_hash());
  }

The fact that $node_access_query->addFilter('hash', apachesolr_site_hash()); is only called for users with bypass node access set appears to be the cause of this issue and the related issue for ApacheSolr User. This patch fixes both issues but is not the most elegant solution.

To me it appears that the ApacheSolr Access module shouldn't be preventing the site hash from being added to the filter for users without bypass node access. I see no documentation of using this as a method to restrict search access to specific users. I would very much like to see this issue moved back to ApacheSolr Access

jamesrward’s picture

This patch addresses the issue for me and I think makes the access submodule more logical. I'd want to see some tests from those running sites with more restrictive node access rules.

jamesrward’s picture

Project: Apachesolr Term » Apache Solr Search