Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added missing file query parameter to _cache/clear. #396

Merged
merged 2 commits into from
Jul 11, 2024
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Added `doc_status`, `remote_store`, `segment_replication` and `unreferenced_file_cleanups_performed` to `SegmentStats` ([#395](https://github.com/opensearch-project/opensearch-api-specification/pull/395))
- Added `concurrent_query_*` and `search_idle_reactivate_count_total` fields to `SearchStats` ([#395](https://github.com/opensearch-project/opensearch-api-specification/pull/395))
- Added `remote_store` to `TranslogStats` ([#395](https://github.com/opensearch-project/opensearch-api-specification/pull/395))
- Added `file` to `/_cache/clear` and `/{index}/_cache/clear` ([#396](https://github.com/opensearch-project/opensearch-api-specification/pull/396))

### Changed

Expand Down
10 changes: 10 additions & 0 deletions spec/namespaces/indices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand Down
45 changes: 45 additions & 0 deletions tests/indices/cache.yaml
Original file line number Diff line number Diff line change
@@ -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: {}
Loading