fix: fix module search (#34872)

This commit is contained in:
Ayush Chaudhari 2025-11-26 10:51:37 +05:30 committed by GitHub
parent a8c835190d
commit c4de4fe649
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -179,7 +179,7 @@ def search_widget(
_relevance_expr = {"DIV": [1, {"NULLIF": [{"LOCATE": [_txt, "name"]}, 0]}]}
# For MariaDB, wrap in IFNULL for sorting to push nulls to end
if frappe.db.db_type == "mariadb":
if frappe.db.db_type in ("mariadb", "sqlite"):
_relevance = {"IFNULL": [_relevance_expr, -9999], "as": "_relevance"}
formatted_fields.append(_relevance)
order_by = f"_relevance desc, {order_by}"