Changeset 2072
- Timestamp:
- 03/09/08 23:37:17 (2 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
perl/SWISH-Prog-Xapian/trunk/lib/SWISH/Prog/Xapian.pm
r2064 r2072 4 4 use strict; 5 5 6 our $VERSION = '0.01'; 7 6 8 =head1 NAME 7 9 8 SWISH::Prog::Xapian - The great new SWISH::Prog::Xapian! 9 10 =head1 VERSION 11 12 Version 0.01 13 14 =cut 15 16 our $VERSION = '0.01'; 10 SWISH::Prog::Xapian - swish3 Xapian backend 17 11 18 12 =head1 SYNOPSIS 19 13 20 Quick summary of what the module does. 21 22 Perhaps a little code snippet. 23 24 use SWISH::Prog::Xapian; 25 26 my $foo = SWISH::Prog::Xapian->new(); 27 ... 28 29 =head1 EXPORT 30 31 A list of functions that can be exported. You can delete this section 32 if you don't export anything, such as for a purely object-oriented module. 33 34 =head1 FUNCTIONS 35 36 =head2 function1 37 38 =cut 39 40 sub function1 { 41 } 42 43 =head2 function2 44 45 =cut 46 47 sub function2 { 48 } 14 TODO 15 49 16 50 17 =head1 AUTHOR perl/SWISH-Prog-Xapian/trunk/lib/SWISH/Prog/Xapian/Indexer.pm
r2064 r2072 1 package SWISH::Prog:: Indexer::Xapian;1 package SWISH::Prog::Xapian::Indexer; 2 2 use strict; 3 3 use warnings; 4 4 use base qw( SWISH::Prog::Indexer ); 5 5 use Carp; 6 use SWISH::Prog:: InvIndex::Xapian;6 use SWISH::Prog::Xapian::InvIndex; 7 7 use Search::Xapian::Document; 8 8 … … 17 17 18 18 # default index 19 $self->{invindex} ||= SWISH::Prog:: InvIndex::Xapian->new;19 $self->{invindex} ||= SWISH::Prog::Xapian::InvIndex->new; 20 20 21 21 if ( $self->{invindex} && !blessed( $self->{invindex} ) ) { 22 22 $self->{invindex} 23 = SWISH::Prog:: InvIndex::Xapian->new( path => $self->{invindex} );23 = SWISH::Prog::Xapian::InvIndex->new( path => $self->{invindex} ); 24 24 } 25 25 26 unless ( $self->invindex->isa('SWISH::Prog:: InvIndex::Xapian') ) {26 unless ( $self->invindex->isa('SWISH::Prog::Xapian::InvIndex') ) { 27 27 croak ref($self) 28 . " requires SWISH::Prog:: InvIndex::Xapian-derived object";28 . " requires SWISH::Prog::Xapian::InvIndex-derived object"; 29 29 } 30 30 … … 41 41 # and words as 'posting' 42 42 # swishdescription could be saved as 'data' 43 # uri gets saved as 'term' ( TODO why? does xapian use that as for unique id?)43 # uri gets saved as 'term' (xapian uses for unique id) 44 44 45 45 # set_data() can be used to store whatever you want … … 57 57 # can take 'weight' as optional 3rd param 58 58 # we add twice so a word can be found 'naked' and with explicit metaname prefix 59 60 59 61 60 sub _process_doc { perl/SWISH-Prog-Xapian/trunk/lib/SWISH/Prog/Xapian/InvIndex.pm
r2064 r2072 1 package SWISH::Prog:: InvIndex::Xapian;1 package SWISH::Prog::Xapian::InvIndex; 2 2 use strict; 3 3 use warnings;
