qdrant-haystack 3.7.0__tar.gz → 3.8.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (23) hide show
  1. qdrant_haystack-3.8.1/CHANGELOG.md +104 -0
  2. {qdrant_haystack-3.7.0 → qdrant_haystack-3.8.1}/PKG-INFO +1 -1
  3. {qdrant_haystack-3.7.0 → qdrant_haystack-3.8.1}/src/haystack_integrations/document_stores/qdrant/document_store.py +274 -7
  4. {qdrant_haystack-3.7.0 → qdrant_haystack-3.8.1}/tests/test_dict_converters.py +3 -0
  5. {qdrant_haystack-3.7.0 → qdrant_haystack-3.8.1}/tests/test_retriever.py +3 -0
  6. {qdrant_haystack-3.7.0 → qdrant_haystack-3.8.1}/.gitignore +0 -0
  7. {qdrant_haystack-3.7.0 → qdrant_haystack-3.8.1}/LICENSE.txt +0 -0
  8. {qdrant_haystack-3.7.0 → qdrant_haystack-3.8.1}/README.md +0 -0
  9. {qdrant_haystack-3.7.0 → qdrant_haystack-3.8.1}/examples/embedding_retrieval.py +0 -0
  10. {qdrant_haystack-3.7.0 → qdrant_haystack-3.8.1}/pydoc/config.yml +0 -0
  11. {qdrant_haystack-3.7.0 → qdrant_haystack-3.8.1}/pyproject.toml +0 -0
  12. {qdrant_haystack-3.7.0 → qdrant_haystack-3.8.1}/src/haystack_integrations/components/retrievers/qdrant/__init__.py +0 -0
  13. {qdrant_haystack-3.7.0 → qdrant_haystack-3.8.1}/src/haystack_integrations/components/retrievers/qdrant/retriever.py +0 -0
  14. {qdrant_haystack-3.7.0 → qdrant_haystack-3.8.1}/src/haystack_integrations/document_stores/qdrant/__init__.py +0 -0
  15. {qdrant_haystack-3.7.0 → qdrant_haystack-3.8.1}/src/haystack_integrations/document_stores/qdrant/converters.py +0 -0
  16. {qdrant_haystack-3.7.0 → qdrant_haystack-3.8.1}/src/haystack_integrations/document_stores/qdrant/filters.py +0 -0
  17. {qdrant_haystack-3.7.0 → qdrant_haystack-3.8.1}/src/haystack_integrations/document_stores/qdrant/migrate_to_sparse.py +0 -0
  18. {qdrant_haystack-3.7.0 → qdrant_haystack-3.8.1}/tests/__init__.py +0 -0
  19. {qdrant_haystack-3.7.0 → qdrant_haystack-3.8.1}/tests/conftest.py +0 -0
  20. {qdrant_haystack-3.7.0 → qdrant_haystack-3.8.1}/tests/test_converters.py +0 -0
  21. {qdrant_haystack-3.7.0 → qdrant_haystack-3.8.1}/tests/test_document_store.py +0 -0
  22. {qdrant_haystack-3.7.0 → qdrant_haystack-3.8.1}/tests/test_filters.py +0 -0
  23. {qdrant_haystack-3.7.0 → qdrant_haystack-3.8.1}/tests/test_legacy_filters.py +0 -0
@@ -0,0 +1,104 @@
1
+ # Changelog
2
+
3
+ ## [integrations/qdrant-v3.8.0] - 2024-06-06
4
+
5
+ ### 🚀 Features
6
+
7
+ - Add force_disable_check_same_thread init param for Qdrant local client (#779)
8
+
9
+ ## [integrations/qdrant-v3.7.0] - 2024-05-24
10
+
11
+ ### 🚀 Features
12
+
13
+ - Make get_distance and recreate_collection public, replace deprecated recreate_collection function (#754)
14
+
15
+ ## [integrations/qdrant-v3.6.0] - 2024-05-24
16
+
17
+ ### 🚀 Features
18
+
19
+ - Defer database connection to the first usage (#748)
20
+
21
+ ## [integrations/qdrant-v3.5.0] - 2024-04-24
22
+
23
+ ## [integrations/qdrant-v3.4.0] - 2024-04-23
24
+
25
+ ### Qdrant
26
+
27
+ - Add embedding retrieval example (#666)
28
+
29
+ ## [integrations/qdrant-v3.3.1] - 2024-04-12
30
+
31
+ ### Qdrant
32
+
33
+ - Add migration utility function for Sparse Embedding support (#659)
34
+
35
+ ## [integrations/qdrant-v3.3.0] - 2024-04-12
36
+
37
+ ### 🚀 Features
38
+
39
+ - *(Qdrant)* Start to work on sparse vector integration (#578)
40
+
41
+ ## [integrations/qdrant-v3.2.1] - 2024-04-09
42
+
43
+ ### 🐛 Bug Fixes
44
+
45
+ - Fix haystack-ai pin (#649)
46
+
47
+
48
+
49
+ ## [integrations/qdrant-v3.2.0] - 2024-03-27
50
+
51
+ ### 🚀 Features
52
+
53
+ - *(Qdrant)* Allow payload indexing + on disk vectors (#553)
54
+ - Qdrant datetime filtering support (#570)
55
+
56
+ ### 🐛 Bug Fixes
57
+
58
+ - Fix linter errors (#282)
59
+
60
+
61
+ - Fix order of API docs (#447)
62
+
63
+ This PR will also push the docs to Readme
64
+ - Fixes (#518)
65
+
66
+
67
+
68
+ ### 🚜 Refactor
69
+
70
+ - [**breaking**] Qdrant - update secret management (#405)
71
+
72
+ ### 📚 Documentation
73
+
74
+ - Update category slug (#442)
75
+ - Small consistency improvements (#536)
76
+ - Disable-class-def (#556)
77
+
78
+ ### ⚙️ Miscellaneous Tasks
79
+
80
+ - Generate API docs for Qdrant (#361)
81
+
82
+ ## [integrations/qdrant-v3.0.0] - 2024-01-22
83
+
84
+ ### Refact
85
+
86
+ - [**breaking**] Change import paths (#255)
87
+
88
+ ## [integrations/qdrant-v2.0.1] - 2024-01-18
89
+
90
+ ### 🚀 Features
91
+
92
+ - Add Qdrant integration (#98)
93
+
94
+ ### 🐛 Bug Fixes
95
+
96
+ - Fix import paths for beta5 (#237)
97
+
98
+
99
+
100
+ ### 🚜 Refactor
101
+
102
+ - Use `hatch_vcs` to manage integrations versioning (#103)
103
+
104
+ <!-- generated by git-cliff -->
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: qdrant-haystack
3
- Version: 3.7.0
3
+ Version: 3.8.1
4
4
  Summary: An integration of Qdrant ANN vector database backend with Haystack
5
5
  Project-URL: Source, https://github.com/deepset-ai/haystack-core-integrations
6
6
  Project-URL: Documentation, https://github.com/deepset-ai/haystack-core-integrations/blob/main/integrations/qdrant/README.md
@@ -49,6 +49,44 @@ def get_batches_from_generator(iterable, n):
49
49
 
50
50
 
51
51
  class QdrantDocumentStore:
52
+ """
53
+ QdrantDocumentStore is a Document Store for Qdrant.
54
+ It can be used with any Qdrant instance: in-memory, disk-persisted, Docker-based,
55
+ and Qdrant Cloud Cluster deployments.
56
+
57
+ Usage example by creating an in-memory instance:
58
+
59
+ ```python
60
+ from haystack.dataclasses.document import Document
61
+ from haystack_integrations.document_stores.qdrant import QdrantDocumentStore
62
+
63
+ document_store = QdrantDocumentStore(
64
+ ":memory:",
65
+ recreate_index=True
66
+ )
67
+ document_store.write_documents([
68
+ Document(content="This is first", embedding=[0.0]*5),
69
+ Document(content="This is second", embedding=[0.1, 0.2, 0.3, 0.4, 0.5])
70
+ ])
71
+ ```
72
+
73
+ Usage example with Qdrant Cloud:
74
+
75
+ ```python
76
+ from haystack.dataclasses.document import Document
77
+ from haystack_integrations.document_stores.qdrant import QdrantDocumentStore
78
+
79
+ document_store = QdrantDocumentStore(
80
+ url="https://xxxxxx-xxxxx-xxxxx-xxxx-xxxxxxxxx.us-east.aws.cloud.qdrant.io:6333",
81
+ api_key="<your-api-key>",
82
+ )
83
+ document_store.write_documents([
84
+ Document(content="This is first", embedding=[0.0]*5),
85
+ Document(content="This is second", embedding=[0.1, 0.2, 0.3, 0.4, 0.5])
86
+ ])
87
+ ```
88
+ """
89
+
52
90
  SIMILARITY: ClassVar[Dict[str, str]] = {
53
91
  "cosine": rest.Distance.COSINE,
54
92
  "dot_product": rest.Distance.DOT,
@@ -68,6 +106,7 @@ class QdrantDocumentStore:
68
106
  timeout: Optional[int] = None,
69
107
  host: Optional[str] = None,
70
108
  path: Optional[str] = None,
109
+ force_disable_check_same_thread: bool = False,
71
110
  index: str = "Document",
72
111
  embedding_dim: int = 768,
73
112
  on_disk: bool = False,
@@ -95,6 +134,98 @@ class QdrantDocumentStore:
95
134
  scroll_size: int = 10_000,
96
135
  payload_fields_to_index: Optional[List[dict]] = None,
97
136
  ):
137
+ """
138
+ :param location:
139
+ If `memory` - use in-memory Qdrant instance.
140
+ If `str` - use it as a URL parameter.
141
+ If `None` - use default values for host and port.
142
+ :param url:
143
+ Either host or str of `Optional[scheme], host, Optional[port], Optional[prefix]`.
144
+ :param port:
145
+ Port of the REST API interface.
146
+ :param grpc_port:
147
+ Port of the gRPC interface.
148
+ :param prefer_grpc:
149
+ If `True` - use gRPC interface whenever possible in custom methods.
150
+ :param https:
151
+ If `True` - use HTTPS(SSL) protocol.
152
+ :param api_key:
153
+ API key for authentication in Qdrant Cloud.
154
+ :param prefix:
155
+ If not `None` - add prefix to the REST URL path.
156
+ Example: service/v1 will result in http://localhost:6333/service/v1/{qdrant-endpoint}
157
+ for REST API.
158
+ :param timeout:
159
+ Timeout for REST and gRPC API requests.
160
+ :param host:
161
+ Host name of Qdrant service. If ùrl` and `host` are `None`, set to `localhost`.
162
+ :param path:
163
+ Persistence path for QdrantLocal.
164
+ :param force_disable_check_same_thread:
165
+ For QdrantLocal, force disable check_same_thread.
166
+ Only use this if you can guarantee that you can resolve the thread safety outside QdrantClient.
167
+ :param index:
168
+ Name of the index.
169
+ :param embedding_dim:
170
+ Dimension of the embeddings.
171
+ :param on_disk:
172
+ Whether to store the collection on disk.
173
+ :param content_field:
174
+ The field for the document content.
175
+ :param name_field:
176
+ The field for the document name.
177
+ :param embedding_field:
178
+ The field for the document embeddings.
179
+ :param use_sparse_embedding:
180
+ If set to `True`, enables support for sparse embeddings.
181
+ :param similarity:
182
+ The similarity metric to use.
183
+ :param return_embedding:
184
+ Whether to return embeddings in the search results.
185
+ :param progress_bar:
186
+ Whether to show a progress bar or not.
187
+ :param duplicate_documents:
188
+ The parameter is not used and will be removed in future release.
189
+ :param recreate_index:
190
+ Whether to recreate the index.
191
+ :param shard_number:
192
+ Number of shards in the collection.
193
+ :param replication_factor:
194
+ Replication factor for the collection.
195
+ Defines how many copies of each shard will be created. Effective only in distributed mode.
196
+ :param write_consistency_factor:
197
+ Write consistency factor for the collection. Minimum value is 1.
198
+ Defines how many replicas should apply to the operation for it to be considered successful.
199
+ Increasing this number makes the collection more resilient to inconsistencies
200
+ but will cause failures if not enough replicas are available.
201
+ Effective only in distributed mode.
202
+ :param on_disk_payload:
203
+ If `True`, the point's payload will not be stored in memory and
204
+ will be read from the disk every time it is requested.
205
+ This setting saves RAM by slightly increasing response time.
206
+ Note: indexed payload values remain in RAM.
207
+ :param hnsw_config:
208
+ Params for HNSW index.
209
+ :param optimizers_config:
210
+ Params for optimizer.
211
+ :param wal_config:
212
+ Params for Write-Ahead-Log.
213
+ :param quantization_config:
214
+ Params for quantization. If `None`, quantization will be disabled.
215
+ :param init_from:
216
+ Use data stored in another collection to initialize this collection.
217
+ :param wait_result_from_api:
218
+ Whether to wait for the result from the API after each request.
219
+ :param metadata:
220
+ Additional metadata to include with the documents.
221
+ :param write_batch_size:
222
+ The batch size for writing documents.
223
+ :param scroll_size:
224
+ The scroll size for reading documents.
225
+ :param payload_fields_to_index:
226
+ List of payload fields to index.
227
+ """
228
+
98
229
  self._client = None
99
230
 
100
231
  # Store the Qdrant client specific attributes
@@ -109,6 +240,7 @@ class QdrantDocumentStore:
109
240
  self.timeout = timeout
110
241
  self.host = host
111
242
  self.path = path
243
+ self.force_disable_check_same_thread = force_disable_check_same_thread
112
244
  self.metadata = metadata or {}
113
245
  self.api_key = api_key
114
246
 
@@ -155,6 +287,7 @@ class QdrantDocumentStore:
155
287
  host=self.host,
156
288
  path=self.path,
157
289
  metadata=self.metadata,
290
+ force_disable_check_same_thread=self.force_disable_check_same_thread,
158
291
  )
159
292
  # Make sure the collection is properly set up
160
293
  self._set_up_collection(
@@ -169,6 +302,9 @@ class QdrantDocumentStore:
169
302
  return self._client
170
303
 
171
304
  def count_documents(self) -> int:
305
+ """
306
+ Returns the number of documents present in the Document Store.
307
+ """
172
308
  try:
173
309
  response = self.client.count(
174
310
  collection_name=self.index,
@@ -184,6 +320,15 @@ class QdrantDocumentStore:
184
320
  self,
185
321
  filters: Optional[Union[Dict[str, Any], rest.Filter]] = None,
186
322
  ) -> List[Document]:
323
+ """
324
+ Returns the documents that match the provided filters.
325
+
326
+ For a detailed specification of the filters, refer to the
327
+ [documentation](https://docs.haystack.deepset.ai/docs/metadata-filtering)
328
+
329
+ :param filters: The filters to apply to the document list.
330
+ :returns: A list of documents that match the given filters.
331
+ """
187
332
  if filters and not isinstance(filters, dict) and not isinstance(filters, rest.Filter):
188
333
  msg = "Filter must be a dictionary or an instance of `qdrant_client.http.models.Filter`"
189
334
  raise ValueError(msg)
@@ -201,6 +346,19 @@ class QdrantDocumentStore:
201
346
  documents: List[Document],
202
347
  policy: DuplicatePolicy = DuplicatePolicy.FAIL,
203
348
  ):
349
+ """
350
+ Writes documents to Qdrant using the specified policy.
351
+ The QdrantDocumentStore can handle duplicate documents based on the given policy.
352
+ The available policies are:
353
+ - `FAIL`: The operation will raise an error if any document already exists.
354
+ - `OVERWRITE`: Existing documents will be overwritten with the new ones.
355
+ - `SKIP`: Existing documents will be skipped, and only new documents will be added.
356
+
357
+ :param documents: A list of Document objects to write to Qdrant.
358
+ :param policy: The policy for handling duplicate documents.
359
+
360
+ :returns: The number of documents written to the document store.
361
+ """
204
362
  for doc in documents:
205
363
  if not isinstance(doc, Document):
206
364
  msg = f"DocumentStore.write_documents() expects a list of Documents but got an element of {type(doc)}."
@@ -236,6 +394,11 @@ class QdrantDocumentStore:
236
394
  return len(document_objects)
237
395
 
238
396
  def delete_documents(self, ids: List[str]):
397
+ """
398
+ Deletes documents that match the provided `document_ids` from the document store.
399
+
400
+ :param document_ids: the document ids to delete
401
+ """
239
402
  ids = [convert_id(_id) for _id in ids]
240
403
  try:
241
404
  self.client.delete(
@@ -250,10 +413,24 @@ class QdrantDocumentStore:
250
413
 
251
414
  @classmethod
252
415
  def from_dict(cls, data: Dict[str, Any]) -> "QdrantDocumentStore":
416
+ """
417
+ Deserializes the component from a dictionary.
418
+
419
+ :param data:
420
+ The dictionary to deserialize from.
421
+ :returns:
422
+ The deserialized component.
423
+ """
253
424
  deserialize_secrets_inplace(data["init_parameters"], keys=["api_key"])
254
425
  return default_from_dict(cls, data)
255
426
 
256
427
  def to_dict(self) -> Dict[str, Any]:
428
+ """
429
+ Serializes the component to a dictionary.
430
+
431
+ :returns:
432
+ Dictionary with serialized data.
433
+ """
257
434
  params = inspect.signature(self.__init__).parameters # type: ignore
258
435
  # All the __init__ params must be set as attributes
259
436
  # Set as init_parms without default values
@@ -268,6 +445,13 @@ class QdrantDocumentStore:
268
445
  self,
269
446
  filters: Optional[Union[Dict[str, Any], rest.Filter]] = None,
270
447
  ) -> Generator[Document, None, None]:
448
+ """
449
+ Returns a generator that yields documents from Qdrant based on the provided filters.
450
+
451
+ :param filters: Filters applied to the retrieved documents.
452
+ :returns: A generator that yields documents retrieved from Qdrant.
453
+ """
454
+
271
455
  index = self.index
272
456
  qdrant_filters = convert_filters_to_qdrant(filters)
273
457
 
@@ -296,6 +480,16 @@ class QdrantDocumentStore:
296
480
  ids: List[str],
297
481
  index: Optional[str] = None,
298
482
  ) -> List[Document]:
483
+ """
484
+ Retrieves documents from Qdrant by their IDs.
485
+
486
+ :param ids:
487
+ A list of document IDs to retrieve.
488
+ :param index:
489
+ The name of the index to retrieve documents from.
490
+ :returns:
491
+ A list of documents.
492
+ """
299
493
  index = index or self.index
300
494
 
301
495
  documents: List[Document] = []
@@ -322,6 +516,21 @@ class QdrantDocumentStore:
322
516
  scale_score: bool = True,
323
517
  return_embedding: bool = False,
324
518
  ) -> List[Document]:
519
+ """
520
+ Queries Qdrant using a sparse embedding and returns the most relevant documents.
521
+
522
+ :param query_sparse_embedding: Sparse embedding of the query.
523
+ :param filters: Filters applied to the retrieved documents.
524
+ :param top_k: Maximum number of documents to return.
525
+ :param scale_score: Whether to scale the scores of the retrieved documents.
526
+ :param return_embedding: Whether to return the embeddings of the retrieved documents.
527
+
528
+ :returns: List of documents that are most similar to `query_sparse_embedding`.
529
+
530
+ :raises QdrantStoreError:
531
+ If the Document Store was initialized with `use_sparse_embeddings=False`.
532
+ """
533
+
325
534
  if not self.use_sparse_embeddings:
326
535
  message = (
327
536
  "You are trying to query using sparse embeddings, but the Document Store "
@@ -364,6 +573,17 @@ class QdrantDocumentStore:
364
573
  scale_score: bool = True,
365
574
  return_embedding: bool = False,
366
575
  ) -> List[Document]:
576
+ """
577
+ Queries Qdrant using a dense embedding and returns the most relevant documents.
578
+
579
+ :param query_embedding: Dense embedding of the query.
580
+ :param filters: Filters applied to the retrieved documents.
581
+ :param top_k: Maximum number of documents to return.
582
+ :param scale_score: Whether to scale the scores of the retrieved documents.
583
+ :param return_embedding: Whether to return the embeddings of the retrieved documents.
584
+
585
+ :returns: List of documents that are most similar to `query_embedding`.
586
+ """
367
587
  qdrant_filters = convert_filters_to_qdrant(filters)
368
588
 
369
589
  points = self.client.search(
@@ -406,8 +626,8 @@ class QdrantDocumentStore:
406
626
 
407
627
  :param query_embedding: Dense embedding of the query.
408
628
  :param query_sparse_embedding: Sparse embedding of the query.
409
- :param filters: Filters applied to the retrieved Documents.
410
- :param top_k: Maximum number of Documents to return.
629
+ :param filters: Filters applied to the retrieved documents.
630
+ :param top_k: Maximum number of documents to return.
411
631
  :param return_embedding: Whether to return the embeddings of the retrieved documents.
412
632
 
413
633
  :returns: List of Document that are most similar to `query_embedding` and `query_sparse_embedding`.
@@ -471,6 +691,16 @@ class QdrantDocumentStore:
471
691
  return results
472
692
 
473
693
  def get_distance(self, similarity: str) -> rest.Distance:
694
+ """
695
+ Retrieves the distance metric for the specified similarity measure.
696
+
697
+ :param similarity:
698
+ The similarity measure to retrieve the distance.
699
+ :returns:
700
+ The corresponding rest.Distance object.
701
+ :raises QdrantStoreError:
702
+ If the provided similarity measure is not supported.
703
+ """
474
704
  try:
475
705
  return self.SIMILARITY[similarity]
476
706
  except KeyError as ke:
@@ -504,6 +734,29 @@ class QdrantDocumentStore:
504
734
  on_disk: bool = False,
505
735
  payload_fields_to_index: Optional[List[dict]] = None,
506
736
  ):
737
+ """
738
+ Sets up the Qdrant collection with the specified parameters.
739
+ :param collection_name:
740
+ The name of the collection to set up.
741
+ :param embedding_dim:
742
+ The dimension of the embeddings.
743
+ :param recreate_collection:
744
+ Whether to recreate the collection if it already exists.
745
+ :param similarity:
746
+ The similarity measure to use.
747
+ :param use_sparse_embeddings:
748
+ Whether to use sparse embeddings.
749
+ :param on_disk:
750
+ Whether to store the collection on disk.
751
+ :param payload_fields_to_index:
752
+ List of payload fields to index.
753
+
754
+ :raises QdrantStoreError:
755
+ If the collection exists with incompatible settings.
756
+ :raises ValueError:
757
+ If the collection exists with a different similarity measure or embedding dimension.
758
+
759
+ """
507
760
  distance = self.get_distance(similarity)
508
761
 
509
762
  if recreate_collection or not self.client.collection_exists(collection_name):
@@ -573,6 +826,20 @@ class QdrantDocumentStore:
573
826
  on_disk: Optional[bool] = None,
574
827
  use_sparse_embeddings: Optional[bool] = None,
575
828
  ):
829
+ """
830
+ Recreates the Qdrant collection with the specified parameters.
831
+
832
+ :param collection_name:
833
+ The name of the collection to recreate.
834
+ :param distance:
835
+ The distance metric to use for the collection.
836
+ :param embedding_dim:
837
+ The dimension of the embeddings.
838
+ :param on_disk:
839
+ Whether to store the collection on disk.
840
+ :param use_sparse_embeddings:
841
+ Whether to use sparse embeddings.
842
+ """
576
843
  if on_disk is None:
577
844
  on_disk = self.on_disk
578
845
 
@@ -624,11 +891,11 @@ class QdrantDocumentStore:
624
891
 
625
892
  :param documents: A list of Haystack Document objects.
626
893
  :param index: name of the index
627
- :param duplicate_documents: Handle duplicates document based on parameter options.
894
+ :param duplicate_documents: Handle duplicate documents based on parameter options.
628
895
  Parameter options : ( 'skip','overwrite','fail')
629
- skip (default option): Ignore the duplicates documents
896
+ skip (default option): Ignore the duplicates documents.
630
897
  overwrite: Update any existing documents with the same ID when adding documents.
631
- fail: an error is raised if the document ID of the document being added already
898
+ fail: An error is raised if the document ID of the document being added already
632
899
  exists.
633
900
  :returns: A list of Haystack Document objects.
634
901
  """
@@ -649,10 +916,10 @@ class QdrantDocumentStore:
649
916
 
650
917
  def _drop_duplicate_documents(self, documents: List[Document], index: Optional[str] = None) -> List[Document]:
651
918
  """
652
- Drop duplicates documents based on same hash ID
919
+ Drop duplicate documents based on same hash ID.
653
920
 
654
921
  :param documents: A list of Haystack Document objects.
655
- :param index: name of the index
922
+ :param index: Name of the index.
656
923
  :returns: A list of Haystack Document objects.
657
924
  """
658
925
  _hash_ids: Set = set()
@@ -25,6 +25,7 @@ def test_to_dict():
25
25
  "content_field": "content",
26
26
  "name_field": "name",
27
27
  "embedding_field": "embedding",
28
+ "force_disable_check_same_thread": False,
28
29
  "use_sparse_embeddings": False,
29
30
  "similarity": "cosine",
30
31
  "return_embedding": False,
@@ -64,6 +65,7 @@ def test_from_dict():
64
65
  "content_field": "content",
65
66
  "name_field": "name",
66
67
  "embedding_field": "embedding",
68
+ "force_disable_check_same_thread": False,
67
69
  "use_sparse_embeddings": True,
68
70
  "similarity": "cosine",
69
71
  "return_embedding": False,
@@ -88,6 +90,7 @@ def test_from_dict():
88
90
  document_store.content_field == "content",
89
91
  document_store.name_field == "name",
90
92
  document_store.embedding_field == "embedding",
93
+ document_store.force_disable_check_same_thread is False,
91
94
  document_store.use_sparse_embeddings is True,
92
95
  document_store.on_disk is False,
93
96
  document_store.similarity == "cosine",
@@ -49,6 +49,7 @@ class TestQdrantRetriever(FilterableDocsFixtureMixin):
49
49
  "on_disk": False,
50
50
  "content_field": "content",
51
51
  "name_field": "name",
52
+ "force_disable_check_same_thread": False,
52
53
  "embedding_field": "embedding",
53
54
  "use_sparse_embeddings": False,
54
55
  "similarity": "cosine",
@@ -172,6 +173,7 @@ class TestQdrantSparseEmbeddingRetriever(FilterableDocsFixtureMixin):
172
173
  "content_field": "content",
173
174
  "name_field": "name",
174
175
  "embedding_field": "embedding",
176
+ "force_disable_check_same_thread": False,
175
177
  "use_sparse_embeddings": False,
176
178
  "similarity": "cosine",
177
179
  "return_embedding": False,
@@ -281,6 +283,7 @@ class TestQdrantHybridRetriever:
281
283
  "content_field": "content",
282
284
  "name_field": "name",
283
285
  "embedding_field": "embedding",
286
+ "force_disable_check_same_thread": False,
284
287
  "use_sparse_embeddings": False,
285
288
  "similarity": "cosine",
286
289
  "return_embedding": False,