| Catalyst::Model::Xapian - Catalyst model for Search::Xapian. |
Catalyst::Model::Xapian - Catalyst model for Search::Xapian.
my ($it,$res)= $c->comp('MyApp::M::Xapian')->search(
$c->req->param('q'),
$c->req->param('page') ||0 ,
$c->req->param('itemsperpage')||0
);
$c->stash->{searchresults}=$res;
$c->stash->{iterator}=$it;
This model class wraps the Search::Xapian manpage to provide a friendly, paged interface to Xapian (www.xapian.org) indexes. This class adds a little extra convenience on top of the Search::Xapian class. It expects you to use the QueryParser, and sets up some keywords based on the standard omega keywords (id, host, date, month, year,title), so that you can do searches like
'fubar site:microsoft.com'
Path to the index directory. will default to <MyApp>/index.
Language to use for stemming. Defaults to english
Default page sizes for the Data::Page manpage. Defaults to 10.
Queries are passed as utf8 strings. defaults to 1.
Sets weighting to order by docid descending rather than the usual BM25 weighting. Off by default.
Constructor. sets up the db and qp accessors. Is called automatically by Catalyst at startup.
perform a search using the Xapian QueryBuilder. expands the document data using extract_data. You can override the page size per query by passing page size as a final argument to the function. returns a the Data::Page manpage object and an arrayref to the extracted document data.
Marcus Ramberg <mramberg@cpan.org>
This library is free software . You can redistribute it and/or modify it under the same terms as perl itself.
| Catalyst::Model::Xapian - Catalyst model for Search::Xapian. |