From a6aa853d228262acb40cd90a0f59f499a86493ac Mon Sep 17 00:00:00 2001 From: dblock Date: Wed, 10 Jul 2024 11:14:43 -0400 Subject: [PATCH] Added missing file query parameter to _cache/clear. Signed-off-by: dblock --- spec/namespaces/indices.yaml | 10 ++++++++ tests/indices/cache.yaml | 45 ++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 tests/indices/cache.yaml diff --git a/spec/namespaces/indices.yaml b/spec/namespaces/indices.yaml index 2bda325dc..a4b909b4d 100644 --- a/spec/namespaces/indices.yaml +++ b/spec/namespaces/indices.yaml @@ -112,6 +112,7 @@ paths: - $ref: '#/components/parameters/indices.clear_cache::query.expand_wildcards' - $ref: '#/components/parameters/indices.clear_cache::query.fielddata' - $ref: '#/components/parameters/indices.clear_cache::query.fields' + - $ref: '#/components/parameters/indices.clear_cache::query.file' - $ref: '#/components/parameters/indices.clear_cache::query.ignore_unavailable' - $ref: '#/components/parameters/indices.clear_cache::query.index' - $ref: '#/components/parameters/indices.clear_cache::query.query' @@ -1160,6 +1161,7 @@ paths: - $ref: '#/components/parameters/indices.clear_cache::query.expand_wildcards' - $ref: '#/components/parameters/indices.clear_cache::query.fielddata' - $ref: '#/components/parameters/indices.clear_cache::query.fields' + - $ref: '#/components/parameters/indices.clear_cache::query.file' - $ref: '#/components/parameters/indices.clear_cache::query.ignore_unavailable' - $ref: '#/components/parameters/indices.clear_cache::query.index' - $ref: '#/components/parameters/indices.clear_cache::query.query' @@ -2763,6 +2765,14 @@ components: schema: $ref: '../schemas/_common.yaml#/components/schemas/Fields' style: form + indices.clear_cache::query.file: + in: query + name: file + description: If true, clears the unused entries from the file cache on nodes with the Search role. + schema: + type: boolean + default: false + style: form indices.clear_cache::query.ignore_unavailable: in: query name: ignore_unavailable diff --git a/tests/indices/cache.yaml b/tests/indices/cache.yaml new file mode 100644 index 000000000..ee57d1df5 --- /dev/null +++ b/tests/indices/cache.yaml @@ -0,0 +1,45 @@ +$schema: ../../json_schemas/test_story.schema.yaml + +description: Test index clear cache. +prologues: + - path: /movies + method: PUT + - path: /games + method: PUT +epilogues: + - path: /movies + method: DELETE + status: [200, 404] + - path: /games + method: DELETE + status: [200, 404] +chapters: + - synopsis: Clear all cache (POST). + path: /_cache/clear + method: POST + parameters: + allow_no_indices: true + expand_wildcards: none + fielddata: true + fields: '*' + file: false + index: + - movies + ignore_unavailable: true + query: true + request: true + response: + status: 200 + payload: + _shards: {} + - synopsis: Clear index cache (POST). + path: /{index}/_cache/clear + method: POST + parameters: + index: + - movies + - games + response: + status: 200 + payload: + _shards: {}