From 7cc3ac0fc475f8beecd4a426a20ec11fcf8c49c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20B=C3=BCscher?= Date: Fri, 19 Oct 2018 00:44:37 +0200 Subject: [PATCH] [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 --- docs/reference/indices/clearcache.asciidoc | 30 ++++++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/docs/reference/indices/clearcache.asciidoc b/docs/reference/indices/clearcache.asciidoc index 6b90f9d49cb..6f9c06bd729 100644 --- a/docs/reference/indices/clearcache.asciidoc +++ b/docs/reference/indices/clearcache.asciidoc @@ -12,12 +12,32 @@ POST /twitter/_cache/clear // TEST[setup:twitter] 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 -specifying `fields` parameter with a comma delimited list of the -relevant fields. Note that the provided names must refer to concrete -fields -- objects and field aliases are not supported. +[source,js] +-------------------------------------------------- +POST /twitter/_cache/clear?query=true <1> +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] === Multi Index