File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -563,16 +563,18 @@ def _vector_search_stage(
563563 max_candidates = self ._get_max_candidates (search_field )
564564 query = query .astype (np .float64 ).tolist ()
565565
566- return {
566+ stage = {
567567 '$vectorSearch' : {
568568 'index' : search_index_name ,
569569 'path' : search_field ,
570570 'queryVector' : query ,
571571 'numCandidates' : min (limit * oversampling_factor , max_candidates ),
572572 'limit' : limit ,
573- 'filter' : {"$and" : filters } if filters else None ,
574573 }
575574 }
575+ if filters :
576+ stage ['$vectorSearch' ]['filter' ] = {"$and" : filters }
577+ return stage
576578
577579 def _text_search_stage (
578580 self ,
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ class FlatSchema(BaseDoc):
2929 embedding2 : NdArray = Field (dim = N_DIM , index_name = "vector_index_2" )
3030
3131
32- def assert_when_ready (callable : Callable , tries : int = 5 , interval : float = 2 ):
32+ def assert_when_ready (callable : Callable , tries : int = 10 , interval : float = 2 ):
3333 """
3434 Retry callable to account for time taken to change data on the cluster
3535 """
You can’t perform that action at this time.
0 commit comments