Closed chrisribal closed 2 years ago
To allow deleting all indexes using wildcard you must disable the action.destructive_requires_name option.
Maybe this package should read all migrations to enumerate the created indexes and delete it one by one to avoid disabling this safety option? @babenkoivan
Or alternatively disabling the option at runtime (if enabled) and enable back.
@iget-master I'm not sure, if that's also the case for ElasticSearch 7.x. The documentation seems to state, that destructive wildcard queries are allowed by default, but can be disabled.
To delete all indices, use _all or * . To disallow the deletion of indices with _all or wildcard expressions, set the action.destructive_requires_name cluster setting to true. https://www.elastic.co/guide/en/elasticsearch/reference/7.17/indices-delete-index.html
Additionally, i tried adding action.destructive_requires_name=false
into my Laravel Sail's docker-compose.yml, but it's still not working.
Anyway, looping through the existing indices and deleting them one by one would be a better way, i guess. As @babenkoivan seems to be busy, i'll try to submit a PR.
Hi there! It is not very optimal to delete migrations one by one when running tests, that's why this command exists. I'd recommend figuring out why changing the action.destructive_requires_name
config doesn't make any effect, but alternatively, you can run elastic:migrate:refresh
, which does exactly what you want 😉
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days
Describe the bug I tried to start over my elasticsearch migrations by running
php artisan elastic:migrate:fresh
. ElasticSearch responds with the following error:Current behavior NO Index is being freshly migrated, instead Exception is thrown.
Expected behavior ALL Indexes should be freshly migrated.