mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-02 13:08:57 +00:00
community: 'Solve the issue where the _search function in ElasticsearchStore supports passing a query_vector parameter, but the parameter does not take effect. (#21532)
**Issue:** When using the similarity_search_with_score function in ElasticsearchStore, I expected to pass in the query_vector that I have already obtained. I noticed that the _search function does support the query_vector parameter, but it seems to be ineffective. I am attempting to resolve this issue. Co-authored-by: Isaac Francisco <78627776+isahers1@users.noreply.github.com>
This commit is contained in:
parent
764f1958dd
commit
9944ad7f5f
@ -805,7 +805,7 @@ class ElasticsearchStore(VectorStore):
|
||||
if self.query_field not in fields:
|
||||
fields.append(self.query_field)
|
||||
|
||||
if self.embedding and query is not None:
|
||||
if self.embedding and query is not None and query_vector is None:
|
||||
query_vector = self.embedding.embed_query(query)
|
||||
|
||||
query_body = self.strategy.query(
|
||||
|
Loading…
Reference in New Issue
Block a user