silverstripe / addons.silverstripe.org

Website hosting Silverstripe Framework extensions
BSD 3-Clause "New" or "Revised" License
13 stars 16 forks source link

FIX Add overloaded ElasticaService to delete existing indexes before defining them #243

Closed robbieaverill closed 5 years ago

robbieaverill commented 5 years ago

This allows us to change mapping types without having it throw fatal errors on reindexing. This commit can be reverted and have heyday/silverstripe-elastica updated once the upstream PR is merged and tagged.

Hopefully will help for https://github.com/silverstripe/addons.silverstripe.org/issues/241, but needs to be tested on UAT and prod before we can actually close the issue.

The reason why the index mappings are persisting across manual CLI calls to delete the index are a mystery to me, but running this procedurally in the same process should avoid the issue anyway.