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."

CommentFileSizeAuthor
#2 similar_0.patch1.91 KBnaudefj

Comments

naudefj’s picture

Category: bug » task
Priority: Critical » Normal

Poposed 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);

naudefj’s picture

Status: Active » Reviewed & tested by the community
StatusFileSize
new1.91 KB

Here is the patch.

deekayen’s picture

Assigned: Unassigned » deekayen
deekayen’s picture

Status: Reviewed & tested by the community » Closed (fixed)

The patch query didn't work, but I modified it and committed to CVS for DRUPAL-4-7.