FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

MongoDB Atlas: Two line change to make our CI builds green by caseyclements · Pull Request #1910 · docarray/docarray · GitHub

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (2) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
6 changes: 4 additions & 2 deletions docarray/index/backends/mongodb_atlas.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -563,16 +563,18 @@ def _vector_search_stage(
max_candidates = self._get_max_candidates(search_field)
query = query.astype(np.float64).tolist()

return {
stage = {
'$vectorSearch': {
'index': search_index_name,
'path': search_field,
'queryVector': query,
'numCandidates': min(limit * oversampling_factor, max_candidates),
'limit': limit,
'filter': {"$and": filters} if filters else None,
}
}
if filters:
stage['$vectorSearch']['filter'] = {"$and": filters}
return stage

def _text_search_stage(
self,
Expand Down
2 changes: 1 addition & 1 deletion tests/index/mongo_atlas/__init__.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class FlatSchema(BaseDoc):
embedding2: NdArray = Field(dim=N_DIM, index_name="vector_index_2")


def assert_when_ready(callable: Callable, tries: int = 5, interval: float = 2):
def assert_when_ready(callable: Callable, tries: int = 10, interval: float = 2):
"""
Retry callable to account for time taken to change data on the cluster
"""
Expand Down

Back | FazBrowse Home | New Git URL