Repository navigation
feat(searchindex): author docs in the lookup index, drop dead TOC docs - #109
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
type=authordoc per author withauthor_id, storedauthor_name,book_count(stored + doc values) andq= 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).addTocand the TOC lookup docs.Why drop the TOC docs
They never made it into the index: their
is_base_book/order_indexfields had doc values but no points, unlike book docs, so Lucene threw "Inconsistency of field data structures across documents" on every one, swallowed byrunCatching. The production lookup index has 7349 book docs and 0 TOC docs, and the app'ssearchTocPrefixhas 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.type:book= 7349,type:toc= 0.🤖 Generated with Claude Code