Skip to content

Commit 9f5ee52

Browse files
committed
[BUGFIX] Retrieval of aliases fails with newer API versions
The NodeIndexer tries to retrieve the list of index aliases with a GET request like `http://localhost:9200/*/_alias/typo3cr´. However, newer API versions don't seem to support this URL format and fail with a PatternSyntaxException (Dangling meta character '*'). This fix changes the pattern to `http://localhost:9200/_alias/typo3cr` which seems to work with both, newer and older API versions. Tested with Elasticsearch 1.5.2 and 1.7.2.
1 parent 421eb9a commit 9f5ee52

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • Classes/Flowpack/ElasticSearch/ContentRepositoryAdaptor/Indexer

Classes/Flowpack/ElasticSearch/ContentRepositoryAdaptor/Indexer/NodeIndexer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ public function updateIndexAlias()
460460

461461
$aliasActions = array();
462462
try {
463-
$response = $this->searchClient->request('GET', '/*/_alias/' . $aliasName);
463+
$response = $this->searchClient->request('GET', '/_alias/' . $aliasName);
464464
if ($response->getStatusCode() !== 200) {
465465
throw new Exception('The alias "' . $aliasName . '" was not found with some unexpected error... (return code: ' . $response->getStatusCode() . ')', 1383650137);
466466
}
@@ -513,7 +513,7 @@ public function removeOldIndices()
513513
{
514514
$aliasName = $this->searchClient->getIndexName(); // The alias name is the unprefixed index name
515515

516-
$currentlyLiveIndices = array_keys($this->searchClient->request('GET', '/*/_alias/' . $aliasName)->getTreatedContent());
516+
$currentlyLiveIndices = array_keys($this->searchClient->request('GET', '/_alias/' . $aliasName)->getTreatedContent());
517517

518518
$indexStatus = $this->searchClient->request('GET', '/_status')->getTreatedContent();
519519
$allIndices = array_keys($indexStatus['indices']);

0 commit comments

Comments
 (0)