Commit 6b7f730
fix(document): reload stored documents from Tantivy on persistent restart
TantivyDocumentStore::persistent() initialized the in-memory document
HashMap as empty, even though the Tantivy index on disk contained all
previously indexed documents. This caused has_document to report false
after restart despite the data being searchable.
Now scans all segments on open, reading stored fields (id, title, body)
into the HashMap. Same write-through + in-memory cache pattern used by
all other persistent modality stores.
Verified: all 6 octads now show has_document=true, has_semantic=true,
has_provenance=true, version_count=1 after stop/restart cycle.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent f844f1c commit 6b7f730
1 file changed
Lines changed: 44 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
179 | | - | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
180 | 184 | | |
181 | 185 | | |
182 | 186 | | |
| |||
188 | 192 | | |
189 | 193 | | |
190 | 194 | | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
191 | 233 | | |
192 | 234 | | |
193 | 235 | | |
194 | 236 | | |
195 | 237 | | |
196 | | - | |
| 238 | + | |
197 | 239 | | |
198 | 240 | | |
199 | 241 | | |
| |||
0 commit comments