UI: Add Documents button does not commit — added docs invisible until manual index.commit #16
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_indexer#16
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
In the hero_indexer admin UI, clicking Add Documents appears to succeed (success alert, opstamp returned), but the documents are not actually visible afterwards: doc count stays the same, queries return the old set, and
db.info/schema.getreflect no growth.Root cause
The
addDocuments()handler in crates/hero_indexer_ui/static/index.html callsdoc.add_batchand stops there:Tantivy holds added documents in the writer's in-memory queue until
commit()is called, and the reader does not see them untilreload()is called against a committed segment. So the RPCdoc.add_batchcorrectly returns an opstamp, but readers (stats, queries, list) keep showing the old state.The Run Performance Test path in the same file does it correctly:
Reproduction
index.committhenindex.reloadvia the API explorer — docs now appear.Proposed fix
After a successful
doc.add_batch, theaddDocuments()UI handler should callindex.commitfollowed byindex.reload, the same way the perf-test flow already does. Alternative: add anauto_commitoption todoc.add/doc.add_batchon the server so the RPC layer always leaves the index in a queryable state for interactive callers.Notes
doc.deleteand any future single-doc add.