[pLog-svn] r646 - plog/trunk/class/dao
oscar at devel.plogworld.net
oscar at devel.plogworld.net
Sun Jan 2 23:58:52 GMT 2005
Author: oscar
Date: 2005-01-02 23:58:51 +0000 (Sun, 02 Jan 2005)
New Revision: 646
Modified:
plog/trunk/class/dao/searchengine.class.php
Log:
Fixed the search engine, it should work again. Removed all references to mangled_topic, as the field does not exist anymore (now it's called 'slug')
Modified: plog/trunk/class/dao/searchengine.class.php
===================================================================
--- plog/trunk/class/dao/searchengine.class.php 2004-12-31 15:56:50 UTC (rev 645)
+++ plog/trunk/class/dao/searchengine.class.php 2005-01-02 23:58:51 UTC (rev 646)
@@ -164,10 +164,10 @@
$searchQuery = "SELECT a.id AS id, a.date AS date,
a.user_id AS user_id, a.blog_id AS blog_id, a.num_reads AS num_reads,
a.properties AS properties, t.normalized_text AS normalized_text,
- t.mangled_topic AS mangled_topic, a.status AS status, a.slug AS slug,
+ t.normalized_topic AS normalized_topic, a.status AS status, a.slug AS slug,
1 AS relevance
FROM {$prefix}articles a, {$prefix}articles_text t
- WHERE {$where_string} AND a.id=t.article_id AND a.status = $status";
+ WHERE {$where_string} AND a.id = t.article_id AND a.status = $status";
if( $blogId > 0 )
$searchQuery .= " AND a.blog_id = '".Db::qstr($blogId)."'";
if( $userId > 0 )
@@ -257,10 +257,11 @@
$searchQuery = "SELECT a.id AS id, t.topic AS topic, t.text AS text, a.date AS date,
a.user_id AS user_id, a.blog_id AS blog_id, a.num_reads AS num_reads,
a.properties AS properties, t.normalized_text AS normalized_text,
- t.mangled_topic AS mangled_topic, a.status AS status, a.slug AS slug,
+ t.normalized_topic AS normalized_topic, a.status AS status, a.slug AS slug,
1 AS relevance
- FROM {$prefix}custom_fields_values v, {$prefix}articles a
- WHERE (v.field_value LIKE '%{$query}%') AND v.article_id = a.id AND a.status = $status";
+ FROM {$prefix}custom_fields_values v, {$prefix}articles a, {$prefix}articles_text t
+ WHERE (v.field_value LIKE '%{$query}%') AND v.article_id = a.id AND a.status = $status
+ AND t.article_id = a.id";
if( $blogId > 0 )
$searchQuery .= " AND a.blog_id = '".Db::qstr($blogId)."' ";
if( $userId > 0 )
@@ -310,10 +311,11 @@
$searchQuery = "SELECT a.id AS id, t.topic AS topic, t.text AS text, a.date AS date,
a.user_id AS user_id, a.blog_id AS blog_id, a.num_reads AS num_reads,
a.properties AS properties, t.normalized_text AS normalized_text,
- t.mangled_topic AS mangled_topic, a.status AS status, a.slug AS slug,
+ t.normalized_topic AS normalized_topic, a.status AS status, a.slug AS slug,
1 AS relevance
- FROM {$prefix}articles_comments c, {$prefix}articles a
- WHERE {$where_string} AND c.article_id = a.id AND a.status = $status AND c.status = 0";
+ FROM {$prefix}articles_comments c, {$prefix}articles a, {$prefix}articles_text t
+ WHERE {$where_string} AND c.article_id = a.id AND a.status = $status AND c.status = 0
+ AND t.article_id = a.id";
if( $blogId > 0 )
$searchQuery .=" AND a.blog_id = '".Db::qstr($blogId)."' ";
if( $userId > 0 )
More information about the pLog-svn
mailing list