[cgi-wiki-dev] [PATCH] Abstract searching to base class

Kate L Pugh cgi-wiki-dev@earth.li
Mon, 23 Feb 2004 19:30:43 +0000


On Mon 23 Feb 2004, Simon Cozens <simon@simon-cozens.org> wrote:
> This is a pretty hefty patch which abstracts out the two searching classes
> into a Search::Base class, in preparation for adding a third search engine
> backend. (Plucene)

Thanks, will look at this next.

> While constructing this I found a particularly confusing thing about the
> full text search backend. index_node is called as follows:
>     $search->index_node($node, $content);
> 
> However, DBIxFTS says this:
>     my ($self, $node) = @_;
> [...]
>     $fts_all->index_document($node);
>     $fts_titles->index_document($node);

The way DBIxFullTextSearch works is that when you create the FTS
object you tell it which columns of which table to index, and then
all you need to pass to ->index_document is the id of the row that
you want to index - in this case the id is the node name.  More details
in CGI::Wiki::Setup::DBIxFTS

Kake