Skip to content

Commit

Permalink
add: search for CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
henilp105 committed May 27, 2024
1 parent c5900f6 commit df1cc5a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions backend/packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,17 +182,17 @@ def search_packages_cli():
packages_per_page = int_validation(packages_per_page,10)

conditions = [
{"namespace_name": {"$regex": namespace}} if namespace else None,
{"license": {"$regex": license}} if license else None,
{"name": {"$regex": package}} if package else None,
{"namespace_name": {"$regex": namespace, "$options": "i"}} if namespace else None,
{"license": {"$regex": license, "$options": "i"}} if license else None,
{"name": {"$regex": package, "$options": "i"}} if package else None,
]

mongo_db_query = {
"$and": [
{
"$or": [
{"registry_description": {"$regex": query}},
{"description": {"$regex": query}},
{"registry_description": {"$regex": query, "$options": "i"}},
{"description": {"$regex": query, "$options": "i"}},
]
},
{"is_deprecated": False},
Expand Down

0 comments on commit df1cc5a

Please sign in to comment.