A demo application showcasing hybrid search for e-commerce by combining Elasticsearch (keyword/BM25 search) with Qdrant (vector/semantic search). Uses the H&M product dataset with pre-computed dense embeddings.
- Frontend: Next.js with React and Tailwind CSS
- Backend: FastAPI (Python)
- Search: Elasticsearch 9.0 + Qdrant
- Embeddings: BAAI/bge-small-en-v1.5 (384 dimensions)
docker compose --profile debug up --buildThis starts:
- Elasticsearch (port 9200)
- Kibana (port 5601) - for debugging/visualization
- Qdrant (port 6333)
- Backend API (port 8000)
- Frontend (port 3000)
Note: Omit
--profile debugif you don't need Kibana.
Once the services are healthy, load the product data:
cd scripts
pip install elasticsearch polars
python load_elastic.pyThe script will download the H&M product dataset from Hugging Face and index it into Elasticsearch.
To enable joint search mode (ES + Qdrant with RRF fusion):
export ES_HOST=http://localhost:9200
export ES_USERNAME=elastic
export ES_PASSWORD=changeme
./scripts/migrate_dense_vectors_to_qdrant.shOpen http://localhost:3000 and search for products.
- Elasticsearch: Hybrid search combining BM25 keyword matching with dense vector similarity
- Joint: Queries both Elasticsearch and Qdrant, merges results using Reciprocal Rank Fusion (RRF)
| Variable | Default | Description |
|---|---|---|
ES_PASSWORD |
changeme |
Elasticsearch password |
ES_VERSION |
9.0.0 |
Elasticsearch/Kibana version |
ES_API_KEY |
- | Optional API key for ES auth |
QDRANT_API_KEY |
- | Optional API key for Qdrant |