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

Bug 350861

Summary: EGit doc plugin should include a pre-built help index
Product: [Technology] EGit Reporter: Martin Oberhuber <mober.at+eclipse>
Component: RelengAssignee: Project Inbox <egit.releng-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: robin
Version: 1.0Keywords: helpwanted
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 366319    
Bug Blocks:    

Description Martin Oberhuber CLA 2011-06-30 11:55:22 EDT
+++ This bug was initially created as a clone of Bug #350850 +++

When searching Eclipse Help for the first time, a search index has to be built. The speed of doing so can be drastically improved when the doc plugin ships a prebuilt help index. 

Egit doc should include such an index, such that users can search docs faster.

I'm not sure how to integrate the index builder with the maven/tycho build system used by egit, but for reference the attachment on bug 350850 shows how this is done with PDE Build - it's pretty easy.
Comment 1 Martin Oberhuber CLA 2011-06-30 12:44:42 EDT
Initial support for building the index with PDE Build has been submitted to Gerrit: 

http://egit.eclipse.org/r/#q,Ie438e5a642eaf1e50c9482898822bc5376cbe377,n,z

Support for Tycho will need to be added.
Comment 2 Martin Oberhuber CLA 2011-06-30 13:01:15 EDT
Gees, there was Hudson test failures with this change, but I can't possibly understand how these could be related to this change. Would appreciate some human reviewer.
Comment 3 Martin Oberhuber CLA 2011-07-01 08:21:48 EDT
Unfortunately, AFAIK only the Eclipse ant support (embedded in Eclipse) can build the help index. But Eclipse antRunner can be launched from the outside, and since an Eclipse Target Platform must be available when Tycho is running, executing the following command from inside Tycho should do the trick (the extra -D options enable some logging):

   java
         -jar $ECLIPSE_HOME/plugins/org.eclipse.equinox.launcher_*.jar \
         -data /tmp/tmpws \
         -configuration /tmp/tmpconfig \
         -DjavacDebugInfo=on \
         -DjavacVerbose=true \
         -DjavacFailOnError=false \
         -application org.eclipse.ant.core.antRunner \
         -f customBuildCallbacks.xml \
         build.index

I'm not sure how to invoke the external Java from Tycho, or whether perhaps an Eclipse instance inside the JVM could be launched, but the concept is clear and we actually use the same command successfully in our own proprietary build (invoked from a Shell / Makefile in our case).
Comment 4 Martin Oberhuber CLA 2011-07-01 09:35:56 EDT
I should also mention that the format of the prebuilt index files changed with Eclipse 3.7 (due to the new Lucene version). So when building the prebuilt index, one needs to decide whether an Eclipse 3.7 is used (for 3.7 consumers) or an older Eclipse (for older Eclipse consumers).

Having an old version of help index means that Eclipse 3.7 cannot use the index and silently re-builds it on first search (thus there is a performance hit again).

I never checked what happens when having a new version of help index in an older Eclipse - that would be easy to check by placing an Eclipse 3.7 platform.doc.user plugin into an Eclipse 3.6 or 3.5 dropins folder, launching and performing a help search.