Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions docs/reference/redirects.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -1356,24 +1356,6 @@ See <<constant-keyword-field-type>>.

See <<wildcard-field-type>>.

[role="exclude",id="searchable-snapshots-api-clear-cache"]
=== Clear cache API

We have removed documentation for this API. This a low-level API used to clear
the searchable snapshot cache. We plan to remove or drastically change this API
as part of a future release.

For other searchable snapshot APIs, see <<searchable-snapshots-apis>>.

[role="exclude",id="searchable-snapshots-api-stats"]
=== Searchable snapshot statistics API

We have removed documentation for this API. This a low-level API used to get
information about searchable snapshot indices. We plan to remove or drastically
change this API as part of a future release.

For other searchable snapshot APIs, see <<searchable-snapshots-apis>>.

[role="exclude",id="searchable-snapshots-repository-stats"]
=== Searchable snapshot repository statistics API

Expand Down
74 changes: 74 additions & 0 deletions docs/reference/searchable-snapshots/apis/clear-cache.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
[role="xpack"]
[testenv="enterprise"]
[[searchable-snapshots-api-clear-cache]]
=== Clear cache API
++++
<titleabbrev>Clear cache</titleabbrev>
++++

experimental::[]

Clears indices and data streams from the <<shared-cache,shared searchable
snapshot cache>>.

[[searchable-snapshots-api-clear-cache-request]]
==== {api-request-title}

`POST /_searchable_snapshots/cache/clear`

`POST /<target>/_searchable_snapshots/cache/clear`

[[searchable-snapshots-api-clear-cache-prereqs]]
==== {api-prereq-title}

If the {es} {security-features} are enabled, you must have the `manage`
<<privileges-list-cluster,cluster privilege>> to use this API. You must also
have the `manage` <<privileges-list-indices,index privileges>> for the target
data stream, index, or index alias.

[[searchable-snapshots-api-clear-cache-path-params]]
==== {api-path-parms-title}

`<target>`::
(Optional, string)
Comma-separated list of data streams, indices, and index aliases to clear from the cache.
To clear the entire cache, omit this parameter. Supports wildcards (`*`).


[[searchable-snapshots-api-clear-cache-example]]
==== {api-examples-title}
////
[source,console]
-----------------------------------
PUT /docs
{
"settings" : {
"index.number_of_shards" : 1,
"index.number_of_replicas" : 0
}
}

PUT /_snapshot/my_repository/my_snapshot?wait_for_completion=true
{
"include_global_state": false,
"indices": "docs"
}

DELETE /docs

POST /_snapshot/my_repository/my_snapshot/_mount?wait_for_completion=true
{
"index": "docs",
"renamed_index": "my-index"
}
-----------------------------------
// TEST[setup:setup-repository]
////

Clears the cache of the index `my-index`:

[source,console]
--------------------------------------------------
POST /my-index/_searchable_snapshots/cache/clear
--------------------------------------------------
// TEST[continued]
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ You can use the following APIs to perform searchable snapshots operations.

* <<searchable-snapshots-api-mount-snapshot,Mount snapshot>>
* <<searchable-snapshots-api-cache-stats,Cache statistics>>
* <<searchable-snapshots-api-stats,Shard statistics>>
* <<searchable-snapshots-api-clear-cache,Clear cache>>

include::mount-snapshot.asciidoc[]
include::node-cache-stats.asciidoc[]
include::shard-stats.asciidoc[]
include::clear-cache.asciidoc[]
77 changes: 77 additions & 0 deletions docs/reference/searchable-snapshots/apis/shard-stats.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
[role="xpack"]
[testenv="enterprise"]
[[searchable-snapshots-api-stats]]
=== Searchable snapshot statistics API
++++
<titleabbrev>Searchable snapshot statistics</titleabbrev>
++++

experimental::[]

Retrieves statistics about searchable snapshots.

[[searchable-snapshots-api-stats-request]]
==== {api-request-title}

`GET /_searchable_snapshots/stats`

`GET /<target>/_searchable_snapshots/stats`

[[searchable-snapshots-api-stats-prereqs]]
==== {api-prereq-title}

If the {es} {security-features} are enabled, you must have the `manage`
<<privileges-list-cluster,cluster privilege>> to use this API. You must also
have the `manage` <<privileges-list-indices,index privileges>> for the target
data stream or index.

[[searchable-snapshots-api-stats-desc]]
==== {api-description-title}


[[searchable-snapshots-api-stats-path-params]]
==== {api-path-parms-title}

`<target>`::
(Optional, string)
Comma-separated list of data streams and indices to retrieve statistics for. To
retrieve statistics for all data streams and indices, omit this parameter.


[[searchable-snapshots-api-stats-example]]
==== {api-examples-title}
////
[source,console]
-----------------------------------
PUT /docs
{
"settings" : {
"index.number_of_shards" : 1,
"index.number_of_replicas" : 0
}
}

PUT /_snapshot/my_repository/my_snapshot?wait_for_completion=true
{
"include_global_state": false,
"indices": "docs"
}

DELETE /docs

POST /_snapshot/my_repository/my_snapshot/_mount?wait_for_completion=true
{
"index": "docs",
"renamed_index": "my-index"
}
-----------------------------------
// TEST[setup:setup-repository]
////

Retrieves the statistics of the index `my-index`:

[source,console]
--------------------------------------------------
GET /my-index/_searchable_snapshots/stats
--------------------------------------------------
// TEST[continued]
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"searchable_snapshots.stats": {
"documentation": {
"url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/searchable-snapshots-apis.html",
"description": "Retrieve various statistics about searchable snapshots."
"description": "Retrieve shard-level statistics about searchable snapshots."
},
"stability": "experimental",
"visibility":"public",
Expand Down