Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a PR originally opened at https://www.drupal.org/project/elasticsearch_helper/issues/2994689, updated to work with version 7. Squashing is probably a good idea, the Git history is a bit of a mess due to first applying the 5.x verison of the patch.
Problem/Motivation
In some cases it may be beneficial to be able to disable search indexes. For example, we have a use case where our elastic search provider is requesting us to do a nightly re-index on a separate index, that will be swapped for the active index when reindexing is complete. In order to keep the index defined, but not have it updated during the day, we wish to disable it except when the time comes to do the nightly rebuild.Proposed resolution
Introduce a configuration key that keeps a status per index.Remaining tasks
Provide patchUser interface changes
A series of checkboxes will be introduced in the settings form.API changes
A method will be made available on the plugin manager to check the status of an index.Data model changes
No backwards incompatible changes. The proposed patch treats indexes that were not explicitly enabled or disabled in settings as enabled by default.