Repository navigation
Expose TermsTrie and SuffixTrie on IndexSpec - #10906
Conversation
TermsTrie and SuffixTrie on IndexSpec
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 88a285518f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #10906 +/- ##
==========================================
- Coverage 83.17% 82.18% -0.99%
==========================================
Files 611 635 +24
Lines 81136 82259 +1123
Branches 36374 37497 +1123
==========================================
+ Hits 67485 67608 +123
- Misses 13304 14304 +1000
Partials 347 347
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| unsafe { Dict::from_raw(self.0.missingFieldDict) } | ||
| } | ||
|
|
||
| /// Returns the trie of all TEXT terms. |
There was a problem hiding this comment.
Let's sync this doc comment with the one on terms_mut function.
5dd160f to
06323ab
Compare
88a2855 to
0c853d4
Compare
d05d3e1 to
a6de77b
Compare
Adds the accessors the terms scanner needs to reach an index's tries through a spec guard: shared through the read guard, exclusive through the write one.
a6de77b to
bae3cc7
Compare
|
|
@memark Can I get a re-✅ after rebase? |



Describe the changes in the pull request
IndexSpec'stermsandsuffixtries are only reachable as raw*mut ffi::Triefields. Rust callers that need them — the terms scanner beingported next — would each have to hand-roll the null check, the pointer cast, and
the safety argument that the spec lock is what makes the borrow sound.
terms()onIndexSpecReadGuard, andterms_mut()/suffix_mut()onIndexSpecWriteGuard. They hand back the typedTermsTrie/SuffixTriewrappers introduced in Refactor
CTrieRefintoTermsTrieandSuffixTrie#10886. The suffix accessor returnsOption, since thesuffix trie is only allocated once some field is declared
WITHSUFFIXTRIE.system — shared access through the read guard, exclusive through the write one —
so the aliasing argument lives in one place instead of at every call site. This
unblocks porting the terms scanner without new
unsafein the caller.Which additional issues this PR fixes
Main objects this PR modified
IndexSpecReadGuard— newterms()returning&TermsTrie.IndexSpecWriteGuard— newterms_mut()returning&mut TermsTrie, andsuffix_mut()returningOption<&mut SuffixTrie>.index_speccrate manifest — now depends onc_triefor the two trie wrappers.Mark if applicable
Release Notes