[KinoSearch] Playing with MultiSearcher framework

Henry henka at cityweb.co.za
Mon Nov 5 00:15:25 PST 2007



>> KinoSearch::Search::MultiSearcher->set_enable_sorting(1); # (A)
>
>> Searching using the above code results in a "sort_spec not currently
>> supported by MultiSearcher..." error no matter where I place (A).
>
> I don't get that.  Does it happen even if you place it right after
> the 'use' directive?  That error occurs in $multi_searcher->top_docs
> (), which is called internally by $multi_searcher->search().  Calling
> set_enable_sorting() any time prior to the $multi_searcher->search()
> command ought to work.

This one is probably my dumb.  Will try to duplicate that error later.

> It looks like KinoSearch::Searcher does not contain a "use
> KinoSearch::Search::SortSpec" directive, so you'll have to add that
> to the scripts running on the slave nodes.  I should probably add
> that to Searcher.  Hey, what's one more module to load? :\

OK - added the 'use' line to all nodes.  That's resolved that one.

>> Commenting out all the sort code, but enabling the highlighter code,
>> results in the error: "Can't call method "set_terms" on an
>> undefined value
>> at...Search/Hits.pm line 73, <GEN2> line 1."
>
> I think that's happening because of this:
>
>    #$hits->create_excerpts( );
>    #$hits->create_excerpts( highlighter => $highlighter );
>
> 'highlighter' is a required argument for $hits->create_excerpts, so
> that first line would fail.  I should probably add validation code to
> create_excerpts() so that a more meaningful error message gets produced.

Right you are; sorry for missing that.

OK, using the following to create excerpts results in the error below:

my $highlighter = KinoSearch::Highlight::Highlighter->new;
$highlighter->add_spec( field => 'body' );
$highlighter->add_spec( field => 'title' );
$hits->create_excerpts( highlighter => $highlighter );

Can't call method "term_vector" on unblessed reference at
/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/KinoSearch/Highlight/Highlighter.pm
line 226, <GEN2> line 1.

Disabling the above code yields successful search results (without
highlighting of course) with sorting.

Performance (0.5-0.7s) is not bad at all Marvin (admittedly on a small
subset of the full index), excellent work!  If this distributed search
implementation is less than ideal, then I would imagine there are great
things to come.

I'll be gradually increasing the size of the sub-indexes on all the nodes
and will provide feedback on performance.

Regards
Henry


_______________________________________________
KinoSearch mailing list
KinoSearch at rectangular.com
http://www.rectangular.com/mailman/listinfo/kinosearch




More information about the kinosearch mailing list