Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Search is Back

MarkMark Vanilla Staff
edited January 2010 in Vanilla 2.0 - 2.8
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/
«1

Comments

  • awesome just upgraded and it seems to be working quite well! Also all my old posts from my vanilla 1 forum that was imported are now searchable as well! and its FAST! thanks dudes.
  • Awesome, I cannot wait until it's out of beta ;)
  • Very nice! It seems as if the search function doesn't reveal the content of 'private' discussions anymore.
  • MarkMark Vanilla Staff
    @flobster - Yep, that's fixed, too :)
  • Is there a way to search for a thread and not just the comments within the thread?
  • MarkMark Vanilla Staff
    @dejitaru - it searches both by default.
  • ahh ok.When you click on the forum it takes you to the middle of the thread and you have to hit more comments to get to the end of the thread. Id rather have it take me to the end of the thread. More of a preference I guess.
  • MarkMark Vanilla Staff
    @dejitaru - I don't follow. The way Vanilla works is that it remembers the last comment you read in discussions, and then takes you to that one the next time you visit a discussion (so you can pick up where you left off).

    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.
  • @mark ahh I think ive figured it out. Most of the search results are comments and the actual thread is like the 10th result. But you cant differentiate between comments and threads until you hover over the result title. For example I have a thread titled anime when I search anime the first 9 results are comments.How does search determine result order?
  • MarkMark Vanilla Staff
    @dejitaru - I'm going to have to defer to @Todd on that (he wrote all of the search stuff), but I imagine it is using MySQL's fulltext relevance order.
  • ToddTodd Chief Product Officer Vanilla Staff
    Search uses fulltext search ranking so it's just based on how relevant MySql thinks the comment/topic is to your search.

    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.
  • Ahh ok makes sense thanks for the info.
  • Todd -

    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.
  • Never-mind, it displays them to you when you do the upgrade.
  • The search unfortunately doesn't work very well due to the limitation of using MySQL's built-in search.

    Anyone interested in a search plugin that uses Zend_Search_Lucene? Although Zend's implementation is not that good... :-|
  • I don't know what I'm doing wrong -- I installed a fresh copy off github master branch, search for a post I just made, and I get 0 results, no matter what keyword I try. The link given in the blog didn't work, it said no updates were necessary.

    What should I look for in the SQL? Oh and when I search for nothing, I get an error message from PHP.
  • @Louis, turn on the Debugger plugin and look for the quries there?
  • edited February 2010
    Oh duh. k, one sec. I searched for "write", a word in my discussion, and it said No results found but made the following SQL:
    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?
  • Made an issue for this and a few other things at http://github.com/lussumo/Garden/issues/issue/245 in the hopes that this system is actually being used. Search is a bit of a deal breaker if still broken, as is a cosmetic bug where it counts the number of role assignments rather than users.
  • MarkMark Vanilla Staff
    @Todd wrote the mysql fulltext implementation. Mentioning him here so he can add 2c.
Sign In or Register to comment.