providers_search: ties sort by name A→Z
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FAqjv1sLfUad2bMcsmPbRT
This commit is contained in:
1 parent
9ccbf48bdf
commit
5bec2c0f37
1 file changed
+2
-1
@@ -93,7 +93,8 @@ def oracle_search(query: str, limit: int = 10, connectable_only: bool = True) ->
|
|||||||
1 if "teahub" in row["sources"] else 0,
|
1 if "teahub" in row["sources"] else 0,
|
||||||
)
|
)
|
||||||
hits.append((score, row))
|
hits.append((score, row))
|
||||||
hits.sort(key=lambda item: (item[0], item[1]["name"].lower()), reverse=True)
|
hits.sort(key=lambda item: item[1]["name"].lower())
|
||||||
|
hits.sort(key=lambda item: item[0], reverse=True)
|
||||||
return [row for _, row in hits[: max(1, min(limit, 50))]]
|
return [row for _, row in hits[: max(1, min(limit, 50))]]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user