Catman...::Solr(3pm)

πŸ’– Catmandu::Importer::Solr β€” the tea β˜•

okay bestie, so this is a Perl manual page from the User Contributed Perl Documentation collection, filed under Catman...::Solr(3pm), and it's literally just one little module: Catmandu::Importer::Solr. That's the whole thing. It's a Catmandu module that pulls data out of a Solr endpoint, and no cap, it's tiny and adorable and does exactly one job. πŸŽ€


✨ NAME ✨

Catmandu::Importer::Solr β€” a Catmandu module whose whole personality is importing data from a Solr endpoint. That's it. That's the vibe. πŸ¦‹


✨ SYNOPSIS ✨

two ways to do it, and honestly both ate πŸ’…

from the command line, one iconic little one-liner:

# From the command line
$ catmandu convert Solr --url "http://localhost:8983/solr" --query "type:book"

from perl, if you're feeling main character energy:

# From perl
use Catmandu;

my %attrs = (
    url => "http://localhost:8983/solr",
    query => 'type:book',
    bag_field => '_bag',
    id_field => '_id'
);

my $importer = Catmandu->importer('Solr',%attrs);

$importer->each(sub {
        my $row_hash = shift;
        ...
});

see how %attrs just slides right into Catmandu->importer('Solr',%attrs)? and then each hands you a $row_hash per row and you do whatever you want with it. literally that simple. no drama, no fuss, just rows. πŸ“


✨ AUTHOR ✨

Nicolas Franck, reachable at "nicolas.franck at ugent.be". king behavior, honestly. πŸ‘‘


✨ SEE ALSO ✨

if you wanna go deeper down the rabbit hole, the girlies to check out are:

  • Catmandu
  • Catmandu::Importer
  • Catmandu::Store::Solr

that's the whole page bestie, she's short and she knows it 🫢

this masterpiece was built on perl v5.36.0, last touched on 2023-02-05, and lives in the Catman...::Solr(3pm) manpage. periodt. πŸ’œ

πŸ“¦ where this page comes from