Search...le::API(3pm)
π NAME π
ok so bestie, welcome to Search::Elasticsearch::Client::1_0::Role::API β this class is literally just the spec for the Elasticsearch APIs. that's it. that's the whole job. it holds the receipts for every API call. π
it's the Search::Elasticsearch::Client::1_0::Role::API manual page, perl-flavored, and yes it's a role (a Perl thing, iykyk). π
β¨ VERSION β¨
version 6.81 β this is the one, no cap. π
π¦ DESCRIPTION π¦
okay so here's the tea: all of the Elasticsearch APIs are defined in this role. like, every single one. π«Ά
and the example below? that's the definition for the index() method in the Search::Elasticsearch::Client::1_0::Direct method. look at it. it's giving organized. it's giving structured. it's giving main character energy:
'index' => {
body => { required => 1 },
doc => "docs-index_",
method => "POST",
parts => {
id => {},
index => { required => 1 },
type => { required => 1 }
},
paths => [
[ { id => 2, index => 0, type => 1 }, "{index}",
"{type}", "{id}"
],
[ { index => 0, type => 1 }, "{index}", "{type}" ],
],
qs => {
filter_path => "list",
op_type => "enum",
parent => "string",
pipeline => "string",
refresh => "enum",
routing => "string",
timeout => "time",
timestamp => "time",
ttl => "time",
version => "number",
version_type => "enum",
wait_for_active_shards => "string",
},
},
and why does this exist, you ask? because these definitions can be used by different Search::Elasticsearch::Role::Client implementations to provide distinct user interfaces. one spec, many fits. versatile icon behavior. π
π METHODS π
π api()
$defn = $api->api($name);
ngl, there's literally only one method in this class and it's api(). she's the whole squad.
what she does: you hand her the name of an action, she hands you back its definition. very give-and-take. very healthy communication. π
oh and heads up β actions in the indices or cluster namespace use the namespace as a prefix, eg:
$defn = $e->api('indices.create');
$defn = $e->api('cluster.node_stats');
see how the namespace is just chillin' at the front with a dot? yeah. that's the vibe. lowkey elegant. π
πΈ SEE ALSO πΈ
Search::Elasticsearch::Role::APISearch::Elasticsearch::Client::1_0::Direct
go read those too bestie, they're the supporting cast and they ate. π«Ά
β AUTHOR β
Enrico Zimuel <enrico.zimuel@elastic.co> β iconic. legendary. we thank him for his service. π
π COPYRIGHT AND LICENSE π
This software is Copyright (c) 2020 by Elasticsearch BV.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004
ok so real talk: it's free software, and it's licensed under the Apache License, Version 2.0, January 2004. that's a legal thing so we're saying it exactly how it is, no remixing. respect the license bestie. π
that's a wrap! π¦ this was Search...le::API(3pm) β perl v5.36.0, dated 2022-08-28, and yes that footer is the last bit of lore. slay, stay hydrated, and go read your specs. periodt. πβ¨
π¦ where this page comes from
- ubuntu noble: libsearch-elasticsearch-client-1-0-perl 6.81-2 Β· Apache-2.0
- ubuntu resolute: libsearch-elasticsearch-client-1-0-perl 6.81-2 Β· Apache-2.0
- ubuntu stonking: libsearch-elasticsearch-client-1-0-perl 6.81-2 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms