Search results: possible to return node and not attachment?
wuwei23 - August 28, 2009 - 03:45
| Project: | Apache Solr Attachments |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
Hey everyone,
Fantastic module that is working rather nicely in our dev environment.
For this project, however, the clients want the site to search within attachments but to return the nodes they're attached to rather than direct links to the matching attachments.
I'm happy to take a shot at coding this myself, but thought I should check here first to make sure I haven't missed anything. Any pointers on where to start would likewise be appreciated :)
Thanks.

#1
this is pretty easy - you jsut need to alter each result to make a link from the nid, rather than using the link to the file.
#2
Hey pwolanin,
Thanks for replying. This is the approach I've settled on for the moment and will do for the short term.
Unfortunately, the simple approach results in duplicate entries, as Solr can match on both the node & the attachment if both contain the search terms. And as we're attaching a lot of metadata to the node, we need to be able to search both. So I'm currently stripping dupes from the results just prior to rendering, but this has the downside of making the numeric results on matches, terms matched etc incorrect.
I can't focus on this right now - I've got to demo the base functionality early next week - but I'm wondering if dealing with this at the point of indexing might not be better.
#3
Other people are taking the option of indexing all the extracted attachment text directly in a single document with the node text, so there is never more than one result.
#4
Ah cheers, this was the approach I'd originally planned to take until I discovered this module :) As it stands, there may be a new requirement for some of the content to be stored off-site but still searchable.
pwolanin, when you say "other people", are you referring to any public modules? Or do you mean hand-rolled, stand-alone code?
#5
The main person I know trying this is EclipseGC. I'm not sure about others - you might also talk to janusman.
#6
Thanks, pwolanin, I'll chase them up. I appreciate the feedback.
Should I close this? Or should I add what I learn to it?
#7
Fell free to add - then we can at least improve the documentation, etc.
#8
Subscribing