OpenSearch/rest-api-spec/test/indices.open/20_multiple_indices.yaml
Luca Cavanna 6c23ace68f Fixed open/close index api when using wildcard only
Named wildcards were not always properly replaced with proper values by PathTrie.
Delete index (curl -XDELETE localhost:9200/*) worked anyway as the named wildcard is the last path element (and even if {index} didn't get replaced with '*', the empty string would have mapped to all indices anyway). When the named wildcard wasn't the last path element (e.g. curl -XPOST localhost:29200/*/_close), the variable didn't get replaced with the current '*' value, but with the empty string, which leads to an error as empty index is not allowed by open/close index.

Closes #4564
2014-01-08 15:01:49 +01:00

82 lines
1.1 KiB
YAML

setup:
- do:
indices.create:
index: test_index1
- do:
indices.create:
index: test_index2
- do:
indices.create:
index: test_index3
- do:
cluster.health:
wait_for_status: yellow
---
"All indices":
- do:
indices.close:
index: _all
- do:
catch: forbidden
search:
index: test_index2
- do:
indices.open:
index: _all
- do:
cluster.health:
wait_for_status: yellow
- do:
search:
index: test_index2
---
"Trailing wildcard":
- do:
indices.close:
index: test_*
- do:
catch: forbidden
search:
index: test_index2
- do:
indices.open:
index: test_*
- do:
cluster.health:
wait_for_status: yellow
- do:
search:
index: test_index2
---
"Only wildcard":
- do:
indices.close:
index: '*'
- do:
catch: forbidden
search:
index: test_index3
- do:
indices.open:
index: '*'
- do:
cluster.health:
wait_for_status: yellow
- do:
search:
index: test_index3