1LucyX::Remote::SearchSeUrsveerr(C3opnmt)ributed Perl DocLuumceynXt:a:tRieomnote::SearchServer(3pm)
2
3
4
6 LucyX::Remote::SearchServer - Make a Searcher remotely accessible.
7
9 my $searcher = Lucy::Search::IndexSearcher->new(
10 index => '/path/to/index'
11 );
12 my $search_server = LucyX::Remote::SearchServer->new(
13 searcher => $searcher
14 );
15 $search_server->serve(
16 port => 7890
17 );
18
20 The SearchServer class, in conjunction with either SearchClient or
21 ClusterSearcher, makes it possible to run a search on one machine and
22 report results on another.
23
24 By aggregating several SearchClients under a ClusterSearcher, the cost
25 of searching what might have been a prohibitively large monolithic
26 index can be distributed across multiple nodes, each with its own,
27 smaller index.
28
30 new
31 my $search_server = LucyX::Remote::SearchServer->new(
32 searcher => $searcher, # required
33 );
34
35 Constructor. Takes hash-style parameters.
36
37 • searcher - the Searcher that the SearchServer will wrap.
38
39 serve
40 $search_server->serve(
41 port => 7890, # required
42 );
43
44 Open a listening socket on localhost and wait for SearchClients to
45 connect.
46
47 • port - the port on localhost that the server should open and listen
48 on.
49
50 serve_rpc
51 my $status = $search_server->serve_rpc($sock);
52
53 Handle a single RPC from socket $sock. Returns 'done' if the connection
54 should be closed. Returns 'terminate' if the server should shut down.
55 Returns 'continue' if the server should continue to handle requests
56 from this client.
57
58
59
60perl v5.38.0 2023-07-20 LucyX::Remote::SearchServer(3pm)