[KinoSearch] Playing with MultiSearcher framework
Marvin Humphrey
marvin at rectangular.com
Sat Nov 3 04:38:33 PDT 2007
On Nov 2, 2007, at 5:45 AM, Henry wrote:
> my $hits = $multi_searcher->search(
> query => $q,
> offset => $offset,
> num_wanted => $hits_per_page,
> sort_spec => $sort_spec,
> );
> 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.
For those not yet in the know (which is everyone except Henry)... I
hacked in undocumented support for remote sorting, but it's crippled
by default because the implementation is less than ideal.
> Commenting (ignorant quick-hack, I know) out:
> #confess("sort_spec not currently supported by MultiSearcher")
> # if ( $sort_spec and !$enable_sorting );
> in /usr/lib/perl5/.../KinoSearch/Search/MultiSearcher.pm
> results in an error cascade starting with "Use of uninitialized
> value in
> read at...SearchClient.pm line 66, <GEN2> line 1.".
Line 66 is where the SearchClient tries to read from the socket.
It's failing because the remote node isn't responding.
> This also kills the ::SearchServer process with the error "Can't
> locate
> object method "make_field_doc_collator" via package "KinoSearch::Se
> arch::SortSpec"...Searcher.pm line 62, <GEN2> line 3.".
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? :\
> 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.
Marvin Humphrey
Rectangular Research
http://www.rectangular.com/
_______________________________________________
KinoSearch mailing list
KinoSearch at rectangular.com
http://www.rectangular.com/mailman/listinfo/kinosearch
More information about the kinosearch
mailing list