Catman..._store(3pm)
β¨ NAME β¨
okay bestie so this is Catmandu::Fix::search_in_store β a little Perl manual page (a 3pm one, from the User Contributed Perl Documentation crew π«Ά). What it does? It takes a value, uses it as a query, and swaps it out for a whole search object. it's giving glow-up π
πΈ SYNTAX πΈ
search_in_store(path)
search_in_store(path,store: 'store', bag: 'bag', limit: 0, start: 0,
sort: 'title desc')
that's the whole vibe. one path, or a path plus a lil entourage of options π
π RETURN VALUE π
here's what you get back, and no cap, it's a whole struct:
{
start: 0,
limit: 0,
hits: [],
total: 1000
}
cf. Catmandu::Hits β¨
π PARAMETERS π
path
the spot in the perl hash where the query is chillin'. like, where your search lives π
see "PATHS" in Catmandu::Fix for all the tea on paths.
store
the name of the store. bestie, listen β this store MUST be an implementation of Catmandu::Searchable. non-negotiable, periodt.
there are several ways to refer to a store:
- by full package name ( e.g.
'Catmandu::Store::Solr') - by short package name ( e.g.
'Solr') - by name defined in the Catmandu configuration
see "store-NAME" in Catmandu for more info.
default is 'default'.
bag
name of the bag. that's it, that's the whole job π
default is 'data'.
limit
only return $limit number of records. keep it cute, keep it small βοΈ
start
offset of records to return. like, skip this many first πββοΈ
sort
sort records before slicing them. important order of operations, iykyk.
this parameter is store specific β so don't come for me if your store does its own thing π
π OTHER PARAMETERS π
other parameters are given to the contructor of the Catmandu::Store β yep, you can just yeet extra stuff in there and it goes straight to the constructor π
e.g. catmandu.yml:
store:
catalog:
package: "Catmandu::Store::Solr"
e.g. fix:
search_in_store('foo.query', store:'catalog', bag: 'data', url: 'http://localhost:8983/solr/catalog')
π¦ EXAMPLES π¦
#search in Catmandu->store->bag, and store first 20 results in the foo.query.hits
search_in_store('foo.query')
#search in Catmandu->store->bag, and store first 20 results in the foo.query.hits
search_in_store('foo.query', store:'default')
#search in Catmandu->store->bag; limit number of results to 10
search_in_store('foo.query', store:'default', limit: 10)
#search in Catmandu->store->bag; limit number of result to 10, starting from 15
search_in_store('foo.query', store:'default', limit: 10, start: 15)
#search in Catmandu->store->bag('persons'); sort by year descending, and by title ascending
search_in_store('foo.query', store:'default', bag:'persons', sort: 'year desc,title asc')
look at all those lil variations, each one a main character π π₯
π AUTHORS π
Nicolas Franck <nicolas.franck at ugent.be> β the icon who made this happen, we stan π«Ά
π SEE ALSO π
Catmandu::FixCatmandu::Store
lowkey a whole serve of a page, and that's on that π
k bye bestie, this was perl v5.40.1, dated 2026-01-24, brought to you by Catman..._store(3pm) π mwah π
π¦ 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