Community
Participate
Working Groups
If there are more than 1000 matches then "Nothing found." is displayed in the Search Result tab/frame, e.g. search for "eclipse" at http://help.eclipse.org: <http://help.eclipse.org/indigo/index.jsp?tab=search&searchWord=eclipse> Should: In Search Result tab/frame display "500 matches in All topics: Change scope" and all these 500 matches one below the other instead of "Nothing found." only, similar to (query is "eclipse.help OR eclipse.core OR eclipse.jdt" instead of "eclipse"): <http://help.eclipse.org/indigo/index.jsp?tab=search&searchWord=eclipse.help+OR+eclipse.core+OR+eclipse.jdt> Side note: if there are more than 500 matches then the title text should start with something like "More than 500 matches" instead of "500 matches" only. Stack trace: java.lang.ArrayIndexOutOfBoundsException: 1000 at org.eclipse.help.internal.search.LocalSearchManager.asList(LocalSearchManager.java:161) at org.eclipse.help.internal.search.SearchIndex.search(SearchIndex.java:628) at org.eclipse.help.internal.search.LocalSearchManager.search(LocalSearchManager.java:591) at org.eclipse.help.internal.search.SearchManager.searchLocal(SearchManager.java:103) at org.eclipse.help.internal.search.SearchManager.search(SearchManager.java:94) at org.eclipse.help.internal.webapp.data.SearchData.loadSearchResults(SearchData.java:430) at org.eclipse.help.internal.webapp.data.SearchData.readSearchResults(SearchData.java:166) at org.eclipse.help.internal.webapp.data.SearchData.<init>(SearchData.java:112) at org.apache.jsp.advanced.searchView_jsp._jspService(searchView_jsp.java:80) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) ...
Created attachment 199890 [details] Patch for bug 352434 Problem: Because in org.apache.lucene.search.TopDocs totalHits is less(!) or equal than scoreDocs.length. Examples: * totalHits=0 and scoreDocs.length=0 * totalHits=861 and scoreDocs.length=861 * totalHits=13884 and scoreDocs.length=1000 will cause following ArrayIndexOutOfBoundsException: 1000 Solution: In org.eclipse.help.internal.search.LocalSearchManager.asList(TopDocs, IndexSearcher) use topDocs.scoreDocs.length instead of topDocs.totalHits
Thanks for the patch! I will include this in 3.7.1.
I verified that this could be reproduced in the SDK by searching for "the" , if the quotes are included in the search expression.
Patch committed to HEAD.
Patch committed to 3.7 Maintenance Stream, Fixed.
Looks good to me.
CQ:WIND00293269 Thanks for fixing this one! :) Helmut
Verified in M20110824-0800
*** Bug 359886 has been marked as a duplicate of this bug. ***