Subject: | fatal error when calling indexed before an index is created |
I had no index and was doing something like
unles( $plucy->indexed($_) ){
$plucy->add( ...
}
so my program died with
Plucene::Store::InputStream cannot open ...
which is not nice.
If there is no index, of course the id is not indexed :)
To fix this change the line
return $self->_reader->doc_freq($term);
in sub indexed to
return eval { $self->_reader->doc_freq($term) } || 0;
Cheers