Closed (won't fix)
Project:
Apache Solr Search
Version:
6.x-2.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
18 Jan 2011 at 18:53 UTC
Updated:
29 Dec 2011 at 10:00 UTC
Jump to comment: Most recent file
Comments
Comment #1
tbenice commentedsolr index page shows that 169 documents are in the index, so this is not an indexing issue. The comments are not displayed in the search results.
Comment #2
tbenice commentedchanging the title
Comment #3
tbenice commentedThis is still a problem for me and I cant figure out why it doesn't work. Has anybody else had a similar problem?
Comment #4
tbenice commentedLooking at the index, I see that there are the correct number of terms for is_cid, but not for 'type'. I have 11 content types that have indexable content. The 'type' term shows 11, and should be 12 I think including the 'comment' type. I think maybe the 'comment' type is missing?
EDIT: Nope, I was wrong, i think. I enabled the 'content type' filter in the results and I actually only have content in 10/11 types, so probably 'comment' is one of the 11 in the index. Any way to tell? All I know is that when apachesolr_commentsearch_apachesolr_search_result_alter is called, the conditional statement ($doc->type == 'comment') is never true.
Comment #5
tbenice commentedWhen I go to the solr admin page to query (http://localhost:8983/solr/admin/form.jsp) and type in 'type:comment' into Solr/Lucerne statement, I get comments as results. the comments are definitely there, they are not being returned to Drupal for some reason. When I watchdog $doc-type in apachesolr_search_process_response inside the loop (foreach ($response->response->docs as $doc)), i only get my normal content types, not 'comment'.
Comment #6
tbenice commentedIt's a permissions problem. I found it logged in as user 1 that I could see the comments at search/apachesolr_search. If I give a test user 'administer nodes' permission, they can see comments too.
Looking for why administer nodes is needed to return comments from solr. Also changing the name of this issue.
Comment #7
tbenice commentedThe problem is that the apachesolr_nodeaccess module is not compatible with apachesolr_commentsearch. the apachesolr_nodeaccess module checks for grants on nodes only, not other content like comments or files. This is also probably the reason for http://drupal.org/node/387442.
Comment #8
tbenice commentedChanging to a bug, as nodeaccess should not interfere with commentsearch.
Comment #9
tbenice commentedI found the problem, which is actually in apachesolr_commentsearch.module. I'll work up a patch and submit it for review tonight.
Comment #10
tbenice commentedHere's a patch against 2.x-dev that does the following:
1) invokes hook_apachesolr_update_index. This is needed to allow apachesolr_nodeaccess to add the required terms to comment documents so that that modules added filters will not filter out all comments.
2) adds a new term to differentiate comment documents from non-comment documents.
3) adds a new filter to filter out comment documents if the current user does not have access comments permissions.
I modeled the approach used in apachesolr_nodeacess for this.
thanks!
Comment #11
tbenice commentedComment #12
tbenice commentedComment #13
jpmckinney commentedWaiting for new component to tag issue.
Comment #14
jpmckinney commentedAdd tag
Comment #15
nick_vhNot sure if this is portable to 6.x-1.x branch but closing this since 6.x-2.x branch is unsupported.