Skip to content

feat(search): add baseBookOnly filter and ancestorCategoryIds indexing - #47

Merged
kdroidFilter merged 2 commits into
devfrom
feat/instant-lucene-filtering-basebook
Jan 25, 2026
Merged

kdroidFilter merged 2 commits into
devfrom
feat/instant-lucene-filtering-basebook

Conversation

@kdroidFilter

Copy link
Copy Markdown
Owner

Summary

  • Add ancestorCategoryIds to Lucene index for instant category filtering
  • Add baseBookOnly parameter to openSession() and computeFacets()
  • Filter by is_base_book directly in Lucene instead of fetching all base book IDs
  • Add getAncestorCategoryIds() to SeforimRepository

Changes

  • SearchEngine.kt: Added baseBookOnly parameter to interface methods
  • LuceneSearchEngine.kt: Implemented is_base_book filter in buildSearchContext()
  • TextIndexWriter.kt: Added ancestorCategoryIds parameter
  • LuceneTextIndexWriter.kt: Store ancestor IDs as IntPoints and StoredField
  • BuildLuceneIndex.kt: Pre-compute and index ancestor category IDs per line
  • SeforimRepository.kt: Added getAncestorCategoryIds() method

Benefits

  • Instant filtering by base books (no DB query for all base book IDs)
  • Instant category filtering via pre-indexed ancestors
  • More efficient facet computation

- Add ancestorCategoryIds to Lucene index for instant category filtering
- Add baseBookOnly parameter to openSession() and computeFacets()
- Filter by is_base_book directly in Lucene instead of fetching all IDs
- Add getAncestorCategoryIds() to SeforimRepository
@kdroidFilter
kdroidFilter changed the base branch from master to dev January 25, 2026 06:40
@kdroidFilter
kdroidFilter marked this pull request as ready for review January 25, 2026 09:55
@kdroidFilter
kdroidFilter merged commit 587ce5e into dev Jan 25, 2026
1 check passed
@kdroidFilter
kdroidFilter deleted the feat/instant-lucene-filtering-basebook branch October 7, 2026 21:04
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