Performs hybrid search combining semantic and text search with RRF.
Hybrid search runs both semantic search (with auto-generated embeddings) and text search (keyword matching) in parallel, then combines results using Reciprocal Rank Fusion (RRF) algorithm for optimal ranking.
hybrid_search(
self,
search_text: str,
search_field: str,
data_field_names: list[str],
k: int = 4,
task_type: str = 'RETRIEVAL_QUERY',
filter_: dict | None = None,
semantic_weight: float = 1.0,
text_weight: float = 1.0,
**kwargs: Any = {}
) -> list[dict[str, Any]]| Name | Type | Description |
|---|---|---|
search_text* | str | Query text used for both semantic and text search. |
search_field* | str | Name of the vector field to search (must have auto-embedding config). |
data_field_names* | list[str] | List of data field names to search in for text search. |
k | int | Default: 4Number of neighbors to return from each search before fusion. |
task_type | str | Default: 'RETRIEVAL_QUERY'Embedding task type for semantic search. |
filter_ | dict | None | Default: NoneOptional filter dict for semantic search only (v2 only). |
semantic_weight | float | Default: 1.0Weight for semantic search results in RRF. |
text_weight | float | Default: 1.0Weight for text search results in RRF. |