[Catalyst-commits] r7094 - trunk/Catalyst-Model-Xapian

marcus at dev.catalyst.perl.org marcus at dev.catalyst.perl.org
Wed Nov 7 19:24:03 GMT 2007


Author: marcus
Date: 2007-11-07 19:24:02 +0000 (Wed, 07 Nov 2007)
New Revision: 7094

Added:
   trunk/Catalyst-Model-Xapian/META.yml
   trunk/Catalyst-Model-Xapian/Makefile.PL
   trunk/Catalyst-Model-Xapian/README
Modified:
   trunk/Catalyst-Model-Xapian/MANIFEST
Log:
New release

Modified: trunk/Catalyst-Model-Xapian/MANIFEST
===================================================================
--- trunk/Catalyst-Model-Xapian/MANIFEST	2007-11-07 19:22:36 UTC (rev 7093)
+++ trunk/Catalyst-Model-Xapian/MANIFEST	2007-11-07 19:24:02 UTC (rev 7094)
@@ -1,4 +1,5 @@
 Build.PL
+Changes
 lib/Catalyst/Helper/Model/Xapian.pm
 lib/Catalyst/Model/Xapian.pm
 lib/Catalyst/Model/Xapian/Result.pm

Added: trunk/Catalyst-Model-Xapian/META.yml
===================================================================
--- trunk/Catalyst-Model-Xapian/META.yml	                        (rev 0)
+++ trunk/Catalyst-Model-Xapian/META.yml	2007-11-07 19:24:02 UTC (rev 7094)
@@ -0,0 +1,27 @@
+---
+name: Catalyst-Model-Xapian
+version: 0.03
+author:
+  - 'Marcus Ramberg <mramberg at cpan.org>'
+abstract: Catalyst model for Search::Xapian.
+license: perl
+resources:
+  license: http://dev.perl.org/licenses/
+requires:
+  Catalyst: 5.30
+  Data::Page: 0
+  Encode: 0
+  Search::Xapian: 0.9.2.4
+  Storable: 0
+provides:
+  Catalyst::Helper::Model::Xapian:
+    file: lib/Catalyst/Helper/Model/Xapian.pm
+  Catalyst::Model::Xapian:
+    file: lib/Catalyst/Model/Xapian.pm
+    version: 0.03
+  Catalyst::Model::Xapian::Result:
+    file: lib/Catalyst/Model/Xapian/Result.pm
+generated_by: Module::Build version 0.2808
+meta-spec:
+  url: http://module-build.sourceforge.net/META-spec-v1.2.html
+  version: 1.2

Added: trunk/Catalyst-Model-Xapian/Makefile.PL
===================================================================
--- trunk/Catalyst-Model-Xapian/Makefile.PL	                        (rev 0)
+++ trunk/Catalyst-Model-Xapian/Makefile.PL	2007-11-07 19:24:02 UTC (rev 7094)
@@ -0,0 +1,31 @@
+# Note: this file was auto-generated by Module::Build::Compat version 0.03
+    
+    unless (eval "use Module::Build::Compat 0.02; 1" ) {
+      print "This module requires Module::Build to install itself.\n";
+      
+      require ExtUtils::MakeMaker;
+      my $yn = ExtUtils::MakeMaker::prompt
+	('  Install Module::Build now from CPAN?', 'y');
+      
+      unless ($yn =~ /^y/i) {
+	die " *** Cannot install without Module::Build.  Exiting ...\n";
+      }
+      
+      require Cwd;
+      require File::Spec;
+      require CPAN;
+      
+      # Save this 'cause CPAN will chdir all over the place.
+      my $cwd = Cwd::cwd();
+      
+      CPAN::Shell->install('Module::Build::Compat');
+      CPAN::Shell->expand("Module", "Module::Build::Compat")->uptodate
+	or die "Couldn't install Module::Build, giving up.\n";
+      
+      chdir $cwd or die "Cannot chdir() back to $cwd: $!";
+    }
+    eval "use Module::Build::Compat 0.02; 1" or die $@;
+    
+    Module::Build::Compat->run_build_pl(args => \@ARGV);
+    require Module::Build;
+    Module::Build::Compat->write_makefile(build_class => 'Module::Build');

Added: trunk/Catalyst-Model-Xapian/README
===================================================================
--- trunk/Catalyst-Model-Xapian/README	                        (rev 0)
+++ trunk/Catalyst-Model-Xapian/README	2007-11-07 19:24:02 UTC (rev 7094)
@@ -0,0 +1,66 @@
+NAME
+    Catalyst::Model::Xapian - Catalyst model for Search::Xapian.
+
+SYNOPSIS
+        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;
+ 
+DESCRIPTION
+    This model class wraps Search::Xapian 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'
+
+CONFIG OPTIONS
+    db  Path to the index directory. will default to <MyApp>/index.
+
+    language
+        Language to use for stemming. Defaults to english
+
+    page_size
+        Default page sizes for Data::Page. Defaults to 10.
+
+    utf8_query
+        Queries are passed as utf8 strings. defaults to 1.
+
+    order_by_date
+        Sets weighting to order by docid descending rather than the usual
+        BM25 weighting. Off by default.
+
+METHODS
+    new Constructor. sets up the db and qp accessors. Is called
+        automatically by Catalyst at startup.
+
+    search <q>,[<page>],[<page_size>]
+        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
+        Data::Page object and an arrayref to the extracted document data.
+
+    prepare_enq <enq>
+        Prepare enquire object before getting mset. Allows you to modify
+        ordering and such in your subclass.
+
+    extract_data <item> <query>
+        Extract data from a Search::Xapian::Document. Defaults to using
+        Storable::thaw.
+
+    qp  Query Parser. The Search::Xapian::QueryParser object used to parse
+        the query.
+
+AUTHOR
+    Marcus Ramberg <mramberg at cpan.org>
+
+LICENSE
+    This library is free software . You can redistribute it and/or modify it
+    under the same terms as perl itself.
+




More information about the Catalyst-commits mailing list