Skip to content

Extract ngram calculation and index-definition planning - #60

Merged
dblock merged 1 commit into
mongoid:masterfrom
dblock:dblock/maintainability
Oct 17, 2026
Merged

dblock merged 1 commit into
mongoid:masterfrom
dblock:dblock/maintainability

Conversation

@dblock

@dblock dblock commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Follow the maintainability direction of @tomasc’s #40 with a focused, behavior-preserving refactor on current master.

Extract ngram normalization, sampling, and scoring into a persistence-independent helper with named steps. Keep the public model all_ngrams method as its delegating entry point. Extract compound search-key construction and obsolete-index selection into a pure definition planner; keep driver operations and Mongoid hooks in place. Preserve shared-model filter unions, locale-tagged storage, arrays, Unicode alphabets, bulk inserts, timeout options, and criteria support.

Add unit specs runnable without MongoDB and a model-entry-point delegation regression. Exact outputs for 9,984 input/configuration combinations match the pre-refactor baseline. All 143 examples pass locally. No migration or index rebuild is required.

Credit to @tomasc for the original extraction proposal, recorded in the commit coauthor. Supersedes the remaining refactoring scope of #40 without introducing its obsolete compatibility or storage changes.

Prepared by an AI on behalf of @dblock.

@dblock
dblock force-pushed the dblock/maintainability branch from 9f57409 to 55acc5a Compare October 17, 2026 03:43
@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Danger Report

No issues found.

View run

@dblock dblock mentioned this pull request Oct 17, 2026
Follow the maintainability direction proposed by @tomasc in mongoid#40 without changing model APIs, locale storage, scoring, or Mongoid driver hooks.

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/maintainability branch from 55acc5a to 1607fe0 Compare October 17, 2026 11:24
@dblock
dblock merged commit 3b6647a 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.

1 participant