@@ -224,6 +224,7 @@ def search(self, q: Optional[Union[str, dict]] = None, searchable_attributes: Op
224
224
text_query_prefix : Optional [str ] = None , hybrid_parameters : Optional [dict ] = None ,
225
225
rerank_depth : Optional [int ] = None , facets : Optional [dict ] = None ,
226
226
track_total_hits : Optional [bool ] = None ,
227
+ approximate_threshold : Optional [float ] = None ,
227
228
) -> Dict [str , Any ]:
228
229
"""Search the index.
229
230
@@ -264,6 +265,10 @@ def search(self, q: Optional[Union[str, dict]] = None, searchable_attributes: Op
264
265
rerank_depth: The number of documents to rerank with score modifiers if used with hybrid search.
265
266
Number of hits to get from each shard if used with tensor search.
266
267
facets: a dictionary of facets to be used for facet search.
268
+ track_total_hits: return total number of lexical matches
269
+ approximate_threshold: hit ratio threshold for deciding if a nearest neighbor search should be performed as
270
+ an exact search, rather than an approximate search
271
+
267
272
Returns:
268
273
Dictionary with hits and other metadata
269
274
"""
@@ -289,6 +294,7 @@ def search(self, q: Optional[Union[str, dict]] = None, searchable_attributes: Op
289
294
"modelAuth" : model_auth ,
290
295
"efSearch" : ef_search ,
291
296
"approximate" : approximate ,
297
+ "approximateThreshold" : approximate_threshold ,
292
298
"searchableAttributes" : searchable_attributes ,
293
299
"limit" : limit ,
294
300
"offset" : offset ,
@@ -455,7 +461,6 @@ def embed(self, content: Union[Union[str, Dict[str, float]], List[Union[str, Dic
455
461
body ["imageDownloadHeaders" ] = image_download_headers
456
462
if model_auth is not None :
457
463
body ["modelAuth" ] = model_auth
458
-
459
464
460
465
res = self .http .post (
461
466
path = path_with_query_str ,
0 commit comments