Plugging in search engines
The new federated information search in Help system uses the notion of search
engine types and search engines. An engine type is a meta-engine from
which a number of concrete search engines can be created by parameterization.
New engine types are contributed through the
Instances of XYZ Search search the XYZ site.
This extension point is used to plug in search participants in the information
search. Each search engine can be configured individually. When search is
initiated, each search engine is executed as a background job, and the results
are collated in the help view immediately under the query.
Search engines defined here will not automatically show up as federated
search participants until engine product binding is established, unless
productId attribute is left undefined. For engines that define it, only
those bound to a particular product will show up when that product is running.
Search engines can simply compose a URL and provide only one hit containing
that URL as
href. Popular search engines for which API support
requires license can be plugged in like this. On the other end of the spectrum,
search engines can communicate with the server and receive individual hits with
information like label, href, short description, score etc. Local help engine
can produce hits this way.
Regardless of the search mechanism, engines can provide various search scope
settings using JFace preference pages. These pages are shown when 'Advanced
Settings' link is followed from the Help view. In addition to root preference
pages defined with the engine, additional preference sub-pages can be plugged in
for more advanced settings.
Scope settings are loaded and stored using
objects. Scope settings for all engines are grouped together under a named
scope set. When first opened, default scope set ('Default') is created, but
users can define more scope sets and flip between them.
Since federated search support is part of
plug-in, a factory is needed to create search scope objects from the data in the
preference store. Clients that plug in scope preference pages are required to
plug in scope factories as well.
Engines defined in this extension point do not show up in the UI by default.
What is shown there is a concrete instance of a search engine that can be
individually modified. Products can pre-configure the help system with a number
of instances of the registered engine types, possibly parameterized to perform
in a desired way. In addition, users can add their own instances of the
registered engines and configure them to their liking: