Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

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

DZone's Guide to

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

· Java Zone
Free Resource

Build vs Buy a Data Quality Solution: Which is Best for You? Gain insights on a hybrid approach. Download white paper now!

{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.

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!

 

Build vs Buy a Data Quality Solution: Which is Best for You? Maintaining high quality data is essential for operational efficiency, meaningful analytics and good long-term customer relationships. But, when dealing with multiple sources of data, data quality becomes complex, so you need to know when you should build a custom data quality tools effort over canned solutions. Download our whitepaper for more insights into a hybrid approach.

Topics:

Published at DZone with permission of Holger Voormann, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}