I am working on a project that makes heavy use of OG. I noticed that when I enabled the Apache Solr OG module/facet block, it showed a number of search results showed up in "No Group". When I selected this filter, it appeared that only files were showing.
I'm not sure where the fix should be; should the apachesolr_og module figure out a file's gid by looking at the nodes it is attached to, or should apachesolr_attachments store the gid with the file?
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | apachesolr_attachments.admin_.inc-823854-7.patch | 1.02 KB | jsagotsky |
| #7 | apachesolr_attachments.admin_.inc-823854-7.patch | 1.02 KB | jsagotsky |
| #1 | apachesolr_attachments.admin_.inc-823854.patch | 1.49 KB | ebeyrent |
Comments
Comment #1
ebeyrent commentedAfter looking at this issue a bit more, I think that the fix should be in the apachesolr_attachments module, because it creates a separate Lucene document for each file it indexes. The attached patch simply adds the appropriate OG key to the document. After I patched the module and re-indexed my files, the problem appeared to be fixed.
Comment #2
ebeyrent commentedComment #3
pwolanin commentedNo. This needs to be handled by the _og module. the attachments module should not know anything about groups.
Comment #4
pwolanin commentedOn approach is to use this hook:
The existing nodeaccess bit is a bit of an ugly hack and I'd rather not extend it.
ideally we should have a more generic hook that can alter documented created from or related to a specific node.
For 6.x-1.x I'm not sure sure a change is in scope - we coudl basiclaly use hook_apachesolr_update_index() if we indicate that modules implementing it may need to check
$document->entityto decide whether to act, and maybe pass$entityas an option third parameter?Comment #5
pwolanin commented#832118: Make hook_apachesolr_update_index() more generic so it can be used e.g. for file attachments, etc
Comment #6
ebeyrent commentedI did think about that, but instead elected to go with a solution consistent with how taxonomy and nodeaccess are handled in the attachments code.
I like your idea about extending the hook though.
Comment #7
jsagotsky commentedebeyrent, we still use your patch at OpenScholar, but had to make some changes to get it to apply to 6.x-1.0-beta1. See attached.
Comment #8
jsagotsky commentedErr, try this attachment. Last one didn't stick.
Comment #9
nick_vh6.x-2.x has become unsupported