Search
Payload for hybrid search operations. Can be constructed by directly providing the parameters, or by using the builder pattern. Methods__init__(), group_by(), limit(), rank(), select(), select_all(), to_dict(), where()
Select
Selection configuration for search results. Fields can be:- Key.DOCUMENT - Select document key (equivalent to Key(“#document”))
- Key.EMBEDDING - Select embedding key (equivalent to Key(“#embedding”))
- Key.SCORE - Select score key (equivalent to Key(“#score”))
- Any other string - Select specific metadata property
Set[Union[Key, str]]
__init__(), from_dict(), to_dict()
Knn
KNN-based ranking expression. PropertiesOptional[Embeddings]
Union[Key, str]
int
Optional[float]
bool
__init__(), abs(), exp(), from_dict(), log(), max(), min(), to_dict()
Rrf
Reciprocal Rank Fusion for combining ranking strategies. RRF formula: score = -sum(weight_i / (k + rank_i)) for each ranking strategy The negative is used because RRF produces higher scores for better results, but Chroma uses ascending order (lower scores = better results). PropertiesList[Rank]
int
Optional[List[float]]
bool
__init__(), abs(), exp(), from_dict(), log(), max(), min(), to_dict()
Group By
GroupBy
Group results by metadata keys and aggregate within each group. Groups search results by one or more metadata fields, then applies an aggregation (MinK or MaxK) to select records within each group. The final output is flattened and sorted by score. PropertiesUnion[Key, str, List[Union[Key, str]]]
Optional[Aggregate]
__init__(), from_dict(), to_dict()
Limit
Limit(offset: int = 0, limit: Optional[int] = None) Propertiesint
Optional[int]
__init__(), from_dict(), to_dict()
MinK
Keep k records with minimum aggregate key values per group PropertiesUnion[Key, str, List[Union[Key, str]]]
int
__init__(), from_dict(), to_dict()
MaxK
Keep k records with maximum aggregate key values per group PropertiesUnion[Key, str, List[Union[Key, str]]]
int
__init__(), from_dict(), to_dict()
SearchResult
Column-major response from the search API. Searches are performed in batches. Each batch is a list of records in columnar form.List[IDs]
List[Optional[List[Optional[str]]]]
List[Optional[List[Optional[List[float]]]]]
List[Optional[List[Optional[Dict[str, Any]]]]]
List[Optional[List[Optional[float]]]]
List[IDs]
rows()