[dokuwiki] Re: Search Result

  • From: "Todd Augsburger" <todd@xxxxxxxxxxxxxxxx>
  • To: <dokuwiki@xxxxxxxxxxxxx>
  • Date: Thu, 28 Feb 2008 09:36:14 -0500

I created a plugin to:
1) Search on pages rendered as text, rather than raw wiki
2) Display search result snippets from text

You may find it at:
http://cobs.rollerorgans.com/plugins/searchtext.zip

Configuration is in Admin Configuration Settings

This plugin REQUIRES two modifications to core code:
1) text.php renderer placed in inc/parser/
2) inc/fulltext.php modified to add a FULLTEXT_SNIPPET_GETTEXT event

Files to assist you are installed in lib/plugins/searchtext/installhelp/
1) a darcs patch to add the FULLTEXT_SNIPPET_GETTEXT event
   (Is there any chance this could be put into core code?)
2) text.php -- a renderer to convert pages to text
  (I may discuss this in a separate message.)

There is one caveat: I chose NOT to match phrase searches against the 
rendered text, for 2 reasons:
1) phrase searches do not use indexed data, therefore requiring rendered 
text for _all_ pages which match the indexed words. To allow this behavior 
would mean slowere searches in some cases. (I think unacceptably so.) I 
could of course allow this option in a configuration setting, but it would 
_also_ require another event.
2) it would raise the possibility of a circular reference if the page 
content was dependent upon a search result (As one of my plugins is.) You 
couldn't render a page which finds itself in search results, for example.

Comments welcome,
Todd Augsburger
todd@xxxxxxxxxxxxxxxx
Roller Organs
www.rollerorgans.com


-- 
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: