Little Known Things about the Eclipse Infocenter: Search Links (3/5)

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=""
          method="get" accept-charset="utf-8">
        <input type="hidden" name="tab" value="search">
        <input name="searchWord">
        <input type="submit" value="Search">

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.

Getting the value for 'toc'

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.

Getting the value for 'path'

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!

Flattr this

One Response to “Little Known Things about the Eclipse Infocenter: Search Links (3/5)”

  1. Ichbin Rodolf Says:

    Excellent to finally find out how to perform a search through URL query, many thanks!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: