File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -1399,11 +1399,17 @@ def perform_search(
1399
1399
1400
1400
if repconf .mongodb .enabled and query_val :
1401
1401
if term in hash_searches :
1402
+ # The file details are uniq, and we store 1 to many. So where hash type is uniq, IDs are list
1403
+ split_by = "," if "," in query_val else " "
1404
+ query_val = {"$in" : [val .strip () for val in query_val .split (split_by )]}
1402
1405
# The file details are uniq, and we store 1 to many. So where hash type is uniq, IDs are list
1403
1406
file_docs = list (mongo_find (FILES_COLL , {hash_searches [term ]: query_val }, {"_task_ids" : 1 }))
1404
1407
if not file_docs :
1405
1408
return []
1406
- ids = sorted (list (set (file_docs [0 ]["_task_ids" ])), reverse = True )[:search_limit ]
1409
+ all_ids = []
1410
+ for file_doc in file_docs :
1411
+ all_ids .extend (file_doc ["_task_ids" ])
1412
+ ids = sorted (list (set (all_ids )), reverse = True )[:search_limit ]
1407
1413
term = "ids"
1408
1414
mongo_search_query = {"info.id" : {"$in" : ids }}
1409
1415
elif isinstance (search_term_map [term ], str ):
You can’t perform that action at this time.
0 commit comments