Hi

I think solr search attachments is great. It indexes files attached to nodes really well.

Nevertheless, I am looking for some additional usage of this module.

In my system, in addition to attaching a file to a node, I have an additional way to upload a large number of files:

* Copying them directly to the server and creating a node of type "directoy listing", using the module "filebrowser". This module allows one to view the content of a specific directory in the server (an ftp like view). This types of nodes allow me to share the whole content of a CD, keeping the filesystem tree structure of the original CD.

The problem is that the content of these files are not indexed due to the fact that they are not actually linked to the node (filebrowser only shows the content of the directory but do not establish any kind of link with the files).

I have been working on an additional module to filebrowser that updates some tables in the database simulating that all these files have actually been uploaded: I update two tables: "files" (a record for each specific file) and "upload" (relates files and node records)

Nevertheless, solr search attachment do not seem to react at all.

Solr search attachments only indexes files in apachesolr_attachments_files.

These files are added (or removed) to apachesolr_attachments_files table when apachesolr attachment calls:

$node = node_load($nid, NULL, TRUE);

and determines that $node->files is not empty.

I have been trying to trace the code behind node_load but I do not get to undestand it and how drupal determines that there are files actually attached to a node.

Any idea?

Thanks in advanced

CommentFileSizeAuthor
#3 apachsolr_attachments.tar_.gz27.89 KBkaszub4u

Comments

pwolanin’s picture

I think webfm already is able to mark an existing file as a node attachment.

If it's not working for you, likely it's because the module thinks that the node you attached to has already been indexed. Try also calling

apachesolr_mark_node($nid);

This will tell apachesolr that the node corresponding to $nid changed and needs to be indexed again. However, this will not be needed if you are correctly updating the node object and calling node_save($node);.

You shoudl never update node values directly in the table if you want Drupal to react to the changes.

pwolanin’s picture

Status: Active » Closed (fixed)
kaszub4u’s picture

StatusFileSize
new27.89 KB

Solution:
ApacheSolr Attachments - Head Version - working with WebFM attachments

madimar’s picture

I'm not able yet to search WebFM attachments in both 6.x-2.x and 6.x-1.x versions.
Any suggestion/update?

thanks in advance,

Max