fixed duplicat enrichment

This commit is contained in:
2026-06-12 13:35:20 -04:00
parent e9b574aa58
commit 7466c7ed3a
+1 -7
View File
@@ -172,13 +172,7 @@ def fetch_bm25_corpus_records(session: Session) -> list[dict[str, object]]:
EbookSource.author.label("source_author"), EbookSource.author.label("source_author"),
EbookChapter.title.label("chapter_title"), EbookChapter.title.label("chapter_title"),
EbookChunk.page_label.label("page_label"), EbookChunk.page_label.label("page_label"),
func.concat_ws( EbookChunk.search_text.label("bm25_text"),
" ",
EbookSource.title,
EbookSource.author,
EbookChapter.title,
EbookChunk.search_text,
).label("bm25_text"),
) )
.select_from(EbookChunk) .select_from(EbookChunk)
.join(EbookSource, EbookSource.id == EbookChunk.source_id) .join(EbookSource, EbookSource.id == EbookChunk.source_id)