Search Enhancement Mod

Started by ioszilla, August 12, 2007, 05:53:15 PM

Previous topic - Next topic

ioszilla

Link to Mod

SMF Search Enhancement Mod

Note: ver 1.1.6 (and later) fixes a major bug from the *official* SMF 1.1.3, 1.1.4 search function that is very likely to immensely disrupt search results. The bug affects all forum owners without mysql privilege to CREATE TEMPORARY TABLES - regardless of whether a previous version of this mod was installed.


Overview

DC SMF Search is a mod to the existing smf forum search function. In addition to a list of enhancements and new features, it also fixes a few bugs in smf official 1.1.3 search function.

For illustrated demo, visit: http://www.donationcoder.com/Forums/bb/index.php?topic=9434.0


Features

1. Significant reduction of missing results (now very rare)
2. Less noise and therefore reasonably better relevance
3. Hugely improved ranking algorithm (when using FullText index)
4. Enhanced phrase search
5. Intelligent handling for '(apostrophe), .(period), and –(dash)
6. Supports short keywords (3 characters or less)
7. Supports stopwords (clichés)
8. Active board ranking heuristic (based on mouser's suggestion)
9. Expand/foldable result summary
10. Viewing all matching posts in a topic with one click
11. Ability to sort search results live
12. Quick dropdown search box


IMPORTANT CONFIGURATION INFO

Works best with Search Settings (in admin panel):

1. Use FullText index (Search index -> FullText index)
2. Leave "Force the use of a search index" UNchecked
3. Leave "match whole words only" UNchecked
4. Maximum results to show: 0  (0: no limit)


ioszilla

#1
As mentioned above, plz make sure you configure your search in Admin panel as shown below -- in order for this mod to search fast and best rank results:



1. Use FullText index (Search index -> FullText index)
2. Leave "Force the use of a search index" UNchecked
3. Leave "match whole words only" UNchecked



4. Set "Maximum results to show" to 0

karlbenson

is this alot more server intensive than the standard smf one?

ioszilla

Quote from: karlbenson on August 12, 2007, 07:08:24 PM
is this alot more server intensive than the standard smf one?

We have been using it on our own forum (http://www.donationcoder.com/Forums/bb/index.php, SMF 1.1.3) for over a month (since July 4th), and so far we haven't experienced any performance problem -- some members even told me the new search was faster. Before this mod,  our search utilized SMF custom index.

I'm confident that this mod won't stress your server. Feel free to do some searches on our forum (70,000+ posts) and see how it performs. :)

Eleglin

it would be so cool if we can choose an engine (Google / Yahoo / or customised ) for the search on the entire site.
No support by PM or Mail.

ioszilla

#5
Quote from: Eleglin on August 13, 2007, 08:59:30 AM
it would be so cool if we can choose an engine (Google / Yahoo / or customised ) for the search on the entire site.

* /me despises all non-Google search engines ;)


Just kidding. It's a good idea actually.

For now you can edit Sources/Search.php after installation of this mod, just find:

Quotefunction QueryPreProcess ()
{
   global $scripturl;
   
   $Redirects = array(
      'members' => $scripturl . '?action=mlist;sa=search;fields=name,email;search=',
      // Google Site Search
      'entiresite' => 'http://www.google.com/search?domains='; . $_SERVER['HTTP_HOST']. '&sitesearch=' . $_SERVER['HTTP_HOST'] . '&q='
   );
   
   foreach ($Redirects as $redirect => $url)
      if (isset($_REQUEST['search_selection']) && $_REQUEST['search_selection'] == $redirect)
      {
         header('Location: ' . $url . urlencode($_REQUEST['search']));
         exit;   
      }
}


Change the search engine here:
Quote'entiresite' => 'http://www.google.com/search?domains='; . $_SERVER['HTTP_HOST']. '&sitesearch='

Eleglin

I have a limited place on my server.
The size of my database (for messages) is 16272.43 Ko. (without index )

Does it make a very huger database ?
No support by PM or Mail.

ioszilla

It does not modify your smf database AT ALL and it will not write custom data to your server anywhere. :) It's works in 100% 'READ-ONLY mode'.

Eleglin

#8
oh ! There seems to be some javascript errors on the results pages of your forums ?
Especially when I click on hide/show result summary.
I use Firebug and Web developper :-)
These are mods for Firefox ;)
No support by PM or Mail.

ioszilla

Yup. There was a javascript bug in the template (undefined function). Fixed and uploaded. Please uninstall version 1.1.2 of this mod (which is what you have) and install latest version 1.1.3:  http://custom.simplemachines.org/mods/index.php?mod=887

Thanks!! :D

ioszilla

I'm proud of this mod not because it's so 'feature-rich' :P, but because I believe it addresses two most annoying problems that have been haunting SMF search, making it a pain to use:

1. Relevance ranking

A search function is basically a failure if most relevant topics are not shown in results page 1 and 2 - on a big forum nobody sane would browse 10+ pages to find what he wanted. With this search mod, you have most relevant results on the first page and very few missing results, period.

If you administer an smf forum with more than 50,000 posts, you know what I am talking about -- SMF search ranking sucks :)


2. Missing results

Needless to elaborate on this. :P


<shameless plug>
To see some feedback on our forum for this search, visit:
http://www.donationcoder.com/Forums/bb/index.php?action=search2;search=zillarank

Note their opinions are not necessarily unbiased but I really believe they are enjoying smf search now. :)
</shameless plug>

Eleglin

I have a last question
*Please don't hurt me*

Can we use it on the forum AND on the site ?
My forum and my site will have the same header.
What should I add on the header in order to use and choose the search engine ?

No support by PM or Mail.

ioszilla

#12
Hmm could u give me the url to your forum so I can better give u instructions? Thanks. :)



EDIT: solved via PM

ioszilla

If you are in need of a guide to search features specific to this enhancement mod, please free to link to, copy, or adapt this topic in any way you see fit:  8)

A Practical Guide to DonationCoder.com Forum Search

Eleglin

French translation :

<file name="$languagedir/Modifications.french.php">
<operation>
<search position="end" />
<add><![CDATA[
//Begin DC SMF Search Text Strings
$txt['specific_topic_id'] = 'ID d\'un topic spécifique';
$txt['search_match_mode'] = 'Mode de correspondance';
$txt['search_match_mode_whole'] = 'Correspondre à tous les mots - strict';
$txt['search_match_mode_smart'] = 'Correspondre à tous les éléments - large';
$txt['search_match_mode_any'] = 'Correspondre à n\'importe quel élément';

$txt['search_numReplies'] = 'Réponses';
$txt['search_match_mode_whole_short'] = 'Correspondre à tous les mots';
$txt['search_match_mode_smart_short'] = 'Correspondre à tous les éléments';
$txt['search_match_mode_any_short'] = 'Correspondre à n\'importe quel élément';

$txt['result_summary'] = 'Montrer/cacher le détail des résultats';

$txt['result_generated'] = 'Résultats générés par';
$txt['zillarank'] = 'ZillaRank';

$txt['search_entireforum'] = 'dans tout le forum';
$txt['search_thisbrd'] = 'dans cette section';
$txt['search_thistopic'] = 'dans ce fil';
$txt['search_members'] = 'parmi les membres';
$txt['search_entiresite'] = 'dans tout le site';
//END DC SMF Search Text Strings
]]></add>
</operation>
</file>


<file name="$themedir/languages/Errors.french.php" error="ignore">
<operation error="ignore">
<search position="end" />
<add><![CDATA[
$txt['error_search_string_small_words'] = 'Chaque terme doit comprendre au moins deux caractères.';]]></add>
</operation>
</file>
No support by PM or Mail.

ioszilla

Wow thanks a lot Eleglin!!

New version 1.1.4 uploaded, with French language support. :D :D :D

shadow82x

wordzilla this is a great mod thank you. I have a suggestion: Lets say you open up a board and the quick search at the top still says search the entire board I think it should auto adjust to "board" or "topic" when you enter it. I love your mod as if you did not know. :P
Colin B
Former Spammer, Customize, & Support Team Member

christicehurst

Great mod, no problems at all. People will snap this mod up fast!
www.brisbanelionsunited.com - A forum for everyone!

ioszilla

Thanks shadow82x, glad you like it. :) I see it's working well on your forum.

QuoteLets say you open up a board and the quick search at the top still says search the entire board I think it should auto adjust to "board" or "topic" when you enter it.

You have been infected by SMF 2.0 virus! ;) I believe SMF 2.0 does the auto-adjustment to only reduce avg server load -- limiting the search to single board or topic reduces db operations greatly. For a leviathan forum like SMF, it's a reasonable compromise.

But do your members/visitors really want to limit the search to single board/topic every time they are browsing a board/topic? I doubt it. For me, I almost never limit my search and I found it extremely annoying having to manually go back to 'forum index' to search entire forum - every time I'm browsing a board/topic!


Note: the search mod automatically ranks higher the matching topics that are within the board you are currently viewing, thus it won't matter much if you search the specific board or entire forum - most likely you will be more interested in relevant topics within the board you are currently browsing, as such we give "local" matching topics an edge over others to catch you eye. :)

Eleglin

#19
 No more errors with javascript, that's pretty cool !  :P

I should verify translation, be patient please
No support by PM or Mail.

Advertisement: