mirror of
https://github.com/hwchase17/langchain
synced 2024-11-06 03:20:49 +00:00
Correct AzureSearch Vector Store not applying search_kwargs when searching (#6132)
Fixes #6131 Simply passes kwargs forward from similarity_search to helper functions so that search_kwargs are applied to search as originally intended. See bug for repro steps. #### Who can review? @hwchase17 @dev2049 Twitter: poshporcupine
This commit is contained in:
parent
395a2a3724
commit
2286204354
@ -243,11 +243,11 @@ class AzureSearch(VectorStore):
|
|||||||
) -> List[Document]:
|
) -> List[Document]:
|
||||||
search_type = kwargs.get("search_type", self.search_type)
|
search_type = kwargs.get("search_type", self.search_type)
|
||||||
if search_type == "similarity":
|
if search_type == "similarity":
|
||||||
docs = self.vector_search(query, k=k)
|
docs = self.vector_search(query, k=k, **kwargs)
|
||||||
elif search_type == "hybrid":
|
elif search_type == "hybrid":
|
||||||
docs = self.hybrid_search(query, k=k)
|
docs = self.hybrid_search(query, k=k, **kwargs)
|
||||||
elif search_type == "semantic_hybrid":
|
elif search_type == "semantic_hybrid":
|
||||||
docs = self.semantic_hybrid_search(query, k=k)
|
docs = self.semantic_hybrid_search(query, k=k, **kwargs)
|
||||||
else:
|
else:
|
||||||
raise ValueError(f"search_type of {search_type} not allowed.")
|
raise ValueError(f"search_type of {search_type} not allowed.")
|
||||||
return docs
|
return docs
|
||||||
|
Loading…
Reference in New Issue
Block a user