incubator-lucy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From goran kent <gorank...@gmail.com>
Subject [lucy-user] Remote SearchServer and PolySearcher(SearchClient) usage
Date Mon, 31 Oct 2011 10:59:37 GMT
Hi,

I'm probably making a silly mistake, but would appreciate any pointers
on LucyX::Remote::SearchClient -> LucyX::Remote::SearchServer usage.
My test setup is searching a single remote node (eventually will
search many).  Normal local searches work great.

In a nutshell: can I use multiple LucyX::Remote::SearchClients in a
PolySearcher?

My search script SEGVs and the remote SearchServer goes ape.


SearchServer:
-------------------
use Lucy::Search::PolySearcher;
use Lucy::Search::IndexSearcher;
use LucyX::Remote::SearchServer;
...
# batch of local indexes to search:
foreach my $ipath (...) {
  push @searcher, Lucy::Search::IndexSearcher->new( index => $ipath, );
}
my $poly_searcher = Lucy::Search::PolySearcher->new(
    schema     => $schema,
    searchers => \@searcher,
);

my $search_server = LucyX::Remote::SearchServer->new(
    searcher   => $poly_searcher,
    port            => $port,
    password => $pw,
);

$search_server->serve;
#-----------------------------------------------

SearchClient:
------------------
use Lucy::Search::PolySearcher;
use Lucy::Search::IndexSearcher;
use Lucy::Search::SortSpec;
use LucyX::Remote::SearchClient;
...
my $query_parser = Lucy::Search::QueryParser->new(
    schema => $schema,
    default_boolop => 'AND',
);
$query_parser->set_heed_colons(1);
my $parsed_query = $query_parser->parse($query);

my @searcher;
# batch of remote nodes to search
foreach my $remote_host (qw(10.0.0.1)) {
    push @searcher, LucyX::Remote::SearchClient->new(
        peer_address => qq($remote_host:7890),
        password     => $pw,
    );
}

# Can I use multi-LucyX::Remote::SearchClient in PolySearcher?
my $poly_searcher = Lucy::Search::PolySearcher->new(
    schema    => $schema,
    searchers => \@searcher,
);

my $hits = $poly_searcher->hits(
    query      => $parsed_query,
    sort_spec  => $sort_spec,
...
#-----------------------------------------------

Using the search script then fails with SEGV.  In gdb:

Program received signal SIGSEGV, Segmentation fault.
lucy_PolySearcher_init (self=0x2121010, schema=0x212d1f0,
searchers=0x215d480) at
/home/projects/lucy/lucy/perl/../core/Lucy/Search/PolySearcher.c:52
52	        VTable *candidate_vt = Schema_Get_VTable(candidate);

(gdb) bt
#0  lucy_PolySearcher_init (self=0x2121010, schema=0x212d1f0,
searchers=0x215d480) at
/home/projects/lucy/lucy/perl/../core/Lucy/Search/PolySearcher.c:52
#1  0x00002aaaae8a4e36 in XS_Lucy_Search_PolySearcher_new
(my_perl=<value optimized out>, cv=<value optimized out>) at
lib/Lucy.xs:2805
#2  0x0000003993e90aa6 in Perl_pp_entersub () from
/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/libperl.so
#3  0x0000003993e8a34e in Perl_runops_standard () from
/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/libperl.so
#4  0x0000003993e3808a in perl_run () from
/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/libperl.so
#5  0x00000000004017bc in main ()

The errors spewed from the remote search server script:

Use of uninitialized value in chomp at
/usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/LucyX/Remote/SearchServer.pm
line 105, <GEN2> line 1.
Use of uninitialized value in string eq at
/usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/LucyX/Remote/SearchServer.pm
line 108, <GEN2> line 1.
Use of uninitialized value in string eq at
/usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/LucyX/Remote/SearchServer.pm
line 108, <GEN2> line 1.
Use of uninitialized value in hash element at
/usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/LucyX/Remote/SearchServer.pm
line 108, <GEN2> line 1.
Use of uninitialized value in concatenation (.) or string at
/usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/LucyX/Remote/SearchServer.pm
line 122, <GEN2> line 1.
Use of uninitialized value in chomp at
/usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/LucyX/Remote/SearchServer.pm
line 105, <GEN2> line 1.
Use of uninitialized value in string eq at
/usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/LucyX/Remote/SearchServer.pm
line 108, <GEN2> line 1.
Use of uninitialized value in string eq at
/usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/LucyX/Remote/SearchServer.pm
line 108, <GEN2> line 1.
Use of uninitialized value in hash element at
/usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/LucyX/Remote/SearchServer.pm
line 108, <GEN2> line 1.
Use of uninitialized value in concatenation (.) or string at
/usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/LucyX/Remote/SearchServer.pm
line 122, <GEN2> line 1.

Any pointers would be appreciated.

thanks

Mime
View raw message