Closed (fixed)
Project:
Search Files
Version:
6.x-2.x-dev
Component:
Search Attachments
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
17 Feb 2009 at 13:51 UTC
Updated:
29 Apr 2010 at 12:18 UTC
I set up the directories, set up the helper app (cat, in this case), and run cron, but when I go to search, there is nothing. There are no errors in the log files, and when I look into the "search_dataset" the data field for every search_files type is empty. What's going on here? Any ideas?
Comments
Comment #1
mgiffordFound the same issue here.
Tried with the stable & dev versions. Neither seemed to work.
File path:
/home/dm6/sites/drupal6.dev.openconcept.ca/files
Example file in path that was uploaded as an attachment:
/home/dm6/sites/drupal6.dev.openconcept.ca/files/example.pdf
The output from pdftotext:
$ pdftotext example.pdf -
Dogs cats and pickles this is just sample text what will happen here?
Would like to get this to work.
Comment #2
ericduran commentedHey,
I got this working just find. Did you edit the Helper path in the settings?
Comment #3
mgiffordI could alter the helper path, just not the tabs for the title tags. I think I was using the dev version at the time though, so who knows.
Mike
Comment #4
dinis commentedHave you had any success getting this version to work under Windows?
Comment #5
mgiffordYikes, Windows as a server? Nope. Can't help with you there. The base tools are definitely Linux tools though. Expect there isn't a windows equivalent.
Comment #6
dinis commentedThe base tools have Windows and DOS equivalents which work fine on the original verion of this module (which is unfortunately only 5.x compatible). Not sure why you seem suprised that there are Windows server operating systems, Microsoft have been producing them for well over a decade.
And please let's not degrade this support forum into a 'Nix vs. MS debate.
Comment #7
mgiffordDidn't know that, cool. And yeah, no reason to start into the holy wars of OS. It is great that Drupal works in so many environments.
Comment #8
ericduran commentedis a little of topic but have you tried using powershell as a helper? You could use the get-content command which should work well at least for a txt file.
Comment #9
mgiffordNot sure what powershell is, but sounds like a Windows thing. This is on a debian box. We've actually gotten it to work with a txt file (and cat), but although from a command line I can parse the text from a pdf, the module wasn't picking it up. We tried on both the dev & stable versions without success.
Comment #10
ericduran commentedHey,
Sorry for not being clear. My powershell recomendation was for the user asking about getting it working on windows.
Regarding reading the pdf document. You need to configuere the pdf helper. It doesn't work with cat.
Comment #11
mgiffordyeah, I did that as best as I could figure out.
http://drupal.org/node/384342#comment-1364278
Not a lot of documentation here unfortunately.
Comment #12
markabur commentedi've been trying for the past hour to get this module to index a folder but it's simply not finding any files in it. not sure what i'm supposed to put in for the path, but i've tried everything (relative to site root, relative to files folder, absolute from site root, absolute from hard drive root, etc.). every time i try something different i clear the search index and re-run cron. is there something else i should try? i've double-checked that pdftotext is installed and working properly.
Comment #13
ShutterFreak commentedChanging this to a bug report.
A patch should be trivial.
I revisited this module today after weeks of no success, and I already discovered one possible cause of files not being searched for.
The problem is that my LAMP installation returns an empty string for
$_SERVER['DOCUMENT_ROOT'], hence the string representing the full path and filename of the file start with "/./" which won't ever make sense on my Drupal installation.Edit search_files/modules/search_attachments/search_attachments.module and look for the line starting with:
function _search_attachments_index_file($file). I replaced the following line:with the following line:
and now searching attachments suddenly works, but first clear the search cache (via admin/settings/search --> rebuild index), and then run cron.php a couple times, either in your browser or on the command line through a script like described here (won't time out).
It is probably a good thing to replace all occurrences of
$_SERVER['DOCUMENT_ROOT'] . $base_path . $file->filepathwith the following shorter, Drupal API compliant code snippet:file_create_path($file->filepath)throughout the module.Best regards,
Olivier
Comment #14
ShutterFreak commentedSetting this issue to the Search Attachments module.
Comment #15
conradio commentedHi I wonder if you can help me PLEASE, I installed the search files module under windows what I need to do is be able to search a directory with txt files for a persons name or info in the document and return the results (files) for a person to open, my txt helper is as follows c:\\windows\\system32\\cmd.exe type %file% and my directory C:\xampp\htdocs\dot\sites\all\files the problem is that it is not returning any results.
At the point that it returns results we will have a report viewer that will open with an interpretor and display the reports in PDF.
Please help.
Comment #16
thl commentedHi Olivier.
Thanks for contacting me. Use of the Server variable has been removed previously but still things did not work well. Find details in node #556790: Filepath/URI handling in Search Files Attachments.
Fixed.
Comment #17
thl commentedComment #18
maverick14 commented+1 here. I'm using the latest 6 release.
Tried many things, several hours of changing module settings, but can't get this module to work.
I even don't know where to start debugging.