Active
Project:
Search Files
Version:
6.x-2.0-beta4
Component:
Search Directories
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 Nov 2009 at 00:31 UTC
Updated:
29 May 2012 at 20:15 UTC
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
Comment #1
kwooden1 commentedI 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.
Comment #2
mdallmeyer commentedWorked for me, with other file formats too. Thanks!
Comment #3
mdallmeyer commentedActually, 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!