Parent Directory | Revision Log
extracted support for Plucene to separate file
1 | #!/usr/bin/perl -w |
2 | |
3 | use strict; |
4 | |
5 | # |
6 | # simple implementation to use Lucene port to perl |
7 | # |
8 | |
9 | use Plucene::Simple; |
10 | |
11 | sub open_index { |
12 | my $self = shift; |
13 | |
14 | my $index_file = shift || croak "open_index needs index filename"; |
15 | |
16 | $self->{index} = Plucene::Simple->open($index_file) || croak "can't open index '$index_file': $!"; |
17 | return $self->{index}; |
18 | |
19 | } |
20 | |
21 | sub search_index { |
22 | my $self = shift; |
23 | |
24 | my $s = shift || croak "search_index needs query"; |
25 | |
26 | return $self->{index}->search($s); |
27 | } |
28 | |
29 | 1; |
ViewVC Help | |
Powered by ViewVC 1.1.26 |