Skip to content

Commit

Permalink
[DOCS] Reviews namespaces.asciidoc.
Browse files Browse the repository at this point in the history
  • Loading branch information
szabosteve committed Mar 27, 2020
1 parent 5830d5f commit cfabbdf
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions docs/namespaces.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@
== Namespaces

The client has a number of "namespaces", which generally expose administrative
functionality. The namespaces correspond to the various administrative endpoints
in Elasticsearch. This is a complete list of namespaces:
functionality. The namespaces correspond to the various administrative endpoints
in {es}. This is a complete list of namespaces:


[width="40%",options="header",frame="topbot"]
|============================
| Namespace | Functionality
| Namespace | Functionality
| `indices()` | Index-centric stats and info
| `nodes()` | Node-centric stats and info
| `cluster()` | Cluster-centric stats and info
| `snapshot()` | Methods to snapshot/restore your cluster and indices
| `cat()` | Access to the Cat API (which is generally used standalone from the command line
|============================

Some methods are available in several different namespaces, which give you
the same information but grouped into different contexts. To see how these
Some methods are available in several different namespaces, which give you the
same information but grouped into different contexts. To see how these
namespaces work, let's look at the `_stats` output:


Expand All @@ -39,8 +39,8 @@ $response = $client->cluster()->stats();
----
{zwsp} +

As you can see, the same `stats()` call is made through three different
namespaces. Sometimes the methods require parameters. These parameters work
As you can see, the same `stats()` call is made through three different
namespaces. Sometimes the methods require parameters. These parameters work
just like any other method in the library.

For example, we can requests index stats about a specific index, or multiple
Expand All @@ -60,7 +60,7 @@ $response = $client->indices()->stats($params);
----
{zwsp} +

As another example, here is how you might add an alias to an existing index:
The following example shows how you can add an alias to an existing index:

[source,php]
----
Expand All @@ -77,6 +77,7 @@ $params['body'] = array(
$client->indices()->updateAliases($params);
----

Notice how both the `stats` calls and the updateAlias took a variety of parameters,
each according to what the particular API requires. The `stats` API only requires
an index name(s), while the `updateAlias` requires a body of actions.
Notice how both the `stats` calls and the updateAlias took a variety of
parameters, each according to what the particular API requires. The `stats` API
only requires an index name(s), while the `updateAlias` requires a body of
actions.

0 comments on commit cfabbdf

Please sign in to comment.