Skip to content

Commit fd064da

Browse files
feat(Qdrant): use_sparse_embeddings true by default + bugfix
1 parent 529719a commit fd064da

File tree

1 file changed

+3
-3
lines changed
  • integrations/qdrant/src/haystack_integrations/document_stores/qdrant

1 file changed

+3
-3
lines changed

integrations/qdrant/src/haystack_integrations/document_stores/qdrant/document_store.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def __init__(
7171
content_field: str = "content",
7272
name_field: str = "name",
7373
embedding_field: str = "embedding",
74-
use_sparse_embeddings: bool = False, # noqa: FBT001, FBT002
74+
use_sparse_embeddings: bool = True, # noqa: FBT001, FBT002
7575
sparse_embedding_field: str = "sparse_embedding",
7676
similarity: str = "cosine",
7777
return_embedding: bool = False, # noqa: FBT001, FBT002
@@ -139,6 +139,7 @@ def __init__(
139139
self.wait_result_from_api = wait_result_from_api
140140
self.recreate_index = recreate_index
141141
self.payload_fields_to_index = payload_fields_to_index
142+
self.use_sparse_embeddings = use_sparse_embeddings
142143

143144
# Make sure the collection is properly set up
144145
self._set_up_collection(
@@ -150,7 +151,6 @@ def __init__(
150151
self.content_field = content_field
151152
self.name_field = name_field
152153
self.embedding_field = embedding_field
153-
self.use_sparse_embeddings = use_sparse_embeddings
154154
self.sparse_embedding_field = sparse_embedding_field
155155
self.similarity = similarity
156156
self.index = index
@@ -457,7 +457,7 @@ def _set_up_collection(
457457
if self.use_sparse_embeddings and not isinstance(collection_info.config.params.vectors, dict):
458458
msg = (
459459
f"Collection '{collection_name}' already exists in Qdrant, "
460-
f"but it has been originaly created without sparse embedding vectors."
460+
f"but it has been originally created without sparse embedding vectors."
461461
f"If you want to use that collection, either set `use_sparse_embeddings=False` "
462462
f"or run a migration script "
463463
f"to use Named Dense Vectors (`text-sparse`) and Named Sparse Vectors (`text-dense`)."

0 commit comments

Comments
 (0)