Skip to content

Commit aae7a09

Browse files
committed
Make sync method mirror async version
1 parent 974aaca commit aae7a09

File tree

1 file changed

+6
-0
lines changed
  • llama-index-integrations/vector_stores/llama-index-vector-stores-qdrant/llama_index/vector_stores/qdrant

1 file changed

+6
-0
lines changed

llama-index-integrations/vector_stores/llama-index-vector-stores-qdrant/llama_index/vector_stores/qdrant/base.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1592,6 +1592,8 @@ def _detect_vector_format(self, collection_name: str) -> None:
15921592
- new sparse vector field name vs old sparse vector field name
15931593
"""
15941594
try:
1595+
old_sparse_name = self.sparse_vector_name # Store state before detection
1596+
15951597
collection_info = self._client.get_collection(collection_name)
15961598
vectors_config = collection_info.config.params.vectors
15971599
sparse_vectors = collection_info.config.params.sparse_vectors or {}
@@ -1614,6 +1616,10 @@ def _detect_vector_format(self, collection_name: str) -> None:
16141616
elif DEFAULT_SPARSE_VECTOR_NAME_OLD in sparse_vectors:
16151617
self.sparse_vector_name = DEFAULT_SPARSE_VECTOR_NAME_OLD
16161618

1619+
# If the name changed, our initial assumption was wrong. Correct it.
1620+
if self.enable_hybrid and old_sparse_name != self.sparse_vector_name:
1621+
self._reinitialize_sparse_encoders()
1622+
16171623
except Exception as e:
16181624
logger.warning(
16191625
f"Could not detect vector format for collection {collection_name}: {e}"

0 commit comments

Comments
 (0)