From a6430c0304ca59281e4676e195907bd6391ce5fc Mon Sep 17 00:00:00 2001 From: Stuart Tettemer Date: Thu, 19 Dec 2019 16:16:57 -0700 Subject: [PATCH] [DOCS] Deterministic scripted queries are cached (#50408) Refs: #49321 --- docs/reference/modules/indices/request_cache.asciidoc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/reference/modules/indices/request_cache.asciidoc b/docs/reference/modules/indices/request_cache.asciidoc index 11c8180eb4739..45d46e3a7714d 100644 --- a/docs/reference/modules/indices/request_cache.asciidoc +++ b/docs/reference/modules/indices/request_cache.asciidoc @@ -21,6 +21,9 @@ but it will cache `hits.total`, <>, and <>. Most queries that use `now` (see <>) cannot be cached. + +Scripted queries that use the API calls which are non-deterministic, such as +`Math.random()` or `new Date()` are not cached. =================================== [float] @@ -95,10 +98,6 @@ GET /my_index/_search?request_cache=true ----------------------------- // TEST[continued] -IMPORTANT: If your query uses a script whose result is not deterministic (e.g. -it uses a random function or references the current time) you should set the -`request_cache` flag to `false` to disable caching for that request. - Requests where `size` is greater than 0 will not be cached even if the request cache is enabled in the index settings. To cache these requests you will need to use the query-string parameter detailed here.