]> sipb.mit.edu Git - ikiwiki.git/blobdiff - doc/todo/different_search_engine.mdwn
Suggest a simpler mechanism than regexes, to avoid the potential exploits caused...
[ikiwiki.git] / doc / todo / different_search_engine.mdwn
index 592c159b38fc8dc3e5aa8c44c14e9ba9d073ba52..81cb04539eed6541d23424785c807cfa665356f9 100644 (file)
@@ -3,8 +3,14 @@ the [[plugins/search]] plugin, is not robust enough for ikiwiki. It doesn't
 upgrade well, and it has a habit of sig-11 on certian input from time to
 time.
 
-So some other engine should be found and used instead. Enrico had one that
-he was using for debtags stuff that looked pretty good.
+So some other engine should be found and used instead. 
+
+Enrico had one that he was using for debtags stuff that looked pretty good.
+That was [Xapian](http://www.xapian.org/), which has perl bindings in
+libsearch-xapian-perl. The nice thing about xapian is that it does a ranked
+search so it understands what words are most important in a search. (So
+does Lucene..) Another nice thing is it supports "more documents like this
+one" kind of search. --[[Joey]]
 
 >> I've done a bit of prototyping on this. The current hip search library is [Lucene](http://lucene.apache.org/java/docs/). There's a Perl port called [Plucene](http://search.cpan.org/~tmtm/Plucene-1.25/). Given that it's already packaged, as `libplucene-perl`, I assumed it would be a good starting point. I've written a **very rough** patch against `IkiWiki/Plugin/search.pm` to handle the indexing side (there's no facility to view the results yet, although I have a command-line interface working). That's below, and should apply to SVN trunk.
 
@@ -17,6 +23,12 @@ he was using for debtags stuff that looked pretty good.
 
 >> If this seems a sensible approach, I'll write the CGI interface, and clean up the plugin. -- Ben
 
+>>> The weird thing about lucene is that these are all reimplmentations of
+>>> it. Thank you java.. The C++ version seems like a better choice to me
+>>> (packages are trivial). --[[Joey]]
+
+> Might I suggest renaming the "search" plugin to "hyperestraier", and then creating new search plugins for different engines?  No reason to pick a single replacement. --[[JoshTriplett]]
+
 <pre>
 Index: IkiWiki/Plugin/search.pm
 ===================================================================
@@ -54,20 +66,20 @@ Index: IkiWiki/Plugin/search.pm
 +
  sub import { #{{{
 -       hook(type => "getopt", id => "hyperestraier",
--               call => \&getopt);
+-               call => \&amp;getopt);
 -       hook(type => "checkconfig", id => "hyperestraier",
 +       hook(type => "checkconfig", id => "plucene",
-                call => \&checkconfig);
+                call => \&amp;checkconfig);
 -       hook(type => "pagetemplate", id => "hyperestraier",
--               call => \&pagetemplate);
+-               call => \&amp;pagetemplate);
 -       hook(type => "delete", id => "hyperestraier",
 +       hook(type => "delete", id => "plucene",
-                call => \&delete);
+                call => \&amp;delete);
 -       hook(type => "change", id => "hyperestraier",
 +       hook(type => "change", id => "plucene",
-                call => \&change);
+                call => \&amp;change);
 -       hook(type => "cgi", id => "hyperestraier",
--               call => \&cgi);
+-               call => \&amp;cgi);
  } # }}}
  
 -sub getopt () { #{{{