[Docs] Add _cache/clear parameter examples (#34614)
Add example for selectively clearing just the request, query or fielddata cache and for selectively clearing the cache for specific fields. Closes #34287
This commit is contained in:
parent
45546e71c2
commit
7cc3ac0fc4
|
@ -12,12 +12,32 @@ POST /twitter/_cache/clear
|
||||||
// TEST[setup:twitter]
|
// TEST[setup:twitter]
|
||||||
|
|
||||||
The API, by default, will clear all caches. Specific caches can be cleaned
|
The API, by default, will clear all caches. Specific caches can be cleaned
|
||||||
explicitly by setting `query`, `fielddata` or `request`.
|
explicitly by setting the `query`, `fielddata` or `request` url parameter to `true`.
|
||||||
|
|
||||||
All caches relating to a specific field(s) can also be cleared by
|
[source,js]
|
||||||
specifying `fields` parameter with a comma delimited list of the
|
--------------------------------------------------
|
||||||
relevant fields. Note that the provided names must refer to concrete
|
POST /twitter/_cache/clear?query=true <1>
|
||||||
fields -- objects and field aliases are not supported.
|
POST /twitter/_cache/clear?request=true <2>
|
||||||
|
POST /twitter/_cache/clear?fielddata=true <3>
|
||||||
|
--------------------------------------------------
|
||||||
|
// CONSOLE
|
||||||
|
// TEST[continued]
|
||||||
|
<1> Cleans only the query cache
|
||||||
|
<2> Cleans only the request cache
|
||||||
|
<3> Cleans only the fielddata cache
|
||||||
|
|
||||||
|
In addition to this, all caches relating to a specific field can also be
|
||||||
|
cleared by specifying `fields` url parameter with a comma delimited list of
|
||||||
|
the fields that should be cleared. Note that the provided names must refer to
|
||||||
|
concrete fields -- objects and field aliases are not supported.
|
||||||
|
|
||||||
|
[source,js]
|
||||||
|
--------------------------------------------------
|
||||||
|
POST /twitter/_cache/clear?fields=foo,bar <1>
|
||||||
|
--------------------------------------------------
|
||||||
|
// CONSOLE
|
||||||
|
// TEST[continued]
|
||||||
|
<1> Clear the cache for the `foo` an `bar` field
|
||||||
|
|
||||||
[float]
|
[float]
|
||||||
=== Multi Index
|
=== Multi Index
|
||||||
|
|
Loading…
Reference in New Issue