Add hybrid-search module: vector, tsvector and BM25 fused with Reciprocal Rank Fusion in Java and SQL over one PostgreSQL table; quality by query type, held-out k check, plans and latency at 50k rows

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0146opDKBYtADXvkc39zdiyw
This commit is contained in:
Claude
2026-10-22 18:04:49 +00:00
parent d7e68a14af
commit 2ccf1d8d19
26 changed files with 1508 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
# hybrid-search
Companion code for [Hybrid Search in Java: BM25 + Vector with PostgreSQL and Reciprocal Rank Fusion](https://ankurm.com/hybrid-search-java-pgvector-tsvector-reciprocal-rank-fusion/).
One PostgreSQL table holds a `vector(384)` column (pgvector, HNSW) and a generated `tsvector` column (GIN). Vector search, keyword search and Reciprocal Rank Fusion are measured on 94 passages and 60 questions in four kinds. Spring Boot 4.1.2, Spring AI 2.0.2, Java 25.
Run `scripts/run-all.sh` (needs PostgreSQL 16 with pgvector; see the script header). Every number in the article is a line in `output/`.