feat(plugin-search): reindex collections #9391
Open
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.
What?
This PR aims to add reindexing capabilities to
plugin-search
to allow users to reindex entire searchable collections on demand.Why?
As it stands, end users must either perform document reindexing manually one-by-one or via bulk operations. Both of these approaches are undesirable because they result in new versions being published on existing documents. Consider the case when
plugin-search
is only added after the project has started and documents have been added to existing collections. It would be nice if users could simply click a button, choose the searchable collections to reindex, and have the custom endpoint handle the rest.How?
This PR adds on to the existing plugin configuration, creating a custom endpoint and a custom
beforeListTable
component in the form of a popup button. Upon clicking the button, a dropdown/popup is opened with options to select which collection to reindex, as well as a usefulAll Collections
option to run reindexing on all configured search collections. It also adds areindexBatchSize
option in the config to allow users to specify in what quantity to batch documents to sync with search.Big shoutout to @paulpopus for the triple-A level support on this one!
Fixes #8902
See it in action:
chrome_2024-11-12_12-18-13.mp4
Notes: