hybrid_search
Search vector databases by combining semantic similarity with structured filters, then refine results using ranking strategies to retrieve relevant data.
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
endpoint: The cluster endpoint URL. Can be obtained by calling describe_cluster and using the connect_address field
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
}
]
}
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cluster_id | Yes | ||
| region_id | Yes | ||
| endpoint | Yes | ||
| collection_name | Yes | ||
| search_requests | Yes | ||
| rerank_strategy | Yes | ||
| rerank_params | Yes | ||
| limit | Yes | ||
| db_name | No | ||
| partition_names | No | ||
| output_fields | No | ||
| consistency_level | No |