Add The Search to a Publication
To make the external search service available in a particular
publication, you need to add a ui:opensearch
element
(see
opensearch)
to the publication's content-type
resource. The
ui:opensearch
element must be added as the child of a
ui:group
element. So you can either create a new
ui:group
for the ui:opensearch
element, or add the ui:opensearch
element to an
existing ui:group
.
For example:
<ui:group name="external-search"> <ui:label>External</ui:label> <ui:opensearch name="search-plugin-name" src="external-service-name" mime-type="application/atom+xml;type=feed"/> </ui:group>
The important points here are:
-
The value of the
name
attribute (search-plugin-name) must be the component name you used registering your plug-in component (see Define a Named Service Resolver). -
The value of the
src
attribute (your-service-name) must be the service name you used when setting up the named service resolver (see Create a Search Plug-in Component).
Once you have done this and redeployed your
content-type
resource, then the search group
External will appear in the
Content Studio
search panel. If you select it and execute a search, then only the
external system will be searched. If you select the
All group, then the external system will be search
alongside the
Content Engine
and the results will be a mixture of external and internal results. You
will also get mixed internal and external results if you create a
ui:group
that contains both ui:opensearch
and ui:ref-content-type
elements.
You need to add similar entries to the content-type
resources of all publications in which the external search functionality
is required.