Search API
Perform high-speed similarity search across vector collections with advanced filtering options.
Vector Similarity Search
POST
/api/v1/collections/{collection_name}/search
Search Parameters
Parameter | Type | Description | Default |
---|---|---|---|
query_vectors | array | Vectors to search for | required |
top_k | integer | Number of results to return | 10 |
metric_type | string | Distance metric (L2, IP, COSINE) | L2 |
filter | string | Boolean expression for filtering | null |
Example Search
{
"query_vectors": [[0.1, 0.2, 0.3, 0.4]],
"top_k": 5,
"metric_type": "L2",
"filter": "category == 'text' AND score > 0.8",
"output_fields": ["id", "metadata", "score"]
}
Search Strategies
Exact Search
Find the most similar vectors with highest precision
Approximate Search
Trade accuracy for speed using approximate algorithms
Filtered Search
Combine vector similarity with metadata filtering