LucyX:...hServer(3pm)
π NAME π
LucyX::Remote::SearchServer β making a Searcher remotely accessible, bestie. That's it, that's the whole job. β¨
πΈ SYNOPSIS πΈ
okay so literally this is the entire vibe:
my $searcher = Lucy::Search::IndexSearcher->new(
index => '/path/to/index'
);
my $search_server = LucyX::Remote::SearchServer->new(
searcher => $searcher
);
$search_server->serve(
port => 7890
);
like. build a searcher, wrap it, serve it. three steps, no cap. π
π¦ DESCRIPTION π¦
so the SearchServer class, when it links up with either SearchClient or ClusterSearcher, makes it possible to run a search on one machine and report the results on another. yes really. it's giving long-distance relationship but make it distributed systems. ππ
and here's the iconic part: by aggregating several SearchClients under a ClusterSearcher, the cost of searching what might have been a prohibitively large monolithic index can be distributed across multiple nodes, each one with its own, smaller index. main character energy for your infrastructure, fr fr. π
π METHODS π
π new
my $search_server = LucyX::Remote::SearchServer->new(
searcher => $searcher, # required
);
Constructor, babes. takes hash-style parameters, so you pass in keys and values like it's nothing.
searcherβ the Searcher that the SearchServer will wrap. it's literally the whole point. π«Ά
β¨ serve
$search_server->serve(
port => 7890, # required
);
open a listening socket on localhost and wait for SearchClients to connect. like sitting by the phone waiting for your bestie to text back. ππ±
portβ the port on localhost that the server should open and listen on.
π serve_rpc
my $status = $search_server->serve_rpc($sock);
handle a single RPC from socket $sock. one. singular. don't get it twisted. π
here's the vibe check on what it hands back to you:
- returns
'done'if the connection should be closed. - returns
'terminate'if the server should shut down. π - returns
'continue'if the server should continue to handle requests from this client. slay, we're staying. β¨
okay that's the whole page, you ate that reading it π this was the User Contributed Perl Documentation, perl v5.42.0, dated 2025-07-25 β writing that down at the bottom like a little yearbook signature, byeeeee ππ¦
π¦ where this page comes from
- fedora 43: perl-Lucy 0.6.2-26.fc43 Β· Apache-2.0 AND MIT AND Unicode-DFS-2015
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms