Catman...chable(3pm)
π Catmandu::Searchable π
okay bestie, gather round β this is the manual page for Catmandu::Searchable(3pm), and it's straight outta the User Contributed Perl Documentation. here's the tea: Catmandu::Searchable is literally the optional role for searchable stores. that's it. that's the whole name. if your store wants to be searchable, this is the role she puts on. periodt. π
β¨ SYNOPSIS β¨
look at her go, fr fr:
my $store = Catmandu::Store::Solr->new();
# Return one page of search results (page size = 1000)
my $hits = $store->bag->search(
query => 'dna' ,
start => 0 ,
limit => 100 ,
sort => 'title desc',
);
# Return all the search results as iterator
my $it = $store->bag->searcher(query => 'dna');
$it->each(sub { ...});
$store->bag->delete_by_query(query => 'dna');
searching, iterating, deleting-by-query β main character energy, honestly. π
π§ CONFIGURATION π§
default_limit
the default value for limit. by default this is 10. so if you don't say anything, she just assumes 10. lowkey sensible. π
maximum_limit
the maximum allowed value for limit. by default this is 1000. go past that andβ¦ nope, not today. π
maximum_offset
the maximum allowed offset. when this is set, no hits will be returned after the hit offset is greater than maximum_offset β and that's specifically to avoid deep paging problems. pagination values will also be adjusted accordingly. it's giving "protect the server", and honestly? valid. π₯
π METHODS π
search(query => $query, start => $start, page => $page, limit => $num, sort => $sort)
search the database and returns a Catmandu::Hits on success. that Hits represents one result page of at most $num results. the $query and $sort should implement the query and sort syntax of the underlying search engine. iykyk. π
optionally you can provide the index of the first result using the start option, or the starting page using the page option. the number of records in a result page can be set using the limit option. sorting options are being sent verbatim to the underlying search engine. verbatim!! no editing, no notes, she does not paraphrase. β¨
searcher(query => $query, start => $start, limit => $num, sort => $sort, cql_query => $cql)
search the database and return a Catmandu::Iterable on success. this iterator can be used to loop over the complete result set. the $query and $sort should implement the query and sort syntax of the underlying search engine. π¦
optionally provide the index of the first result using the start option. the number of records in a page can be set using the limit option. sorting options are being sent verbatim to the underlying search engine. again. verbatim. π
delete_by_query(query => $query)
delete items from the database that match $query. bye bestie. ππ
πΈ CQL support πΈ
stores that support the CQL query language (https://www.loc.gov/standards/sru/cql/) also accept the cql_query and sru_sortkeys arguments. see Catmandu::CQLSearchable for more information. CQL girlies, this one's for you. π«Ά
β SEE ALSO β
Catmandu::CQLSearchableCatmandu::HitsCatmandu::Paged
aaaand that's the whole page!! π written up in perl v5.40.1, dated 2026-01-24 β mwah. iconic. no notes. πβ¨
π¦ where this page comes from
- ubuntu resolute: libcatmandu-perl 1.2025-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcatmandu-perl 1.2025-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms