purgeOldIndices don't work due to prefix beeing doubled.
ThibautSF opened this issue · 2 comments
Hi,
Each time I call purgeOldIndices, I get a PHP Fatal Error :
Uncaught Elastica\\Exception\\ResponseException: no such index [085476ba4ddd6f761f52520af314195c36b39a5711c27daf5978982311cf8369_085476ba4ddd6f761f52520af314195c36b39a5711c27daf5978982311cf8369_eln_pageattach_2020-11-04-091603]
My index name is eln_pageattach
and my prefix is 085476ba4ddd6f761f52520af314195c36b39a5711c27daf5978982311cf8369
.
As we can see, the prefix is now double, because 085476ba4ddd6f761f52520af314195c36b39a5711c27daf5978982311cf8369_eln_pageattach_2020-11-04-091603
is the real index.
This is caused by getIndex
with real name:
if ($livePassed && $afterLiveCounter > 1) {
// Remove
$this->client->getIndex($realIndexName)->delete();
$operations[] = sprintf('%s deleted.', $realIndexName);
}
Because getIndex always adds the prefix.
Can you try dev-master
? It should have been fixed in 2a67fce.
Thanks!
Indeed.
I made a local override with this commit (while waiting for the next update).
Thanks