You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 13, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Dec 13, 2023. It is now read-only.
Currently, there is no functionality in the Payload Search Plugin to force reindexing of collections. This means that if there are changes in the related data, such as a change in the name of a category, the search index will not be automatically updated. To ensure that the search index reflects the updated data, a manual reindexing feature needs to be implemented.
Proposal:
I propose adding a new feature to the Payload Search Plugin that allows users to force reindexing of collections. This feature would trigger the reindexing process for a specific collection or for all enabled collections. Enabeling this option in de plugin config and adding in the admin UI an interface to run the sync with error handling and logging mechanisms to handle any issues that may occur during the reindexing process.
With this new feature, users will have the ability to manually trigger reindexing of collections, ensuring that any changes in related data are reflected in the search results.
This is also an handy feature when this plugin is later added to a large collection. (we now have to manual update each item 80+)
Hey @matthijs166 yep I see what you mean. Because this plugin should not rely on relationships by design, your search documents are not always up-to-date. This means you'd have to navigate into an already indexed page and resave it. Is this what you're experiencing? This sounds like a great feature. Here's how we'd probably implement it:
render a custom button on the list view of each search-enabled collection
add a custom endpoint that this button can hit
iterate through every search document and query its parent doc for fresh data
Hey @matthijs166 yep I see what you mean. Because this plugin should not rely on relationships by design, your search documents are not always up-to-date. This means you'd have to navigate into an already indexed page and resave it. Is this what you're experiencing?
Yes, that's exactly right!
This sounds like a great feature. Here's how we'd probably implement it:
render a ....
This sounds like a great solution. Maybe we can implement a progress bar to, so that we can see the progress.
An intern API would also be awesome: An function to pass a list of ID's to reindex. Handy to implement direct sync with a hook. For example, I'm updating a categorie and in the afterChange hook fetch all dependent items and sync them with this function.
The API endpoint can also be used for cronjobs, maybe a cool idea to add it in the docs.
This plugin is now being maintained in the Packages Directory of the Payload Monorepo. This repo will soon be archived and all open issues including this one will be closed. This issue has already been added to this open discussion, though, so that it will not get lost. Please refer to that discussion for more details and to continue the conversation.
Activity
[-]Force Reindex Collections[/-][+]feat: Force Reindex Collections[/+]jacobsfletch commentedon Jul 10, 2023
Hey @matthijs166 yep I see what you mean. Because this plugin should not rely on relationships by design, your search documents are not always up-to-date. This means you'd have to navigate into an already indexed page and resave it. Is this what you're experiencing? This sounds like a great feature. Here's how we'd probably implement it:
beforeSynchookWhat do you think?
matthijs166 commentedon Jul 11, 2023
Yes, that's exactly right!
This sounds like a great solution. Maybe we can implement a progress bar to, so that we can see the progress.
An intern API would also be awesome: An function to pass a list of ID's to reindex. Handy to implement direct sync with a hook. For example, I'm updating a categorie and in the afterChange hook fetch all dependent items and sync them with this function.
The API endpoint can also be used for cronjobs, maybe a cool idea to add it in the docs.
jacobsfletch commentedon Dec 13, 2023
This plugin is now being maintained in the Packages Directory of the Payload Monorepo. This repo will soon be archived and all open issues including this one will be closed. This issue has already been added to this open discussion, though, so that it will not get lost. Please refer to that discussion for more details and to continue the conversation.