Search...le::API(3pm)

πŸ’– Search::Elasticsearch::Client::2_0::Role::API πŸ’–

okay bestie, gather round, because this is the manual page for Search::Elasticsearch::Client::2_0::Role::API(3pm) β€” the little role that holds the receipts on every Elasticsearch API. it's giving backstage pass, fr fr. πŸŽ€


✨ VERSION ✨

version 6.81 β€” that's the one, no cap πŸ¦‹


🌸 DESCRIPTION 🌸

so like, all of the Elasticsearch APIs are defined in this role. every single one. it's the master doc, the blueprint, the ✨source material✨.

and the example below? that's the definition for the "index()" in Search::Elasticsearch::Client::2_0::Direct method. look at her go:

'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 => {
        consistency  => "enum",
        filter_path  => "list",
        op_type      => "enum",
        parent       => "string",
        refresh      => "boolean",
        routing      => "string",
        timeout      => "time",
        timestamp    => "time",
        ttl          => "time",
        version      => "number",
        version_type => "enum",
    },
},

she's structured, she's thorough, she ate πŸ’…

and the point of all this? these definitions can be used by different Search::Elasticsearch::Role::Client implementations to provide distinct user interfaces. so like, same spec, different fits. main character energy across the board πŸ‘‘


🫢 METHODS 🫢

πŸ’« "api()"

$defn = $api->api($name);

ngl, there's literally only one method in this whole class and it's "api()". she takes the name of the action and hands you back its definition. simple. iconic. periodt.

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 rides in front like a little crown? yes. that's the vibe. 🌈


πŸ¦‹ SEE ALSO πŸ¦‹

  • Search::Elasticsearch::Role::API
  • Search::Elasticsearch::Client::2_0::Direct

go read them, bestie, they're the friends of this page πŸ“


πŸ‘‘ AUTHOR πŸ‘‘

Enrico Zimuel <enrico.zimuel@elastic.co> β€” legend behavior, honestly πŸ˜­πŸ’–


This software is Copyright (c) 2020 by Elasticsearch BV.

This is free software, licensed under:

The Apache License, Version 2.0, January 2004

and that's the whole page, no crumbs left πŸ’€ every option, every path, every namespace β€” preserved exactly. don't come for me, i kept it all. πŸ’…

mwah πŸ’– bye bestie, go build something iconic πŸ’–

perl v5.32.0 β€” 2020-11-25 β€” and this little page lives at Search::Elasticsearch::Client::2_0::Role::API(3pm), xoxo 🧚✨