diff --git a/lib/galaxy/tool_source_store/search.py b/lib/galaxy/tool_source_store/search.py index fe028b6ebf5..bb95df3e5d6 100644 --- a/lib/galaxy/tool_source_store/search.py +++ b/lib/galaxy/tool_source_store/search.py @@ -238,10 +238,13 @@ class ToolWhooshIndex: writer.delete_by_term("id", stale_id) return written - def search(self, query: str, limit: int = 50) -> list[str]: + def search(self, query: str, limit: int | None = None) -> list[str]: """Return tool ids ranked for ``query`` (most-relevant first). - ``limit`` matches the cap on the existing hand-rolled scorer. + ``limit=None`` returns every match — the eager + ``ToolPanelViewSearch`` searches unlimited, and capped results + truncate uniform-score hits arbitrarily (a tag query fanning out to + 23 tools would silently lose the last 3 in doc-insertion order). """ if not query or not query.strip(): return [] diff --git a/lib/galaxy/tools/search/__init__.py b/lib/galaxy/tools/search/__init__.py index 53135bc9cdb..62e93eacd4b 100644 --- a/lib/galaxy/tools/search/__init__.py +++ b/lib/galaxy/tools/search/__init__.py @@ -170,7 +170,9 @@ class LazyToolboxSearch(ToolBoxSearch): if index_dir is None: return [] searcher = ToolWhooshIndex(index_dir=index_dir, tuning=ToolSearchTuning.from_config(config)) - return searcher.search(q, limit=int(config.tool_search_limit)) + # limit=None matches ToolPanelViewSearch below, which searches + # unlimited — capping here would truncate uniform-score matches. + return searcher.search(q, limit=None) class ToolPanelViewSearch: