Skip to content

Commit fdba49e

Browse files
committed
Merge pull request #111 from robertlemke/bugfix-alias-retrieval
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.
2 parents 9e9752d + 9f5ee52 commit fdba49e

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
@@ -462,7 +462,7 @@ public function updateIndexAlias()
462462

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

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

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

0 commit comments

Comments
 (0)