Search...le::API(3pm)
β¨ NAME β¨
Search::Elasticsearch::Client::8_0::Role::API β bestie, this class is literally the spec for all the Elasticsearch APIs. That's it, that's the whole job. (And yes, this is the Search...le::API(3pm) page you're reading rn, in case you were wondering π
)
πΈ VERSION πΈ
version 8.12 β iconic, we stay current π«Ά
π¦ DESCRIPTION π¦
Okay so, listen. Every single Elasticsearch API is defined in this role. All of them. The whole roster. And the example down below is the definition for the "index()" in the Search::Elasticsearch::Client::8_0::Direct method, so you can see exactly the vibe we're working with:
'index' => {
body => { required => 1 },
doc => "docs-index_",
method => "POST",
parts => { id => {}, index => {}, type => {} },
paths => [
[ { id => 2, index => 0, type => 1 }, "{index}",
"{type}", "{id}"
],
[ { id => 2, index => 0 }, "{index}", "_doc", "{id}" ],
[ { index => 0, type => 1 }, "{index}", "{type}" ],
[ { index => 0 }, "{index}", "_doc" ],
],
qs => {
error_trace => "boolean",
filter_path => "list",
human => "boolean",
if_primary_term => "number",
if_seq_no => "number",
op_type => "enum",
pipeline => "string",
refresh => "enum",
require_alias => "boolean",
routing => "string",
timeout => "time",
version => "number",
version_type => "enum",
wait_for_active_shards => "string",
},
}
So these definitions can be used by different Search::Elasticsearch::Role::Client implementations to provide distinct user interfaces. Different clients, same spec, matching outfits fr fr π
π METHODS π
π api()
$defn = $api->api($name);
The only method in this whole class is the api() method, and what it does is so cute and simple: you hand it the name of the action, and it hands you back that action's definition. That's the whole relationship. π₯°
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 just walks in front like it owns the place? Periodt. β¨
π SEE ALSO π
Search::Elasticsearch::Role::APISearch::Elasticsearch::Client::8_0::Direct
Go read those too, bestie, they're the whole friend group π
π AUTHOR π
Enrico Zimuel <enrico.zimuel@elastic.co> β the author himself, respect the icon π«Ά
π COPYRIGHT AND LICENSE π
This software is Copyright (c) 2024 by Elasticsearch BV.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004
Legal stuff but make it slay π
And that's a wrap, gorgeous! π This was perl v5.38.2, dated 2024-02-04, and it's the Search...le::API(3pm) page β no cap, you understood all of it, main character energy only, bye bestie! πβ¨π¦πΈ
π¦ where this page comes from
- debian trixie: libsearch-elasticsearch-perl 8.12-1 Β· Apache-2.0
- ubuntu noble: libsearch-elasticsearch-perl 8.12-1 Β· Apache-2.0
- ubuntu resolute: libsearch-elasticsearch-perl 8.12-1 Β· Apache-2.0
- ubuntu stonking: libsearch-elasticsearch-perl 8.12-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms