Search is Back
Mark
Vanilla Staff
Try it out - let us know what you think. If you are a Vanilla 2 early adopter (ie. you've downloaded a copy of Garden/Vanilla from GitHub and you're running it somewhere), there are instructions on how to update your database for search here:
http://vanillaforums.org/blog/search-is-back-baby/
http://vanillaforums.org/blog/search-is-back-baby/
0
Comments
When it comes to searching, it takes you to the comment you clicked on in the list of search results - wherever that may be in the discussion.
Actually @dejitaru I'm thinking that in the case of a search going to a whole discussion it should go to the first comment, whereas going to a discussion through the main discussions list will go to the unread one. I guess it's not that big of a deal either way.
Where is the alter table commands in the code? I had already added full text searching to my copy and I want to see what I need to delete/alter.
Anyone interested in a search plugin that uses Zend_Search_Lucene? Although Zend's implementation is not that good... :-|
What should I look for in the SQL? Oh and when I search for nothing, I get an error message from PHP.
Gdn_SearchModel->Search('write', 0, 20)0.013198sI'm not sure why but when I execute the second statement in the union withoutselect *
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;
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`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?from GDN_Comment c
join GDN_Discussion d on d.DiscussionID = c.DiscussionID
join GDN_User u on u.UserID = d.InsertUserID