Issue 122871 - Search in Help not working (no results) for some common strings
Summary: Search in Help not working (no results) for some common strings
Status: CLOSED FIXED
Alias: None
Product: General
Classification: Code
Component: help (show other issues)
Version: 4.0.0
Hardware: All All
: P3 Normal (vote)
Target Milestone: 4.1.0
Assignee: hdu@apache.org
QA Contact:
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2013-07-28 12:10 UTC by Andrea Pescetti
Modified: 2017-05-20 10:33 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: 4.0.1
Developer Difficulty: ---


Attachments
Patch to fix ArrayIndexOutOfBoundException when results over 100 (516 bytes, patch)
2013-12-02 11:59 UTC, hanya
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description Andrea Pescetti 2013-07-28 12:10:32 UTC
Searching in the Help always gives "no results found".

1. Open Writer in OpenOffice 4.0.0 Italian (Linux 64-bit)
2. Press the F1 key
3. Select the "Search" tab (Italian: "Cerca")
4. Search for "documento" (or any word that surely is in the help files)

Expected:
- The list of results is returned

Actual result:
- A (translated) message like "No topics found" is shown, no results shown

If confirmed, regression with respect to 3.4.1. Java (1.6.0_20) is configured the same way on both installations and works normally.
Comment 1 Ariel Constenla-Haile 2013-07-28 12:20:44 UTC
Same in en-US, searching for "document".
Linux 64 bit, Windows XP
Comment 2 Rob Weir 2013-07-29 13:55:07 UTC
Works for me on Win 7.  Not for "document", but I tried other terms like "math" and "indent".
Comment 3 Andrea Pescetti 2013-07-31 17:38:14 UTC
Indeed it is not empty in all cases. Searching for "rientro" (indent) gives results.

Still, we have a regression because terms like "documento" (document), "pagina" (page) and "foglio" (sheet) do not return any results. In 3.4.1, I see dozens of results for each of them, as expected.
Comment 4 etiffany 2013-11-27 05:34:17 UTC
Indeed, this is utterly broken on Mac OOo 4.0.1

Any search in Help results in "no topics found"

Woeful.

AOO401m5(Build:9714)  -  Rev. 1524958
2013-09-20 11:07:55 (Fri, 20 Sep 2013)
Comment 5 hanya 2013-12-02 11:59:36 UTC
Created attachment 82023 [details]
Patch to fix ArrayIndexOutOfBoundException when results over 100

In com.sun.star.help.HelpSearch.queryImpl method, 
when search result contains over spacified number for searcher.search( aQuery, 100 ) method, aHits.totalHits holds hit count but aHits.scoreDocs holds only specified 
number of results.

For example, searching about term "MsgBox" in Basic context without "Find in heading only" results aHits.totalHits == 106 and aHits.scoreDocs.length == 100.
So, ArrayIndexOutOfBoundException raised in the following line: 
> ScoreDoc aDoc = aHits.scoreDocs[iHit];
Comment 6 SVN Robot 2013-12-05 16:21:20 UTC
"hdu" committed SVN revision 1548193 into trunk:
#i122871# fix Help search finding more than 100 items
Comment 7 hdu@apache.org 2013-12-05 16:23:52 UTC
Many thanks for the analysis and the patch! I applied it with the commit above.
Comment 8 Andrea Pescetti 2013-12-21 12:42:18 UTC
Thanks hanya for the insightful patch! Verified fixed in recent builds: I can now search "documento" in the Italian version and get the results list as expected.