[PATCH] Abstract searching to base class
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) 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) = @_; (No content?) my $dbh = $self->{_dbh}; my $fts_all = DBIx::FullTextSearch->open($dbh, "_content_and_title_fts"); my $fts_titles = DBIx::FullTextSearch->open($dbh, "_title_fts"); $fts_all->index_document($node); $fts_titles->index_document($node); (No difference between purely-title and content-and-title indexing?) Where does it get the content from? -- "There is no statute of limitations on stupidity." -- Randomly produced by a computer program called Markov3.
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
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)
Released as 0.51_01 (ie a developers' release). Please can people install and test this; make sure any applications you've written around CGI::Wiki are still working. Let us know of any problems ASAP. Kake
participants (2)
-
Kate L Pugh -
Simon Cozens