Advertisement:

Author Topic: Search Enhancement Mod  (Read 145074 times)

Offline ioszilla

  • Jr. Member
  • **
  • Posts: 252
  • Gender: Male
  • Freedom to be unfree.
Search Enhancement Mod
« on: August 12, 2007, 05:53:15 PM »
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)

« Last Edit: January 12, 2012, 09:10:41 PM by Spuds »

Offline ioszilla

  • Jr. Member
  • **
  • Posts: 252
  • Gender: Male
  • Freedom to be unfree.
Re: SMF Search Enhancement Mod
« Reply #1 on: August 12, 2007, 07:00:50 PM »
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
« Last Edit: August 14, 2007, 01:00:35 PM by wordzilla »

Offline karlbenson

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,584
  • Gender: Male
    • @mortonssols on Twitter
    • Mortons Solicitors
Re: SMF Search Enhancement Mod
« Reply #2 on: August 12, 2007, 07:08:24 PM »
is this alot more server intensive than the standard smf one?

Offline ioszilla

  • Jr. Member
  • **
  • Posts: 252
  • Gender: Male
  • Freedom to be unfree.
Re: SMF Search Enhancement Mod
« Reply #3 on: August 12, 2007, 07:24:59 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. :)

Offline Eleglin

  • Sr. Member
  • ****
  • Posts: 754
  • Gender: Male
    • Les Archives de Gondor
Re: SMF Search Enhancement Mod
« Reply #4 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.
No support by PM or Mail.

Offline ioszilla

  • Jr. Member
  • **
  • Posts: 252
  • Gender: Male
  • Freedom to be unfree.
Re: SMF Search Enhancement Mod
« Reply #5 on: August 13, 2007, 09:15:07 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:

Quote
function 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='
« Last Edit: August 13, 2007, 09:18:04 AM by wordzilla »

Offline Eleglin

  • Sr. Member
  • ****
  • Posts: 754
  • Gender: Male
    • Les Archives de Gondor
Re: SMF Search Enhancement Mod
« Reply #6 on: August 13, 2007, 09:34:17 AM »
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.

Offline ioszilla

  • Jr. Member
  • **
  • Posts: 252
  • Gender: Male
  • Freedom to be unfree.
Re: SMF Search Enhancement Mod
« Reply #7 on: August 13, 2007, 09:38:03 AM »
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'.

Offline Eleglin

  • Sr. Member
  • ****
  • Posts: 754
  • Gender: Male
    • Les Archives de Gondor
Re: SMF Search Enhancement Mod
« Reply #8 on: August 13, 2007, 09:44:54 AM »
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 ;)
« Last Edit: August 13, 2007, 09:50:57 AM by Eleglin »
No support by PM or Mail.

Offline ioszilla

  • Jr. Member
  • **
  • Posts: 252
  • Gender: Male
  • Freedom to be unfree.
Re: SMF Search Enhancement Mod
« Reply #9 on: August 13, 2007, 09:59:40 AM »
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

Offline ioszilla

  • Jr. Member
  • **
  • Posts: 252
  • Gender: Male
  • Freedom to be unfree.
Re: SMF Search Enhancement Mod
« Reply #10 on: August 13, 2007, 10:08:19 AM »
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>

Offline Eleglin

  • Sr. Member
  • ****
  • Posts: 754
  • Gender: Male
    • Les Archives de Gondor
Re: SMF Search Enhancement Mod
« Reply #11 on: August 13, 2007, 10:09:17 AM »
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.

Offline ioszilla

  • Jr. Member
  • **
  • Posts: 252
  • Gender: Male
  • Freedom to be unfree.
Re: SMF Search Enhancement Mod
« Reply #12 on: August 13, 2007, 10:12:31 AM »
Hmm could u give me the url to your forum so I can better give u instructions? Thanks. :)



EDIT: solved via PM
« Last Edit: August 13, 2007, 11:11:05 AM by wordzilla »

Offline ioszilla

  • Jr. Member
  • **
  • Posts: 252
  • Gender: Male
  • Freedom to be unfree.
Re: SMF Search Enhancement Mod
« Reply #13 on: August 13, 2007, 11:15:27 AM »
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

Offline Eleglin

  • Sr. Member
  • ****
  • Posts: 754
  • Gender: Male
    • Les Archives de Gondor
Re: SMF Search Enhancement Mod
« Reply #14 on: August 13, 2007, 12:16:19 PM »
French translation :

Code: [Select]
<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>

Code: [Select]
<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.

Offline ioszilla

  • Jr. Member
  • **
  • Posts: 252
  • Gender: Male
  • Freedom to be unfree.
Re: SMF Search Enhancement Mod
« Reply #15 on: August 13, 2007, 12:36:44 PM »
Wow thanks a lot Eleglin!!

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

Offline mcblaber

  • Support Specialist
  • SMF Super Hero
  • *
  • Posts: 11,189
  • Gender: Male
    • mcblaber on LinkedIn
    • @mcblaber on Twitter
    • AvatarPrime
Re: SMF Search Enhancement Mod
« Reply #16 on: August 13, 2007, 01:05:07 PM »
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
M. Colin Blaber
Formally known as shadow82x
SMF Support Specialist

SMF2.1 Alpha Playground

Offline christicehurst

  • Full Member
  • ***
  • Posts: 581
  • Gender: Male
  • Brisbane Lions United Admin
    • CJT Online
Re: SMF Search Enhancement Mod
« Reply #17 on: August 13, 2007, 01:44:22 PM »
Great mod, no problems at all. People will snap this mod up fast!
www.brisbanelionsunited.com - A forum for everyone!

Offline ioszilla

  • Jr. Member
  • **
  • Posts: 252
  • Gender: Male
  • Freedom to be unfree.
Re: SMF Search Enhancement Mod
« Reply #18 on: August 13, 2007, 01:45:08 PM »
Thanks shadow82x, glad you like it. :) I see it's working well on your forum.

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

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

Offline Eleglin

  • Sr. Member
  • ****
  • Posts: 754
  • Gender: Male
    • Les Archives de Gondor
Re: SMF Search Enhancement Mod
« Reply #19 on: August 13, 2007, 01:45:55 PM »
 No more errors with javascript, that's pretty cool !  :P

I should verify translation, be patient please
« Last Edit: August 13, 2007, 01:48:18 PM by Eleglin »
No support by PM or Mail.