You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2011/11/08 16:34:24 UTC
[lucy-commits] svn commit: r1199290 - in /incubator/lucy/trunk/perl: MANIFEST
lib/LucyX/Remote/ClusterSearcher.pm t/550-cluster_searcher.t
Author: marvin
Date: Tue Nov 8 15:34:24 2011
New Revision: 1199290
URL: http://svn.apache.org/viewvc?rev=1199290&view=rev
Log:
Fork SearchClient to ClusterSearcher.
Added:
incubator/lucy/trunk/perl/lib/LucyX/Remote/ClusterSearcher.pm
- copied, changed from r1198790, incubator/lucy/trunk/perl/lib/LucyX/Remote/SearchClient.pm
incubator/lucy/trunk/perl/t/550-cluster_searcher.t
- copied, changed from r1196798, incubator/lucy/trunk/perl/t/510-remote_search.t
Modified:
incubator/lucy/trunk/perl/MANIFEST
Modified: incubator/lucy/trunk/perl/MANIFEST
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/perl/MANIFEST?rev=1199290&r1=1199289&r2=1199290&view=diff
==============================================================================
--- incubator/lucy/trunk/perl/MANIFEST (original)
+++ incubator/lucy/trunk/perl/MANIFEST Tue Nov 8 15:34:24 2011
@@ -157,6 +157,7 @@ lib/LucyX/Index/ByteBufDocWriter.pm
lib/LucyX/Index/LongFieldSim.pm
lib/LucyX/Index/ZlibDocReader.pm
lib/LucyX/Index/ZlibDocWriter.pm
+lib/LucyX/Remote/ClusterSearcher.pm
lib/LucyX/Remote/SearchClient.pm
lib/LucyX/Remote/SearchServer.pm
lib/LucyX/Search/Filter.pm
@@ -300,6 +301,7 @@ t/527-req_opt_query.t
t/528-leaf_query.t
t/529-no_match_query.t
t/532-sort_collector.t
+t/550-cluster_searcher.t
t/601-queryparser.t
t/602-boosts.t
t/603-query_boosts.t
Copied: incubator/lucy/trunk/perl/lib/LucyX/Remote/ClusterSearcher.pm (from r1198790, incubator/lucy/trunk/perl/lib/LucyX/Remote/SearchClient.pm)
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/perl/lib/LucyX/Remote/ClusterSearcher.pm?p2=incubator/lucy/trunk/perl/lib/LucyX/Remote/ClusterSearcher.pm&p1=incubator/lucy/trunk/perl/lib/LucyX/Remote/SearchClient.pm&r1=1198790&r2=1199290&rev=1199290&view=diff
==============================================================================
--- incubator/lucy/trunk/perl/lib/LucyX/Remote/SearchClient.pm (original)
+++ incubator/lucy/trunk/perl/lib/LucyX/Remote/ClusterSearcher.pm Tue Nov 8 15:34:24 2011
@@ -16,7 +16,7 @@
use strict;
use warnings;
-package LucyX::Remote::SearchClient;
+package LucyX::Remote::ClusterSearcher;
BEGIN { our @ISA = qw( Lucy::Search::Searcher ) }
use Carp;
use Storable qw( nfreeze thaw );
@@ -138,11 +138,11 @@ __END__
=head1 NAME
-LucyX::Remote::SearchClient - Connect to a remote SearchServer.
+LucyX::Remote::ClusterSearcher - Connect to a remote SearchServer.
=head1 SYNOPSIS
- my $client = LucyX::Remote::SearchClient->new(
+ my $client = LucyX::Remote::ClusterSearcher->new(
peer_address => 'searchserver1:7890',
password => $pass,
);
@@ -150,7 +150,7 @@ LucyX::Remote::SearchClient - Connect to
=head1 DESCRIPTION
-SearchClient is a subclass of L<Lucy::Search::Searcher> which can be
+ClusterSearcher is a subclass of L<Lucy::Search::Searcher> which can be
used to search an index on a remote machine made accessible via
L<SearchServer|LucyX::Remote::SearchServer>.
Copied: incubator/lucy/trunk/perl/t/550-cluster_searcher.t (from r1196798, incubator/lucy/trunk/perl/t/510-remote_search.t)
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/perl/t/550-cluster_searcher.t?p2=incubator/lucy/trunk/perl/t/550-cluster_searcher.t&p1=incubator/lucy/trunk/perl/t/510-remote_search.t&r1=1196798&r2=1199290&rev=1199290&view=diff
==============================================================================
--- incubator/lucy/trunk/perl/t/510-remote_search.t (original)
+++ incubator/lucy/trunk/perl/t/550-cluster_searcher.t Tue Nov 8 15:34:24 2011
@@ -48,7 +48,7 @@ package main;
use Lucy::Test;
use LucyX::Remote::SearchServer;
-use LucyX::Remote::SearchClient;
+use LucyX::Remote::ClusterSearcher;
my $kid;
$kid = fork;
@@ -91,23 +91,23 @@ else {
plan( 'skip_all', "Can't get a socket: $!" );
}
-my $searchclient = LucyX::Remote::SearchClient->new(
+my $cluster_searcher = LucyX::Remote::ClusterSearcher->new(
schema => SortSchema->new,
peer_address => "localhost:$PORT_NUM",
password => 'foo',
);
-is( $searchclient->doc_freq( field => 'content', term => 'x' ),
+is( $cluster_searcher->doc_freq( field => 'content', term => 'x' ),
3, "doc_freq" );
-is( $searchclient->doc_max, 3, "doc_max" );
-isa_ok( $searchclient->fetch_doc(1), "Lucy::Document::HitDoc", "fetch_doc" );
-isa_ok( $searchclient->fetch_doc_vec(1),
+is( $cluster_searcher->doc_max, 3, "doc_max" );
+isa_ok( $cluster_searcher->fetch_doc(1), "Lucy::Document::HitDoc", "fetch_doc" );
+isa_ok( $cluster_searcher->fetch_doc_vec(1),
"Lucy::Index::DocVector", "fetch_doc_vec" );
-my $hits = $searchclient->hits( query => 'x' );
+my $hits = $cluster_searcher->hits( query => 'x' );
is( $hits->total_hits, 3, "retrieved hits from search server" );
-$hits = $searchclient->hits( query => 'a' );
+$hits = $cluster_searcher->hits( query => 'a' );
is( $hits->total_hits, 1, "retrieved hit from search server" );
my $folder_b = Lucy::Store::RAMFolder->new;
@@ -128,7 +128,7 @@ is( ref( $searcher_b->get_reader ), 'Luc
my $poly_searcher = Lucy::Search::PolySearcher->new(
schema => SortSchema->new,
- searchers => [ $searcher_b, $searchclient ],
+ searchers => [ $searcher_b, $cluster_searcher ],
);
$hits = $poly_searcher->hits( query => 'b' );
@@ -177,6 +177,6 @@ is_deeply(
);
END {
- $searchclient->terminate if defined $searchclient;
+ $cluster_searcher->terminate if defined $cluster_searcher;
kill( TERM => $kid ) if $kid;
}