Vanilla co-founder
Gdn_SearchModel->Search('write', 0, 20)0.013198s
select *
from (
select match(d.Name) against('write') as `Relavence`, d.DiscussionID as `PrimaryID`, d.Name as `Title`, c.Body as `Summary`, concat('/discussion/', d.DiscussionID) as `Url`, d.DateInserted as `DateInserted`, d.InsertUserID as `UserID`, u.Name as `Name`
from GDN_Discussion d
join GDN_Comment c on d.FirstCommentID = c.CommentID
join GDN_User u on d.InsertUserID = u.UserID
where match(d.Name) against ('write')
union all
select match(c.Body) against('write') as `Relavence`, c.CommentID as `PrimaryID`, d.Name as `Title`, c.Body as `Summary`, concat('/discussion/comment/', c.CommentID, '/#Comment_', c.CommentID) as `Url`, c.DateInserted as `DateInserted`, c.InsertUserID as `InsertUserID`, u.Name as `Name`
from GDN_Comment c
join GDN_Discussion d on d.DiscussionID = c.DiscussionID
join GDN_User u on u.UserID = d.InsertUserID
where match(c.Body) against ('write')
) s
order by s.Relavence desc
limit 20; I'm not sure why but when I execute the second statement in the union without where match(c.Body) against ('write') it does seem to work -- e.g. the following: select match(c.Body) against('write') as `Relavence`, c.CommentID as `PrimaryID`, d.Name as `Title`, c.Body as `Summary`, concat('/discussion/comment/', c.CommentID, '/#Comment_', c.CommentID) as `Url`, c.DateInserted as `DateInserted`, c.InsertUserID as `InsertUserID`, u.Name as `Name`
from GDN_Comment c
join GDN_Discussion d on d.DiscussionID = c.DiscussionID
join GDN_User u on u.UserID = d.InsertUserID returns the 1 comment, with a relevance of 0. I figure perhaps then if the where statement, the relevance column, is 0, then that means exclude it rather than return it ... so with such a tiny dataset (one comment in one discussion), could that cause problems? Vanilla co-founder
Vanilla co-founder
Vanilla co-founder
It looks like you're new here. If you want to get involved, click one of these buttons!