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:
caiyueliang 2024-06-15 08:13:11 +08:00 committed by GitHub
parent 764f1958dd
commit 9944ad7f5f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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(