With this OpenSearch plug-in developed for Atlassian's Confluence, you make it possible to search your Confluence site from the outside with an OpenSearch client. Atlassian's Confluence is an enterprise wiki for sharing knowledge that comes with its own search engine. By using OpenSearch to search through your Confluence from another website, you continue to use Confluence's own search engine.
Federated/aggregated search
The company this plug-in was built for, has many sources employees want to search through, looking for information on a subject. These many sources include different file systems holding documents that have been written during many years, documents published on websites, databases/websites with documentation on specific subjects, e-mail, and a Confluence installation used by the IT-department.
We want to make it possible for employees to search through all the sources in a single search action and we want to use OpenSearch to make it happen. "OpenSearch is a collection of simple formats for the sharing of search results." For the sources in our case that means that they have to return search results in such a format, and an OpenSearch client must be able to interpret these formats so that search results can be aggregated and presented together.
The Confluence plug-in we are talking about here makes our Confluence source return search results in an OpenSearch format. (The URL you need for this is described in the OpenSearch description.)
Examples of public OpenSearch clients, doing the request, reading the results and aggregating and presenting the results in a single page are http://a9.com and http://osfeed.com. You can register your OpenSearch enabled site at http://osfeed.com if your pages are accessible for everyone.
An OpenSearch client that can be used within this company is currently being built, because such a client does not yet seem to exist.
The search box in a browser's toolbar.
The browsers 'Search Engine List' (Mozilla 5) or 'Instant Search Box' (IE 7) is also using the OpenSearch standard. To be able to add your Confluence to the search engine list of your browser you do not need this plug-in, but you need to make an OpenSearch description and add it to your site. (See How to configure Confluence for the browser's search engine list.)
The OpenSearch description (example opensearch.xml) describes the URL's with which you can do a search request and get results back in a standard format, RSS or Atom. Normally an OpenSearch client would read this file and use the URLs but you can also just try them in a browser.
Snipped from the OpenSearch description (with line breaks inserted for legibility):
...
<Url type="application/atom+xml"
template="http://yourdomain/plugins/servlet/opensearch?
searchfor={searchTerms}&startIndex={startIndex}&itemsPerPage={count}&
un={custom:userName}&pw{custom:passWord}&format=atom"/>
<Url type="application/rss+xml"
template="http://yourdomain/plugins/servlet/opensearch?
searchfor={searchTerms}&startIndex={startIndex}&itemsPerPage={count}&
un={custom:userName}&pw{custom:passWord}&format=rss"/>
...The 'searchfor' parameter in the URL behaves the same as Confluence's 'dosearchsite' action, which is the simple one field search that appears by default in the top right corner. Besides the 'searchfor', none of the parameters in the URL are required. Below you find a few examples of how the URL parameters can be used.
http://yourdomain/plugins/servlet/opensearch?searchfor=cookbooks&format=rsshttp://yourdomain/plugins/servlet/opensearch?searchfor=cookbooks&un=username&pw=passwordhttp://yourdomain/plugins/servlet/opensearch?searchfor=cookbooks&startIndex=21&itemsPerPage=20 To install the plug-in you need to:
Release notes:
To be able to add Confluence to your browser's search engine list you need to configure the following:
<link rel="search" type="application/opensearchdescription+xml"
href="{/../os-description.xml}" title="My Confluence"/>(Replace the value of href.)
Please send comments on this article to editorial@lunatech.com.
Copyright © 2005-2012, Lunatech Research B.V. Tous droits réservés.