I can't get the search_files module to index any files placed into a defined directory. I created a new directory on disk in sites/default/files/documents and copied some .txt files into it. I then created a new directory entry for search_files with a directory path of sites/default/files/documents. What do I set URI to? Search_files never indexes any of the files I added.

Any suggestions appreciated.

Comments

stodge’s picture

I tried the latest dev package with zero success. I'll try to debug the code but I make no promises. Haven't debugged PHP for years!

stodge’s picture

This line is failing, so presumably it doesn't think it's time to rescan the directories:

// hunt configured directories for new files and add them to the database
  if (variable_get('search_files_directories_last_index', 0) < (time() - search_files_variable_get_directoryrescanage())) {
stodge’s picture

I changed Directory Rescan Age to 0 and changed the code to less than or equals to instead of less than:

// hunt configured directories for new files and add them to the database
  if (variable_get('search_files_directories_last_index', 0) <= (time() - search_files_variable_get_directoryrescanage())) {

And it worked.

Anonymous’s picture

Did the trick for me as well.

mdallmeyer’s picture

What did you end up setting the URI to? I can't figure that part out. So it looks like its finding files in the directory, but they're either not being indexed or just not being displayed...any ideas?

elusivemind’s picture

I have done a ton of work on this module just to get the thing to work. Perhaps I'll become a co-maintainer but that will depend on my boss whether or not they want me putting in work hours on the project. I will be doing a bunch more work on it in the coming weeks.

I'm willing to share my fixes, but I don't think I have much in the way of a patch since many of my fixes are somewhat hackish and would need to be tested against multiple environments.

I've discovered it has a dependency on the upload module... which is undocumented. Grrr.

jrglasgow’s picture

@ElusiveMind
the search directories sub module doesn't depend on the upload module, only when you use the search attachmets module which specifically searches the files uploaded and attached to nodes does it depend on the upload module