Skip to content

Decouple HybridIndex from BaseInvertedIndex internals - #85

Merged
drametwally merged 4 commits into
mainfrom
hybrid-index-cleanup
Oct 1, 2026
Merged

drametwally merged 4 commits into
mainfrom
hybrid-index-cleanup

Conversation

@drametwally

@drametwally drametwally commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Move popularity discard rules into PopularTermDiscardPolicy (same algorithm and config keys as before).
  • Add InvertedHybridConfiguration for the shared term-keying cutoff (still 270; SignatureIndex.NUM_SIGNATURES_PER_ROW aliases it).
  • HybridIndex uses those types instead of BaseInvertedIndex.discardedTermsOf and package methods on TermIndex.

No search-path or index-build logic changes: hybrid still partitions rows the same way, passes the same discard set into TermIndex, and keeps the same maySearchIndex orchestration.

Behavior and performance

  • Refactor only: discard computation is lifted unchanged from BaseInvertedIndex; cutoff constant value unchanged.
  • Hybrid construction reads max_fraction_ids_per_term once for discards and for termPopularityFilteringEnabled (same count as before via discardedTermsOf(namespaceConfig, …) plus termIndex.discardsPopularTerms() reading the child field).
  • Query/update hot paths are untouched.

Test plan

  • bazel test //:test_main
  • PopularTermDiscardPolicyTest (discard threshold)
  • Existing HybridIndexTest coverage unchanged

PopularTermDiscarding centralizes popularity thresholds and discarded-term
computation for term-keyed partitions. InvertedHybridConfiguration holds the
shared term-keying cutoff; HybridIndex reads discard policy from config rather
than package methods on TermIndex.
Matches the prior number of config reads when building a hybrid index.
Use LongTermsAndValuesTestFactory because the entity constructor is
package-private to com.uber.ussi.entity.termsandvalues.
@drametwally
drametwally merged commit a8b4153 into main Oct 1, 2026
3 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