alleyinteractive / alleyinteractive/searchpress

When terms get updated, reindex affected posts asynchronously

Open
#40 1 comment 0 reactions 1 assignee Claimed by @mboynes View on GitHub
enhancement
Dominant language
PHP
Stars
85
Forks
10
PR merge metrics
No merged PRs in 30d

Description

Likely requires: https://github.com/alleyinteractive/searchpress/pull/98

When a term is updated (and, that update impacts term data stored with posts, which OOTB includes the `slug`, `name`, and `parent`), an async task should kick off which loops through all posts in the term and reindexes them. Note that a term could have any number of posts (thousands, even millions!), so care must be taken to do this as efficiently as possible.

## Implementation Notes

After #98, that async task could simply update the post meta to flag that the post needs reindexing, and a separate indexing task will handle that process. However, that ultimately requires querying for each post twice: the first time via term, and the second via post meta. It might make more sense to reindex the post in the same async process that queries for the posts in the updated term, although that would likely be less DRY.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.