Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions elasticsearch/helpers/vectorstore/_async/vectorstore.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,11 @@ def __init__(
# client.options preserves existing (non-user-agent) headers.
client = client.options(headers={"User-Agent": user_agent})

if hasattr(retrieval_strategy, "text_field"):
if (
hasattr(retrieval_strategy, "text_field")
and retrieval_strategy.text_field is None
):
retrieval_strategy.text_field = text_field
if hasattr(retrieval_strategy, "vector_field"):
retrieval_strategy.vector_field = vector_field

self.client = client
self.index = index
Expand Down
7 changes: 4 additions & 3 deletions elasticsearch/helpers/vectorstore/_sync/vectorstore.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,11 @@ def __init__(
# client.options preserves existing (non-user-agent) headers.
client = client.options(headers={"User-Agent": user_agent})

if hasattr(retrieval_strategy, "text_field"):
if (
hasattr(retrieval_strategy, "text_field")
and retrieval_strategy.text_field is None
):
retrieval_strategy.text_field = text_field
if hasattr(retrieval_strategy, "vector_field"):
retrieval_strategy.vector_field = vector_field

self.client = client
self.index = index
Expand Down
Loading