Advanced Search

Download: AdvancedSearch

Plugin for CMSimple

Version 1.1.0 (21. 0ct. 2008)

Advanced Search replaces search function of CMSimple with following extensions:

  • Search with any combination of arguments “OR” (default), “AND”, “NOT”, and quoted sentences.
  • Build in DHTML help.
  • Optional phonetical search (double metaphone, metaphone, soundex).
  • Optional highlighted search results (uses slightly modified searchhi.js).
  • Optional search in plugins.
  • Optional log file cmsimple/search_log.txt with log of search results.
  • HTML tags and CMSimple scripts are excluded from search results.
  • Search box on search result page for easier tailoring of your queries.

1. Installation

The compressed ZIP-file contains two folders: “cmsimple” and “plugins”. The cmsimple folder contains the modified search function (search.php) which has to be copied into the cmsimple program folder. Before you do so, you should rename the basic file - in case you dislike this plugin. In the “plugins” folder you find the actual AdvancedSearch plugin (”advanced_search”) which you copy into CMSimple‘s plugins folder like any other plugin.

2. Configuration

In plugin manager it is possible to change:

  • activate/ deactivate highlights (true / false).
  • activate/ deactivate phonetic search (true / false).
  • choice of algorithm for phonetic search (metaphone/soundex) default metaphone.
  • activate/ deactivate search in plugins (se below).
  • activate/ deactivate log for all searches on your site. (true/false). If activated all queries and their results will be logged in the file search_log.txt in cmsimple directory
  • Change style for highlights

Phonetic search uses the algorithm double metaphone (default),metaphone or soundex to calculate the key value of every word in the string. All algorithms create the same key for similar sounding words. The result of metaphone and soundex recognition will be different depending of the language. In advanced search the metaphone and soundex functions are combined with levenshtein function witch defines the minimal number of characters you have to replace insert or delete to transform str1 to str2.

Double metaphone is the most exact algorithm for word recognition and will give most exact results in many languages. If you are lucky then sombody made a double metaphone conversion to your language in this case you can edit the file doublemetaphone.php in data directory of advanced_search. Double Metaphone is a complex search engine and the response time of advanced search will be longer then with with metaphone and soundex. If response time is important on your site then use mataphone or soundex or turn phonetic search off.

Search in Plugins is done by inserting a list of all plugins you want to be searched in the field “plugin search” in AdvancedSearch “Plugin Config”. Not all plugins have a searchable output and this way you can control what plugins you want to be searched. You have to input the function name enclosed in CMSimple tag and use “:” or “;” as separator.

For example to search SimpleRss plugin you have to insert showrss which is the name of the function enclosed in the tag #CMSimple $output.=showrss(”0”);#. For search in both SimpleRSS and Svarrers Gallery insert: showrss: gallery.

Alternative you can set the field “plugin search” to true for searching all available plugins (warning: the result can be unpredictable) or to false to turn search in plugins of.

3. Compatibility

The AdvancedSearch plugin is tested with CMSimple versions 2.9 and higher and will not work with php versions before 4.3. The plugin will probably function in earlier versions of CMSimple

4. Change summary

version 1.1.0 (okt. 2008) Added Double Metaphone search as default. Double Metaphone tries to account for myriad irregularities in English of Slavic, Germanic, Celtic, Greek, French, Italian, Spanish, Chinese, and other origin. Thus it uses a much more complex ruleset for coding than metaphone; for example, it tests for approximately 100 different contexts of the use of the letter C alone.

Added no search on removed pages (#CMSimple remove #) and pages redirecting to othe pages (#CMSimple header(...); #

version 1.0.2 (okt. 2008) onload in searchhi.js replaced by a function addLoadEvent() for compatilibity with other plugins using javascript window.onload.

version 1.0.1 (sept. 2008) include of searchhi.js removed from function advanced_search and made global. No need to intialise in template.htm.

5. Disclaimer

There is no warranty using this plugin. It will be used on everybody’s own risk. We will not assume any liability in case of data losses caused by AdvancedSearch usage.

5. Acknowledgement

The idea to this plugin comes from Till.

The code for search through plugin output is based on code developed by Softly.

The original code for highlighting derives from Stuart Langridge and is slightly modified to accept quoted searches.

The php version of double metaphone is created by Stephen Woodbridge.

The original search.php was written by Peter Harteg.

© Jerry Jakobsfeld, August 2008. home page: http://cmsimple.jakobsfeld.com

plugins/advanced_search.txt · Last modified: 2008/10/21 14:22 by jerry
Webdesign: NMuD chimeric.de = chi`s home Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0