245 |
+ |
+ |
246 |
+LIST: foreach my $list (@Lists) { |
+LIST: foreach my $list (@Lists) { |
247 |
+ |
+ |
248 |
+ # load the right KinoSearch module (for backwards compatibility) |
+ # load the right KinoSearch1 module (for backwards compatibility) |
249 |
+ my $kinosearch_version = ''; |
+ my $kinosearch_version = ''; |
250 |
+ if ($Engine eq 'kinosearch') { |
+ if ($Engine eq 'kinosearch') { |
251 |
+ if ($opt{update} && -e "$list->{index_dir}/kinostats") { |
+ if ($opt{update} && -e "$list->{index_dir}/kinostats") { |
255 |
+ $kinosearch_version = 'old'; |
+ $kinosearch_version = 'old'; |
256 |
+ } else { |
+ } else { |
257 |
+ eval q{ |
+ eval q{ |
258 |
+ use KinoSearch::InvIndexer; |
+ use KinoSearch1::InvIndexer; |
259 |
+ use KinoSearch::Analysis::PolyAnalyzer; |
+ use KinoSearch1::Analysis::PolyAnalyzer; |
260 |
+ }; |
+ }; |
261 |
+ $kinosearch_version = 'new'; |
+ $kinosearch_version = 'new'; |
262 |
+ } |
+ } |
294 |
+ ); |
+ ); |
295 |
+ } |
+ } |
296 |
+ } elsif ($Engine eq 'kinosearch' && $kinosearch_version eq 'new') { |
+ } elsif ($Engine eq 'kinosearch' && $kinosearch_version eq 'new') { |
297 |
+ my $analyzer = KinoSearch::Analysis::PolyAnalyzer->new( language => 'en' ); |
+ my $analyzer = KinoSearch1::Analysis::PolyAnalyzer->new( language => 'en' ); |
298 |
+ $writer = KinoSearch::InvIndexer->new( |
+ $writer = KinoSearch1::InvIndexer->new( |
299 |
+ invindex => $list->{index_dir}, |
+ invindex => $list->{index_dir}, |
300 |
+ create => $opt{create} ? 1 : 0, |
+ create => $opt{create} ? 1 : 0, |
301 |
+ analyzer => $analyzer, |
+ analyzer => $analyzer, |