Skip to content

Commit a130776

Browse files
use expand_wildcards all for CAT (indices and aliases)
1 parent 9dcb20d commit a130776

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/Controller/ElasticsearchCatController.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ public function index(Request $request): Response
6666
if ('nodes' == $catModel->getCommand()) {
6767
$query['full_id'] = 'true';
6868
}
69+
if (true === $catModel->useExpandWildcard() && true === $this->callManager->hasFeature('cat_expand_wildcards')) {
70+
$query['expand_wildcards'] = 'all';
71+
}
6972
$callRequest = new CallRequestModel();
7073
$callRequest->setPath('/_cat/'.$catModel->getCommandReplace());
7174
$callRequest->setQuery($query);

src/Model/ElasticsearchCatModel.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,4 +140,10 @@ public function getCommandHelp(): ?string
140140

141141
return $command;
142142
}
143+
144+
public function useExpandWildcard()
145+
{
146+
$commands = ['aliases', 'aliases/{alias}', 'indices', 'indices/{index}'];
147+
return in_array($this->getCommand(), $commands);
148+
}
143149
}

0 commit comments

Comments
 (0)