Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 365549 - [Help][Search] Changing the search results order via org.eclipse.help.searchProcessor can cause duplicated search categories
Summary: [Help][Search] Changing the search results order via org.eclipse.help.searchP...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: User Assistance (show other bugs)
Version: 3.7.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 4.4 M6   Edit
Assignee: Paul Webster CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-05 03:21 EST by Holger Voormann CLA
Modified: 2014-06-03 07:44 EDT (History)
2 users (show)

See Also:


Attachments
ZIP archive that contains the plug-ins to reproduce this problem and the screenshots (51.50 KB, application/zip)
2011-12-05 03:21 EST, Holger Voormann CLA
no flags Details
Proposed patch (951 bytes, patch)
2011-12-05 03:24 EST, Holger Voormann CLA
no flags Details | Diff
Proposed patch (in Git patch format) (1.75 KB, patch)
2011-12-10 03:38 EST, Holger Voormann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.