reciprocal_rank_stage#
- langchain_mongodb.pipelines.reciprocal_rank_stage(
- score_field: str,
- penalty: float = 0,
- **kwargs: Any,
Stage adds Reciprocal Rank Fusion weighting.
First, it pushes documents retrieved from previous stage into a temporary sub-document. It then unwinds to establish the rank to each and applies the penalty.
- Parameters:
score_field (str) – A unique string to identify the search being ranked
penalty (float) – A non-negative float.
extra_fields – Any fields other than text_field that one wishes to keep.
kwargs (Any)
- Returns:
RRF score
- Return type:
List[Dict[str, Any]]