hybrid_search
Search vector collections using similarity and scalar filters, then rerank combined results with a chosen strategy to return relevant entities.
Instructions
Search for entities based on vector similarity and scalar filtering and rerank the results using a specified strategy.
Args:
cluster_id: ID of the cluster
region_id: ID of the cloud region hosting the cluster
collection_name: The name of the collection to which this operation applies
search_requests: List of search parameters for different vector fields. Each search request should contain:
- data: A list of vector embeddings
- annsField: The name of the vector field
- filter: A boolean expression filter (optional)
- groupingField: The name of the field that serve as the aggregation criteria (optional)
- metricType: The metric type (L2, IP, COSINE) (optional)
- limit: The number of entities to return
- offset: The number of entities to skip (optional, default: 0)
- ignoreGrowing: Whether to ignore entities in growing segments (optional, default: false)
- params: Extra search parameters with radius and range_filter (optional)
rerank_strategy: The name of the reranking strategy (rrf, weighted)
rerank_params: Parameters related to the specified strategy (e.g., {"k": 10} for rrf)
limit: The total number of entities to return. The sum of this value and offset should be less than 16,384
db_name: The name of the database. Pass explicit dbName or leave empty when cluster is free or serverless
partition_names: The name of the partitions to which this operation applies
output_fields: An array of fields to return along with the search results
consistency_level: The consistency level of the search operation (Strong, Eventually, Bounded)
Returns:
Dict containing the hybrid search results
Example:
{
"code": 0,
"cost": 0,
"data": [
{
"book_describe": "book_105",
"distance": 0.09090909,
"id": 450519760774180800,
"user_id": 5,
"word_count": 105
}
]
}Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"cluster_id": "<cluster_id>",
"region_id": "<region_id>",
"collection_name": "<collection_name>",
"search_requests": "<search_requests>",
"rerank_strategy": "<rerank_strategy>",
"rerank_params": "<rerank_params>",
"limit": "<limit>"
},
"name": "hybrid_search"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | Yes | ||
| db_name | No | ||
| region_id | Yes | ||
| cluster_id | Yes | ||
| output_fields | No | ||
| rerank_params | Yes | ||
| collection_name | Yes | ||
| partition_names | No | ||
| rerank_strategy | Yes | ||
| search_requests | Yes | ||
| consistency_level | No |