Skip to main content
Version: Next
milvus_searchINPUTBUFFERPROCESSOROUTPUT

Milvus Search

The milvus_search processor searches a Milvus collection (2.4+, REST v2) for the top-k nearest neighbors of each row's vector and appends the matches as a JSON array text column. Like the Qdrant and pgvector search processors, rows are searched with one REST request per row (a single-element query array) under bounded, order-preserving concurrency. Pair it with the embedding processor and the Milvus output, which writes the same field shape this processor reads.

Configuration​

FieldTypeRequiredDefaultDescription
typestringyes—milvus_search
urlstringyes—Milvus base URL (e.g. http://localhost:19530).
collectionstringyes—Collection to search.
vector_fieldstringnoembeddingBatch column holding the query vector (FixedSizeList/List of Float32).
target_fieldstringnomatchesName of the appended matches column.
id_fieldstringno—Collection field returned as the match id. Omit for auto-id collections.
payload_fieldstringnopayloadCollection field included in each match as a payload object. Set to "" to disable.
metricstringnoCOSINEMetric type (COSINE, L2, IP); must match the collection schema.
top_kintegerno5Number of neighbors per row.
api_keystringno—Sent as Authorization: Bearer (Milvus convention: <user>:<password>). Supports secret references.
timeout_msintegerno30000HTTP request timeout.
concurrencyintegerno4Maximum in-flight search requests.
headersmapno—Extra HTTP headers.

Result shape​

Matches are normalized to the same keys as the other search processors — id (when id_field is configured), distance (Milvus's raw value), and payload (the configured field's object):

[{"id": 42, "distance": 0.12, "payload": {"text": "..."}}]
note

Failures (HTTP errors, Milvus code != 0, result groups not matching the input row count, null/empty query vectors) fail the batch into error_output. The processor does not retry. Requests to loopback endpoints always bypass the system proxy.

Example​

- type: "milvus_search"
url: "http://localhost:19530"
collection: "documents"
vector_field: "embedding"
id_field: "doc_id"
metric: "COSINE"
top_k: 5

Complete RAG Query Pipeline​

logging:
level: info

streams:
- id: milvus-rag-query
input:
type: memory
pipeline:
thread_num: 4
processors:
- type: json_to_arrow
- type: embedding
api_base: "http://localhost:9997/v1"
model: "text-embedding-3-small"
api_key: "${env:OPENAI_API_KEY:-}"
field: "text"
- type: milvus_search
url: "http://localhost:19530"
collection: "documents"
id_field: "doc_id"
top_k: 5
output:
type: stdout