Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 365549

Summary: [Help][Search] Changing the search results order via org.eclipse.help.searchProcessor can cause duplicated search categories
Product: [Eclipse Project] Platform Reporter: Holger Voormann <eclipse>
Component: User AssistanceAssignee: Paul Webster <pwebster>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: john.arthorne, pwebster
Version: 3.7.1   
Target Milestone: 4.4 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
ZIP archive that contains the plug-ins to reproduce this problem and the screenshots
none
Proposed patch
none
Proposed patch (in Git patch format) none

Description Holger Voormann CLA 2011-12-05 03:21:42 EST
Created attachment 207901 [details]
ZIP archive that contains the plug-ins to reproduce this problem and the screenshots

Since Eclipse 3.7 the org.eclipse.help.searchProcessor extension point can be used to modify the search result list (see http://help.eclipse.org/indigo/topic/org.eclipse.platform.doc.isv/reference/extension-points/org_eclipse_help_base_searchProcessor.html). Unfortunately, if a search processer adds items, removes items or changes the order of the items so that the returned search results list contains items of the same category but not one after another then (if "Show search categories" is enabled) this search result category is shown multiple times (see attached screenshot).
 
Steps to reproduce:
1. Install both plug-ins "doc.a" and "doc.b" that are contained in the attached DuplicatedSearchCategoriesBug.zip file
2. Start Eclipse and open help: "Help > Help Contents"
3. In search input field enter "DuplicatedSearchCategoriesBug" and hit "Go"
4. Make sure that "Show results categories" is enabled

Is:
The search category "Documentation A" is shown twice (see screenshot "bug.png" in DuplicatedSearchCategoriesBug.zip)

Expected/should:	
The search category "Documentation A" should only be shown one time containing "Topic 1" and "Topic 2" (see pseudo screenshot "expected.png" in DuplicatedSearchCategoriesBug.zip)
Comment 1 Holger Voormann CLA 2011-12-05 03:24:06 EST
Created attachment 207902 [details]
Proposed patch
Comment 2 Holger Voormann CLA 2011-12-10 03:38:11 EST
Created attachment 208214 [details]
Proposed patch (in Git patch format)

First proposed patch corrected: sorting after search processors post-processing by categories only (to avoid that the sorting by the search processors is reverted)
Comment 3 Holger Voormann CLA 2014-02-05 03:57:40 EST
Gerrit patch set: https://git.eclipse.org/r/#/c/21547/
Comment 5 Wojciech Sudol CLA 2014-06-03 07:44:03 EDT
Verified in I20140528-2000.