Milvus Hybrid Search: BM25 Keyword Recall, Dense Vectors, and Cross-Encoder Reranking in One Schema
Milvus now handles the entire retrieval stack natively, from embedding and BM25 indexing to Cross-Encoder rerank, so a small app gets hybrid search with a few schema functions instead of wiring external services together.
Milvus's Function API turns a knowledge base into a retrieval pipeline without explicit embedding calls. A schema declares two functions on one content field: TEXTEMBEDDING sends text to DashScope's text-embedding-v3 for a 1024-dim dense vector, and BM25 produces a sparse keyword vector locally, no external model involved. Both vectors are generated automatically at insert and query time, so application code only ever writes the raw content and scalar fields.
A hybrid_search call makes two AnnSearchRequests, one per vector field, each recalling fetch_k candidates. A RERANK function backed by a Cross-Encoder model (qwen3.7-text-rerank) reads the query against candidate content and returns the top_k results. The full walkthrough covers deploying Milvus on a BaoTa server with Docker Compose, Attu admin setup, credential configuration, and PyMilvus code that enables Chinese tokenization on the content field and caps rerank candidates at 5 per batch.
Having Milvus generate both vector types from one content field removes the classic two-embedding-pipeline maintenance burden; the database owns indexing and recall.
The reranker runs at query time on candidate text, which is the practical difference from a bi-encoder: relevance is recomputed jointly rather than pre-computed into vectors, buying precision at the cost of latency.
The example targets a specific Chinese deployment path (BaoTa server plus DashScope credentials), so it is a ready reference for Milvus users on Alibaba Cloud tooling but less portable to other embedding providers without rework.
Looking for an independent developer to build a custom TikTok women's fashion AI material pipeline: needs 3D fingerprint deduplication (image + text + shot timing), ComfyUI batch image generation, data feedback and scoring loop, deliverable source code — not a Codex node package. Anyone who has done similar projects, DM me with case studies.
[striking emoji]
?
Also waiting for cost-effective generation APIs~ If there's a later need for batch video material production, the MiniMax H3 API is worth referencing: cloud-based calls, built-in stereo sound, reference billing around 0.3 yuan/minute, suitable for running at scale. Features and pricing subject to official announcements.