diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/search/80_date_math_index_names.yaml b/rest-api-spec/src/main/resources/rest-api-spec/test/search/80_date_math_index_names.yaml deleted file mode 100644 index 2f2cf6ab982..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/search/80_date_math_index_names.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -"Missing index with catch": - - - do: - catch: /logstash-\d{4}\.\d{2}\.\d{2}/ - search: - index: diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/search/80_indices_options.yaml b/rest-api-spec/src/main/resources/rest-api-spec/test/search/80_indices_options.yaml new file mode 100644 index 00000000000..d3cb5dae846 --- /dev/null +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/search/80_indices_options.yaml @@ -0,0 +1,63 @@ +--- +"Missing index date math with catch": + + - do: + catch: /logstash-\d{4}\.\d{2}\.\d{2}/ + search: + index: + +--- +"Missing index": + + - do: + catch: missing + search: + index: missing_index + + - do: + search: + index: missing_index + ignore_unavailable: true + + - match: {hits.total: 0} + +--- +"Closed index": + + - do: + indices.create: + index: index_closed + + - do: + indices.close: + index: index_closed + + - do: + catch: /index_closed_exception/ + search: + index: index_closed + + - do: + search: + index: index_closed + ignore_unavailable: true + + - match: {hits.total: 0} + + - do: + search: + index: index* + + - match: {hits.total: 0} + + - do: + catch: missing + search: + index: index* + allow_no_indices: false + + - do: + catch: /index_closed_exception/ + search: + index: index* + expand_wildcards: ["open","closed"]