Closed (fixed)
Project:
Similar Entries
Version:
master
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
21 Dec 2005 at 05:40 UTC
Updated:
4 Jan 2006 at 02:10 UTC
Jump to comment: Most recent file
Module raises the following error when used with Drupal 4.7:
"Unknown column 'n.body' in 'field list' query:
SELECT n.nid, n.title , match(n.body, n.title) AGAINST ("...") AS score FROM node n WHERE MATCH(n.body, n.title) AGAINST ("...") AND n.nid <> 389 AND n.status <> 0 ORDER BY score DESC LIMIT 0, 5
in .../drupal/includes/database.mysql.inc on line 108."
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | similar_0.patch | 1.91 KB | naudefj |
Comments
Comment #1
naudefj commentedPoposed solution:
Change last line of README.txt:
ALTER TABLE node_revisions ADD FULLTEXT(title, body);
Change query in similar.module:
$result = db_query_range('SELECT n.nid, n.title , match(r.body, r.title) AGAINST ("%s") AS score FROM {node} n INNER JOIN {node_revisions} r ON n.vid = r.vid WHERE MATCH(r.body, r.title) AGAINST ("%s") AND n.nid <> %d AND n.status <> 0 ORDER BY score DESC', $text, $text, $similar_node_nid, 0, 5);
Comment #2
naudefj commentedHere is the patch.
Comment #3
deekayen commentedComment #4
deekayen commentedThe patch query didn't work, but I modified it and committed to CVS for DRUPAL-4-7.