I installed the Apache Solr Node Access module and it returns zero results for anyone but user 1. I tried it both with the Node Access module as well as the Node Privacy by Role module. For each attempt I re-indexed to no avail. The only user who can get search results with the module enabled is user 1.
I can't think of anything specific to my site that could be hindering this. I checked out the node_access table and everything looks correct there, and the subquery function appears to be adding the correct fields.
Thanks!
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | na-383804-7.patch | 693 bytes | pwolanin |
Comments
Comment #1
pwolanin commentedIt works with both Organic Groups and Taxonomy Access Control Lite, so there it's not fundamentally broken, but there is indeed something wrong. I'm not sure if the problem is with our code or the Node Privacy by Role module module.
The Node Access module has a bug that we supplied a patch for long ago: http://drupal.org/node/323977 so that may be why that didn't work.
Comment #2
kevin hankens commentedYeah, it's puzzling me. I tried the node access patch to no avail. Thanks again for the help. Here are some clues:
Indexing for grants:
Anonymous user result from node_access_grants() inside _apachesolr_nodeaccess_build_subquery($account) during the search:
Anon user calls to $node_access_query->add_field() inside _apachesolr_nodeaccess_build_subquery($account) during the search:
Otherwise, all grants appear to work as you would expect for viewing nodes.
Comment #3
pwolanin commentedWell the grants that are being indexed seem to indicate that content should only be visible to UID 1, or role 2 (authenticated user).
Comment #4
kevin hankens commentedSo, it sounds like the issue is on the indexing phase and not the subquery phase. Here's a brief snippit from my node_access table showing a three nodes, one that should be public and two that should be private:
Here's what's being added to the document in apachesolr_nodeaccess_apachesolr_update_index(&$document, $node) (excuse the format, it's just how I was logging it)
Any clues there??
-- EDIT --
Also, no results for authenticated users
Comment #5
kevin hankens commentedSorry for the deluge of snippits!! :)
Here's the document array for nid: 121 (should be public above) as it passes apachesolr_nodeaccess_apachesolr_update_index(&$document, $node):
Particularly:
I certainly appreciate the help!! :)
Comment #6
pwolanin commentedWe only care about grant view for search purposes.
From the above it seems as though the right data is getting indexed - in which case it may be a problem in terms of constructing the query.
Comment #7
pwolanin commentedbrilliant insight by Jacob - a fast computer may actually complete multiple operations in one microsec.
no reason to be time based anyhow - a simple static counter is more robust.
Comment #8
JacobSingh commentedcommitted.
Comment #9
JacobSingh commentederr... not really
Comment #10
pwolanin commentedyes - I committed.