MongoDBAtlasHybridSearchRetriever(
self,
*,
vectorstore: MongoDBAtlasVectorSearch,
search_index_name: str,
k: | Name | Type | Description |
|---|---|---|
vectorstore* | MongoDBAtlasVectorSearch | MongoDBAtlasVectorSearch instance. |
search_index_name* | str | Atlas Search Index (full-text) name. |
k | int | Default: 4Number of documents to return. Defaults to 4. |
oversampling_factor | int | Default: 10 |
pre_filter | Optional[Dict[str, Any]] | Default: None |
post_filter | Optional[List[Dict[str, Any]]] | Default: None |
vector_penalty | float | Default: 60.0 |
fulltext_penalty | float | Default: 60.0 |
vector_weight | float | Default: 1.0 |
fulltext_weight | float | Default: 1.0 |
show_embeddings | float | Default: False |
top_k | Optional[int] | Default: None |
auto_create_index | bool | Default: True |
auto_index_timeout | int | Default: 15 |
vector_index_options* | unknown | |
**kwargs | Any | Default: {} |
| Name | Type |
|---|---|
| vectorstore | MongoDBAtlasVectorSearch |
| search_index_name | str |
| k | int |
| oversampling_factor | int |
| pre_filter | Optional[Dict[str, Any]] |
| post_filter | Optional[List[Dict[str, Any]]] |
| vector_penalty | float |
| fulltext_penalty | float |
| vector_weight | float |
| fulltext_weight | float |
| show_embeddings | float |
| top_k | Optional[int] |
| auto_create_index | bool |
| auto_index_timeout | int |
Hybrid Search Retriever combines vector and full-text searches weighting them the via Reciprocal Rank Fusion (RRF) algorithm.
Increasing the vector_penalty will reduce the importance on the vector search. Increasing the fulltext_penalty will correspondingly reduce the fulltext score. For more on the algorithm,see https://learn.microsoft.com/en-us/azure/search/hybrid-search-ranking
This times k is the number of candidates chosen at each step. Defaults to 10.
(Optional) Any MQL match expression comparing an indexed field.
(Optional) Pipeline of MongoDB aggregation stages for postprocessing.
Penalty applied to vector search results in RRF: scores=1/(rank + penalty). Defaults to 60.0.
Penalty applied to full-text search results in RRF: scores=1/(rank + penalty). Defaults to 60.0.
Weight applied to vector search results in RRF: score = weight * (1 / (rank + penalty + 1)). Defaults to 1.0.
Weight applied to full-text search results in RRF: score = weight * (1 / (rank + penalty + 1)). Defaults to 1.0.
If true, returned Document metadata will include vectors. Defaults to False.
(Deprecated) Number of documents to return. Use k instead.
Whether to automatically create the full-text search index if it does not exist. Defaults to True.
How long to wait for the automatic index creation to complete, in seconds. Defaults to 15.
Unused; kept for backward compatibility. Defaults to None.
Additional keyword arguments.