Skip to content

Support localized fields with locale-tagged ngrams - #58

Merged
dblock merged 1 commit into
mongoid:masterfrom
dblock:dblock/localized-fields
Oct 17, 2026
Merged

dblock merged 1 commit into
mongoid:masterfrom
dblock:dblock/localized-fields

Conversation

@dblock

@dblock dblock commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Adapt @tomasc’s localized-field proposal from #38, with contributor credit, using one original index collection rather than locale-suffixed collections. Each localized ngram record stores a string locale field; searches filter by I18n.locale and the compound search index begins with locale, ngram, score. Nonlocalized records retain their existing shape.

Evaluate readers, computed methods, filters, and update_if within each configured locale. Replace records per document/locale; remove and destroy across all locales, including locales no longer configured. Cover storage shape, locale isolation and scores, compound-index upgrades, replacement, empty translations, filters, conditions, and locale restoration. UPGRADING.md documents clearing old untagged records and rebuilding. Bump to 0.9.0.

Fixes #33. Supersedes #38. #52 should also land for older-driver empty-collection index creation. Criteria support is separate in #57.

Prepared by an AI on behalf of @dblock.

@dblock
dblock force-pushed the dblock/localized-fields branch from ce6f51b to 7e0eb44 Compare October 17, 2026 02:54
@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Danger Report

No issues found.

View run

@dblock
dblock force-pushed the dblock/localized-fields branch from 7e0eb44 to 7e8e984 Compare October 17, 2026 02:56
@dblock
dblock force-pushed the dblock/localized-fields branch 2 times, most recently from b8cf74c to c896115 Compare October 17, 2026 03:08
@dblock dblock changed the title Support locale-specific indexes for localized fields Support localized fields with locale-tagged ngrams Oct 17, 2026
@dblock
dblock force-pushed the dblock/localized-fields branch from c896115 to a4bff2a Compare October 17, 2026 03:12
Adapt the localized-fields proposal from @tomasc in mongoid#38. Keep locale suffixes stable, evaluate readers and filters within each locale, and update creation/removal/reindexing consistently.

Co-authored-by: Tomas Celizna <tomas.celizna@gmail.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dblock
dblock force-pushed the dblock/localized-fields branch from a4bff2a to da7e085 Compare October 17, 2026 03:23
@dblock
dblock merged commit 7cdd312 into mongoid:master Oct 17, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for Mongoid localized fields

1 participant