Little Known Things about the Eclipse Infocenter: Search Links (3/5)
Join the DZone community and get the full member experience.
Join For Free{editor's note: we posted a summary of holger voormann's tips about the eclipse infocenter a few weeks ago . we are now excited to have holger as a dzone mvb, and will be publishing his full infocenter articles this week. make sure to check out holger's blog, eclipse howl .}
the eclipse infocenter is the eclipse help system launched as a web application. two of five well-hidden features about the infocenter have already been presented here. after basic and bot mode and deep linking here comes little known thing number three: search links.
search links are queries which can be used for sharing or creating a search input field in or outside the infocenter. you can search all content, a single book or a single chapter. to search all content you have to append /index.jsp?tab=search&searchword=… to the base infocenter address like in this example of searching for eclipse runtime options within the eclipse luna online help . the following html snippet creates a search field for luna help:
<form action="http://help.eclipse.org/luna/index.jsp" method="get" accept-charset="utf-8"> <input type="hidden" name="tab" value="search"> <input name="searchword"> <input type="submit" value="search"> </form>
in order to search within a book you have to use the
toc
parameter in addition to the
tab
and
searchword
parameters as well as
quicksearch=true
and
quicksearchtype=quicksearchtoc
:
/index.jsp?tab=search
&quicksearch=true&quicksearchtype=quicksearchtoc&toc=…
&searchword=…
to get the value for the
toc
parameter, open
/basic/searchview.jsp?searchword=-&scopedsearch=true
, select one book, click the
go
button and get the value from the
scope
parameter of the new url.
a chapter can be specified by the path parameter: /index.jsp?tab=search&quicksearch=true&quicksearchtype=quicksearchtoc&toc=… &path=… &searchword=… the value of tab is a tuple of subchapter indexes starting with 0 separated by underscores. for example path=0_2 refers to the third subchapter of the first top-level chapter of the book specified by the toc parameter.
in addition to the parameters described above you can use the optional parameters maxhits and showsearchcategories . the maxhits parameter specifies the maximal number of results to return and its value ranges between 1 and 500. the user settings group by categories can be overridden by showsearchcategories=true or by showsearchcategories=false .
if you do not pass the turing test because you are not human you may be interested in the more machine-readable search results in xml. the xml document is available at /search?phrase=… and includes also the scoring. the parameter phrase is equal to the searchword parameter described above. the maximal number of results is limited to 1,000 ( maxhits is not supported). the xml search results can be easily used in scripts. for example, this little ant script finds common misspellings by querying for each item of wikipedia’s list of common misspellings . it finds 131 typos in the current luna help with only a very low false positive rate.
the next little known things about the eclipse infocenter on my list are language switching and debugging information . stay tuned!
Published at DZone with permission of Holger Voormann, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments