[KinoSearch] KSx-IndexManager 0.001

Hans Dieter Pearcey hdp at pobox.com
Mon Jul 2 08:12:56 PDT 2007


On Sun, Jul 01, 2007 at 04:24:29PM -0700, Marvin Humphrey wrote:
> I think KinoSearch itself needs to stay streamlined and low-level  
> enough that people such as yourself have no trouble assembling KS  
> components into larger tools.

I agree, which is why I wrote these as separate distributions rather than
suggesting that they be patches to KinoSearch.

> >Compare eg/invindex.pl to KinoSearch's
> >sample/invindex.plx to get an idea of what IndexManager covers.
> 
> I think that file is actually missing from your distro.  It's easy  
> for me at least to see what's going on, but can you please forward  
> some sample code to the list?

Oops.  0.002 has the eg/ directory in it. 

http://vex.pobox.com/~hdp/KSx-IndexManager-0.002.tar.gz

(or CPAN, soon; it's uploaded already)

> In addition to the minimalist apps, I'd like to see an example of how  
> you would use KSx::IndexManager::Plugin::Partition to choose one  
> invindex from among many at both index-time and search-time. KS has  
> MultiSearcher, but it doesn't provide a stock answer for how to  
> multiplex indexing; perhaps you've come up with a good model.

They're solving different problems.  Partition is for when you index e.g. by
user, where users will never search each other's data.  MultiSearcher is for
aggregation.

Suppose you have:

  My::Manager->add_plugins(Partition => { method => 'id' });

Then:

  my $mgr = My::Manager->new({ root => "/index" });

  while (... get some input ...) {
    my $user = User->get(... based on input, say id => 42);
    $mgr->context($user);
    my $hits = $mgr->search(%args); # searches /index/42
  }

And in another program:

  my $mgr = My::Manager->new({ root => "/index" });

  for my $user (@users) {
    $mgr->context($user);
    $mgr->append([ $user->get_new_docs ]); # adds to /index/<ID>
  }

hdp.



More information about the kinosearch mailing list