Skip to content

refactor: split suggest query and indexing helpers#88

Merged
marevol merged 1 commit into
masterfrom
refactor/suggest-query-indexing-cleanup
Mar 14, 2026
Merged

refactor: split suggest query and indexing helpers#88
marevol merged 1 commit into
masterfrom
refactor/suggest-query-indexing-cleanup

Conversation

@marevol

@marevol marevol commented Mar 14, 2026

Copy link
Copy Markdown
Contributor

This pull request introduces improvements to the SuggestIndexer class, focusing on safer and more maintainable management of internal operations, as well as some refactoring in the DefaultContentsParser. The changes ensure that internal operation instances are only re-initialized when actually needed (lazy re-initialization), and that methods accessing these operations are protected from stale state. Additionally, tag and role extraction logic in query log parsing has been refactored for clarity and maintainability.

Improvements to operation management in SuggestIndexer:

  • Added an operationsStale flag to track when internal operation instances need re-initialization, and replaced eager re-initialization in setters with a lazy approach using a new ensureOperations() method. Now, operations are only re-initialized when accessed after a configuration change, improving efficiency and thread safety. [1] [2] [3] [4] [5] [6] [7]
  • Updated all public methods in SuggestIndexer that access internal operations to call ensureOperations() first, guaranteeing up-to-date operation state. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20]

Refactoring and maintainability improvements in query log parsing:

  • Refactored tag and role extraction logic in DefaultContentsParser.parseQueryLog to use helper methods (extractTags, extractRolesFromQueryLog), improving code clarity and maintainability.
  • Added missing imports to support new functional and stream-based code in DefaultContentsParser.

Internal API improvements:

  • Changed the signature of several contentOps methods to accept a new ContentIndexingContext object instead of multiple parameters, centralizing context creation and reducing method complexity. [1] [2] [3] [4] [5]

These changes collectively make the codebase safer, more efficient, and easier to maintain.

@marevol marevol merged commit 851dfc0 into master Mar 14, 2026
1 check 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