Skip to content

fix(plugin-search): reindex documents published in non-default locales - #17550

Open
PatrikKozak wants to merge 1 commit into
mainfrom
fix/plugin-search-reindex-localized-status
Open

fix(plugin-search): reindex documents published in non-default locales#17550
PatrikKozak wants to merge 1 commit into
mainfrom
fix/plugin-search-reindex-localized-status

Conversation

@PatrikKozak

Copy link
Copy Markdown
Contributor

Reindex now selects and indexes documents based on per-locale publish status, so a document published only in a non-default locale is included.

Since _status is localized whenever a collection has localized fields under localization, a document can be published in de while still draft in en. The reindex handler had three gaps under that model:

  1. Candidate selection filtered on _status: { equals: 'published' } at the default locale, so a document published only in a non-default locale was never selected.
  2. Documents were fetched at the default locale, so each locale's _status was unavailable for per-locale gating.
  3. Every locale of a selected document was synced, so draft locale content could be indexed alongside published content.

The handler now builds the published filter as an or across _status.<locale> for every configured locale, fetches candidates with locale: 'all', and only syncs the locales where the document is actually published.

@github-actions

Copy link
Copy Markdown
Contributor

📦 esbuild Bundle Analysis for payload

This analysis was generated by esbuild-bundle-analyzer. 🤖
This PR introduced no changes to the esbuild bundle! 🙌

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant