Skip to content

feat(searchindex): author docs in the lookup index, drop dead TOC docs - #109

Merged
kdroidFilter merged 1 commit into
masterfrom
feat/lookup-authors
Oct 8, 2026
Merged

kdroidFilter merged 1 commit into
masterfrom
feat/lookup-authors

Conversation

@kdroidFilter

Copy link
Copy Markdown
Owner

What

  • Lookup index: one type=author doc per author with author_id, stored author_name, book_count (stored + doc values) and q = name + aliases (raw and sanitized like book acronyms). Docs carry the same point/doc-value structures as book docs for the index-sort fields.
  • SeforimRepository.getAuthorsForLookup() (+ selectAllWithBookCount, selectAllAliases).
  • Removed addToc and the TOC lookup docs.

Why drop the TOC docs

They never made it into the index: their is_base_book / order_index fields had doc values but no points, unlike book docs, so Lucene threw "Inconsistency of field data structures across documents" on every one, swallowed by runCatching. The production lookup index has 7349 book docs and 0 TOC docs, and the app's searchTocPrefix has no caller. The ref resolver of the search redesign will read TOC/heRef from SQLite instead.

Verification

  • ./gradlew :searchindex:jvmTest :dao:jvmTest: new test indexes authors next to a book and checks prefix search on an alias, ranked by book count.
  • Production index probed: type:book = 7349, type:toc = 0.

🤖 Generated with Claude Code

Add a TYPE_AUTHOR doc per author (name + aliases, raw and sanitized,
book_count doc values to rank them), from the new getAuthorsForLookup.

Remove the TOC lookup docs: their is_base_book / order_index fields
lacked the points the book docs have, so Lucene rejected every one and
the surrounding runCatching hid it; the shipped lookup index holds 7349
books and 0 TOC entries, and the app never queried them.

Signed-off-by: Elie Gambache <elyahou.hadass@gmail.com>
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