I am facing a tricky problem and would love any help. Right now we have users creating nodes with many CCK fields and a search that uses Views exposed filters to search those nodes. All good so far, except now they're uploading files (using CCK FileField) and want to be able to search the file content in the same View.
To do the Views-based search, currently we're using the "Search: Search Terms" exposed filter which hooks into Drupal's core search. I found http://drupal.org/project/search_files and http://drupal.org/project/search_by_page and *AM* successfully indexing the PDFs and text files. Trouble is -- these modules don't hook into Drupal's core search, but instead provide a separate tab on the search page. This means they don't work with the "Search: Search Terms" filter.
Does anyone know how to do this, or have ideas on alternative approaches?
Comments
This is my current solution.
This is my current solution. Can any search experts provide advice on improvements?
P.S.: file_dumps is a custom table with three fields I made for caching file contents:
It's not essential, but might speed things up.
One final addition. If you
One final addition. If you used the code above, you probably want this in your module, too:
Whoops! Be sure to wrap
Whoops! Be sure to wrap
index_filesinif (!function_exists('index_files')), or PHP will throw a fatal error whennodeapi('update index')is called more than once.