Closed (duplicate)
Project:
Search Files
Version:
6.x-2.x-dev
Component:
Search Attachments
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Feb 2010 at 18:06 UTC
Updated:
22 Feb 2011 at 08:34 UTC
This is what I get in the search results for "Drupal" on a PDF:
readme image module imagemodule is responsible for the creation maintenance of image nodes that can be used for several purposes such as embedding in other nodes or used on their own to display photographs screenshots or diagrams author james walker ...
See http://www.sterndata.com/search/search_files_attachments/drupal
Comments
Comment #1
sterndata commentedVerified that pdftotext is returning the correct information. The snippet seems to come from $file->data, but that field has nothing to do with the contents of $file->filename. In addition, $file->nid is the same for all returned results. For now, I've commented out the line that starts with $snippet =>.
Comment #2
sterndata commentedThe query in search_files_attachment is incorrect. Adding the AND clause at the end fixes it.
$file = db_fetch_object(db_query("
SELECT f.*, d.data, u.nid
FROM {files} AS f
JOIN {upload} AS u
USING(fid)
INNER JOIN {search_dataset} AS d
ON f.fid = d.sid
WHERE fid = %d
AND d.type='search_files_att'
", $item->sid));
Comment #3
sterndata commentedComment #4
duncanc commentedI can confirm this problem. If there are multiple rows in search_dataset with the same sid value but for different search types, such as node and search_files_att, then the wrong snippet can be returned. The proposed solution looks like it will fix the problem.
Comment #5
caprenter commentedI also had this problem using 6.x-2.0-beta4.
The search results were for the correct PDF, but the 'description' of what the search had found was from a different node.
The fix in #2 from sterndata above seems to have worked for me.
Comment #6
apatrinos commentedThe fix proposed by sterndata on May 5, 2010 works for me as well. Thanks!
Comment #7
Azol commentedDuplicate of #743072: Wrong text quoted in search results, check it for patch