The ability to index attachments separately from the node text.

Regarding the ability to index attachments separately from the node text, one can do the following :
1. Modify driver to retrieve attachment id along with path
2. Add "search_index($attachment['id'], 'attachment', $attachment_text);" to function search_attachments_nodeapi so text is indexed with type="attachment".
3. Create function "search_attachments_search"(hook_search) and add "name" => "Files",
"search":
a) $find = do_search($keys, 'attachment');
b) Ask driver to retrieve items with $find->sid (node id included)
c) Wrap & return results according to hook_search rules (snippet is parsed from {search_dataset})

Done! We have "Files" tab and can search attachments only (+ node backreference link in result).
I believe it is better than what is done now, because it is impossible to find out which attachment has the information I search for when node has 2+ attachments.

Reply

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.