Search is Back
  • Vote Up0Vote Down MarkMark January 28
    Posts: 4,661

    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/

  • 39 Answers sorted by
  • Vote Up0Vote Down dejitarudejitaru January 28
    Posts: 87

    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.

  • Vote Up0Vote Down iPollesioniPollesion January 28
    Posts: 9

    Awesome, I cannot wait until it's out of beta ;)

  • Vote Up0Vote Down flobsterflobster January 29
    Posts: 11

    Very nice! It seems as if the search function doesn't reveal the content of 'private' discussions anymore.

  • Vote Up0Vote Down MarkMark January 29
    Posts: 4,661

    @flobster - Yep, that's fixed, too :)

  • Vote Up0Vote Down dejitarudejitaru January 29
    Posts: 87

    Is there a way to search for a thread and not just the comments within the thread?

  • Vote Up0Vote Down MarkMark January 29
    Posts: 4,661

    @dejitaru - it searches both by default.

  • Vote Up0Vote Down dejitarudejitaru January 29
    Posts: 87

    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.

  • Vote Up0Vote Down MarkMark January 29
    Posts: 4,661

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

  • Vote Up0Vote Down dejitarudejitaru January 29
    Posts: 87

    @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?

  • Vote Up0Vote Down MarkMark January 29
    Posts: 4,661

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

  • Vote Up0Vote Down ToddTodd January 29
    Posts: 377

    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.

  • Vote Up0Vote Down dejitarudejitaru January 29
    Posts: 87

    Ahh ok makes sense thanks for the info.

  • Vote Up0Vote Down tazz_bentazz_ben January 31
    Posts: 34

    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.

  • Vote Up0Vote Down tazz_bentazz_ben January 31
    Posts: 34

    Never-mind, it displays them to you when you do the upgrade.

  • Vote Up0Vote Down fredwufredwu February 1
    Posts: 18

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

  • Vote Up0Vote Down LouisLouis February 10
    Posts: 88

    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.

  • Vote Up0Vote Down fredwufredwu February 10
    Posts: 18

    @Louis, turn on the Debugger plugin and look for the quries there?

  • Vote Up0Vote Down LouisLouis February 10
    Posts: 88

    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?

  • Vote Up0Vote Down LouisLouis February 10
    Posts: 88

    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.

  • Vote Up0Vote Down MarkMark February 10
    Posts: 4,661

    @Todd wrote the mysql fulltext implementation. Mentioning him here so he can add 2c.

  • Vote Up0Vote Down _tiraeth_tiraeth February 11
    Posts: 1

    Well, found the fix for an empty query and the view crash. Just replace /applications/garden/views/search/index.php content with this code. The view is the only place where the query is not being checked (to be more precise, ResultSet variable from controllers body).

  • Vote Up0Vote Down ToddTodd February 11
    Posts: 377

    Pushed the fix to github. Thanks guys.

  • Vote Up0Vote Down ToddTodd February 11
    Posts: 377

    @Louis. I just noticed that your bug was different than what I fixed. However I am guessing that what you are experiencing comes from only having one post in your test forum. I do believe that if a word occurs in more than 50% of the rows in a table then it will be ignored for search purposes.

    This is by design in MySql. Can you maybe add a few more posts and see if you can search then?

  • Vote Up0Vote Down LouisLouis February 11
    Posts: 88

    The forum has just 5 posts, when I search for "Winter", it works, when I search for "write", it doesn't find that one post. I suspect maybe if only one result is found, it returns a relevance of 0, as in relevance should be ignored?

    I'll turn on the debug mode right now, so you can see for yourself. [Edit: Crap, of course, debug mode won't let you run the SQL queries as I did above, but ... I'll try running them again then.]

  • Vote Up0Vote Down LouisLouis February 11
    Posts: 88

    Never mind. It seems to work now ... not sure what changed in the last 2 minutes besides turning on the debugger. It reports a relevance of 2.38214707374573 for that one post.

    I guess I would hope there'd be some way of saying a word is *too* relevant. Or a way of overcoming that limitation. But it's a minor point, as most forums have that kind of "word is too common" limitation, like phpBB or SMF.

  • Vote Up0Vote Down ToddTodd February 11
    Posts: 377

    Yeah. The relevance is kind of locked away in the logic of MySQL, but I think it works well on balance. I'm also guessing that MySQL's full text indexes might lag behind the data a tad as do with most of these type of searches.

  • Vote Up0Vote Down ToddTodd February 11
    Posts: 377

    Another thing. There is another search mode where you can specify simple boolean logic with a + or - before a term similar to search engines. This might give you close to what you want, but is supposed to be slower.

    I'll put a hidden config option in the application for you to try if you want.

  • Vote Up0Vote Down LouisLouis February 11
    Posts: 88

    I wonder if maybe, only for searches which return 0 results, we could swap to a non-relevance based search, perhaps instead a recency-sorted one for just that keyword. And then say "search term too common, results sorted by most recent". If such a generic search reveals nothing, then we know for sure that the word or terms were never used. Perhaps if this uses more CPU or something, it could be a checkbox-- or maybe there's some other trick people are using?

  • Vote Up0Vote Down bennobenno February 15
    Posts: 49

    Inspires me to work on my sphinx search plugin - nice work on the new search @Todd!

  • Vote Up0Vote Down %5B-Stash-%5D[-Stash-] February 19
    Posts: 2,613

    Lucene would be even better, but this is still one hell of an improvement over V1.

    Perhaps the styling of the search results could be slightly different for discussion results (the entire thread) compared to comment results (a single post)?

    Also, I don't know if this is relevant, but the addons/plugins search is currently very annoying, since I can search for a plugin by name and although it finds it, it is MILES down the pecking order. Just try it with something like "JQuery" for example :P Also, my preference of V1/V2, recent/popular is not remembered which is pretty annoying.

  • Vote Up0Vote Down MarkMark February 19
    Posts: 4,661

    Good points on the addons search. Want to implement the changes? The preferences should be pretty easy to do, at least.

  • Vote Up0Vote Down %5B-Stash-%5D[-Stash-] February 19
    Posts: 2,613

    Hahahahaha! You overestimate my coding ability. I might be king of the cut 'n' paste coders, but I think that's a little beyond me currently!

    I'll have a look, but seriously, I'm more of a graphics/UI guy than a coder.

  • Vote Up0Vote Down %5B-Stash-%5D[-Stash-] February 19
    Posts: 2,613

    Just like that eh? :) Thanks for the speedy fix on that Mark, it should mke the addons site a lot more usable for everyone.

  • Vote Up0Vote Down MarkMark February 20
    Posts: 4,661

    np :)

    I haven't pushed it live yet. I want to do a big push one of these days, but there are some other minor things I want in there first.

  • Vote Up0Vote Down SilencerSilencer March 10
    Posts: 16

    Maybe you can add an option to choose which category to search in?

  • Vote Up0Vote Down bigfatbigfat March 18
    Posts: 3

    i test search function for eastern characters.
    if i wrote "香草就是好" in a post, it should be found by "香草" or "就是" etc.,
    but for now. i can found this post by search "香草就是好" only.

  • Vote Up0Vote Down SunyanziSunyanzi March 20
    Posts: 6

    LS ...

    match against can not used on any other characters beside english ...

  • Vote Up0Vote Down homienickhomienick March 20
    Posts: 2

    sweet

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership

Tagged

In this Discussion