In reviewing the results of the Search Directories module it appears that it's not loading the entire content of files into the search index. The module identifies all the directories and files that I would like indexed but it doesn't load the content. The files I'm using are PDFs and I'm using the pdftotext (xpdf) helper. I've tested the helper from the command line and it appears to be working fine. I've also used the helper to load content from the search attachment module and it was working fine. If anyone can help with this issue it would be greatly appreciated.

Comments

kwooden1’s picture

I got some help and we figured out the issue with the search_files_directories.module. If you change the following line:

$quoted_file_path = '"'. escapeshellcmd(realpath($path)) .'"';

to

$quoted_file_path = escapeshellarg(realpath($path));

the module will index properly. We've only tested this fix with PDF files, but it should work with other files because the previous line of code caused the helper to fail.

mdallmeyer’s picture

Worked for me, with other file formats too. Thanks!

mdallmeyer’s picture

Actually, this worked for the test site I have set up, but now on the production site somethings going wrong - it doesn't actually index the files in my configured directory, it looks more like its using the file path & name as the terms to index. I know my helper apps are set up right because they work perfectly in the Attachments tab, it's just the Directories one that doesn't seem to work.

Just realized that there is a change from escapeshellcmd to escapeshellarg, not just the removal of quotes. Problem solved!