Moritz Lenz wrote on 6/21/13 1:42 AM:

> 
> The disadvantage of that approach is that it forces the user to reimplement 
> the
> locking that lucy surely already implements for writing the index.
> 
> It would be awesome to be able to do
> 
> $indexer->set_meta_data($key, $value);
> $indexer->commit;
> 
> have the commit write the meta data along with the rest of the data.

yes, that's basically what SWISH::Prog::Lucy::Indexer does.

 my $indexer = SWISH::Prog::Lucy::Indexer->new(
  config               => SWISH::Prog::Config‐>new(),
  invindex             => 'path/to/index',
  highlightable_fields => 0,
 );

 $indexer->start();

 while ( my $doc = get_a_doc() ) {
     $indexer->process($doc);
 }

 # store some arbitrary metadata
 $indexer->s3->config->get_index->set( 'mykey', 'myvalue' );

 $indexer->finish();



-- 
Peter Karman  .  http://peknet.com/  .  [email protected]

Reply via email to