Files
..

hybrid-search

Companion code for Hybrid Search in Java: BM25 + Vector with PostgreSQL and 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/.