[KinoSearch] more abstract interfaces to kinosearch
Marvin Humphrey
marvin at rectangular.com
Thu Jun 21 06:38:46 PDT 2007
On Jun 21, 2007, at 5:53 AM, Hans Dieter Pearcey wrote:
> The whole thing
> is not much more than a convenient wrapper around a combination of
> open/clobber
> and for (@objects) { $inv->add_doc }
I've often subclassed InvIndexer to provide convenience methods like
these. They tend to look like this:
sub add_employees {
my ( $self, @employees ) = @_;
for my $employee (@employees) {
$self->add_doc({
name => $employee->get_name,
job => $employee->get_role,
});
}
}
> I also have a subclass that knows where its data comes from.
---->8 SNIP 8<----
> I can just say $index->update
> periodically and it takes care of finding new things to index and
> indexing
> them.
Nice. I think I'll start using that pattern. :)
> It's very specific to that
> particular subclass and data source (and indexing schema),
Yes, that matches my experience. I think it will be challenging to
come up with an abstraction layer for this problem that matches the
elegance and universality of your proposed search query builder.
Marvin Humphrey
Rectangular Research
http://www.rectangular.com/
More information about the KinoSearch
mailing list