From f9c7cdaed693934a366145b15dcbb2aa65a9da0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20Walln=C3=B6fer?= Date: Fri, 4 Nov 2022 16:00:36 +0000 Subject: [PATCH] 8294109: JavaDoc search should search whole index Reviewed-by: jjg --- .../doclets/formats/html/resources/search.js.template | 6 +++--- .../jdk/javadoc/doclet/testSearchScript/javadoc-search.js | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/search.js.template b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/search.js.template index 010731daaf7..536c4e7abbc 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/search.js.template +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/search.js.template @@ -43,7 +43,7 @@ const categories = { }; const highlight = "$&"; const NO_MATCH = {}; -const MAX_RESULTS = 500; +const MAX_RESULTS = 300; function checkUnnamed(name, separator) { return name === "" || !name ? "" : name + separator; } @@ -300,11 +300,11 @@ function doSearch(request, response) { } matches.push(m); } - return matches.length < maxResults; + return true; }); return matches.sort(function(e1, e2) { return e2.score - e1.score; - }); + }).slice(0, maxResults); } var result = searchIndex(moduleSearchIndex, "modules") diff --git a/test/langtools/jdk/javadoc/doclet/testSearchScript/javadoc-search.js b/test/langtools/jdk/javadoc/doclet/testSearchScript/javadoc-search.js index 7b1fe9e4546..eed499ff99c 100644 --- a/test/langtools/jdk/javadoc/doclet/testSearchScript/javadoc-search.js +++ b/test/langtools/jdk/javadoc/doclet/testSearchScript/javadoc-search.js @@ -86,6 +86,9 @@ var $ = function(f) { click: function() { return this; }, + hover: function() { + return this; + }, catcomplete: function(o) { o.close = function() {}; search = function(term) {