Skip to content

Fix stale Spotlight results for posts and sites - #25990

Open
crazytonyli wants to merge 3 commits into
trunkfrom
task/spotlight-index-fixes
Open

Fix stale Spotlight results for posts and sites#25990
crazytonyli wants to merge 3 commits into
trunkfrom
task/spotlight-index-fixes

Conversation

@crazytonyli

Copy link
Copy Markdown
Contributor

Description

To reproduce the issues, index a post and then edit it, permanently delete it, or remove its site. Spotlight can retain the old result.

This PR:

  1. Reindexes posts after every successful save.
  2. Removes Spotlight items after explicit deletion and when sync finds that a post was deleted from the server.
  3. Removes a site's Spotlight domain when the user removes the site or server sync prunes it. Blog.searchDomain provides the shared domain identifier.

Testing instructions

  • Publish a post and find it in Spotlight.
  • Edit its title, save it, and verify the Spotlight result updates.
  • Permanently delete the post and verify the result disappears.
  • Remove one site from a multi-site account and verify its results disappear while the other sites remain.

Spotlight indexing ran only when a post moved to scheduled or
published, so title and content edits to an existing post left a stale
entry until the Posts list reloaded. Index the post after every
successful save.
Trashing a post removed its Spotlight item, but permanently deleting
one did not, so the stale result kept opening the app to nothing.
Remove the item by identifier after the deletion succeeds.
Removing a site cleared Spotlight only when no account remained, so on
a multi-site account the removed site's posts stayed searchable and
opened the app to nothing. Delete the site's Spotlight domain when the
user removes it and when account sync prunes it. The domain rule moves
to Blog so posts and this cleanup share it.
@dangermattic

Copy link
Copy Markdown
Collaborator
1 Message
📖 This PR is still a Draft: some checks will be skipped.

Generated by 🚫 Danger

@crazytonyli
crazytonyli requested a review from jkmassel September 3, 2026 23:41
@crazytonyli crazytonyli added this to the 27.3 milestone Sep 3, 2026
@crazytonyli
crazytonyli marked this pull request as ready for review September 3, 2026 23:41
@wpmobilebot

Copy link
Copy Markdown
Contributor
App Icon📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress
ConfigurationRelease-Alpha
Build Number34371
VersionPR #25990
Bundle IDorg.wordpress.alpha
Commit439a684
Installation URL1esp947asv7o8
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot

Copy link
Copy Markdown
Contributor
App Icon📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack
ConfigurationRelease-Alpha
Build Number34371
VersionPR #25990
Bundle IDcom.jetpack.alpha
Commit439a684
Installation URL592st7effv8f0
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants