Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
3 changed files
with
115 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters