Skip to content

Commit 74580e0

Browse files
author
xieqihuiPG
committed
minor bug
1 parent dbf5759 commit 74580e0

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

nearpy/engine.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,17 @@ def _get_candidates(self, v, mongo_fetch_vector_filters=None):
167167
candidates = []
168168
for lshash in self.lshashes:
169169
for bucket_key in lshash.hash_vector(v, querying=True):
170-
bucket_content = self.storage.get_bucket(
171-
lshash.hash_name,
172-
bucket_key,
173-
mongo_fetch_vector_filters
174-
)
170+
if mongo_fetch_vector_filters:
171+
bucket_content = self.storage.get_bucket(
172+
lshash.hash_name,
173+
bucket_key,
174+
mongo_fetch_vector_filters
175+
)
176+
else:
177+
bucket_content = self.storage.get_bucket(
178+
lshash.hash_name,
179+
bucket_key,
180+
)
175181
#print 'Bucket %s size %d' % (bucket_key, len(bucket_content))
176182
candidates.extend(bucket_content)
177183
return candidates

0 commit comments

Comments
 (0)