OpenSearch Alfv2.0

Showing results for 
Search instead for 
Did you mean: 

OpenSearch Alfv2.0

0 0 2,852

Obsolete Pages{{Obsolete}}

The official documentation is at:

Web ScriptsOpenSearch2.0

Welcome to the Alfresco OpenSearch WIKI.


This document describes OpenSearch capability that is available IN Alfresco v2.0.

Documentation for OpenSearch in Alfresco v2.1 onwards is here.


OpenSearch is a collection of simple formats for sharing of search results, extending existing schemas such as ATOM and RSS. Execution of searches is supported via HTTP requests and responses.

OpenSearch comprises of:

  • Description documents that describe the availability of a search engine
  • Template Urls that describe how to invoke a search
  • Paged search results in (extended) ATOM, (extended) RSS and HTML
  • Auto-discovery of Description documents

Alfresco exposes its search engines via OpenSearch and also provides a new aggregate open search feature in the Alfresco Web Client.

Alfresco OpenSearch engines

  • Keyword (Google-like) search as available in Alfresco Web Client
Alfresco Web Client aggregate OpenSearch

Note: For details on general OpenSearch support such as Authentication, Response Formats and Logging see HTTP API.

Note: Advanced Web Client Search and Query Language searches will be OpenSearch enabled some time in the future, probably in line with up-and-coming CM standards.

Search Engine Registry

To list all search engines registered with Alfresco, issue:


Note: v2.0 Preview only supports the URL


  • type (optional) : the type of search engine URL to list - one of the following values:
    • description (default) : open search description entries
    • template : template search URL entries
    • all : all entries

Response Formats:

  1. HTML(default)
  2. ATOM

Auto-discovery of Search Engines

The HTML response of the above request contains OpenSearch meta-data that lists the available search engines.  OpenSearch clients such  as Internet Explorer 7 and Firefox 2 are sensitive to this data, allowing very simple registration of Alfresco search engines in a search client.

Search Alfresco with FireFox 2 and Internet Explorer 7

The following simple steps allow for Alfresco searches in your browser of choice:

  1. Visit http://<host>:<port>/alfresco/service/search/engines
  2. The browser 'drop-down' search control will glow indicating a new search engine is available
  3. Click the drop-down and add the appropriate Alfresco search engine
  4. Type some keywords into the Browser search box and execute search
  5. Enter Alfresco user name and password
  6. Browse search results (page forward/back) and view content

Registering new Search Engines

The list of registered search engines accessible to Alfresco is configured in:


The configuration is organised as a list of engines where each engine may present one or more URLs for issuing a search. Each URL supports a specific search response mimetype and may include OpenSearch description documents. Only search engines with RSS o Atom responses are displayed in the OpenSearch sidebar or dashboard within Alfresco.

<config evaluator='string-compare' condition='OpenSearch'>

       <engine label-id='keyword_search' label='Alfresco Keyword Search'>
         <url type='application/opensearchdescription+xml'>/service/search/keywordsearchdescription.xml</url>
         <url type='application/atom+xml'>/service/search/keyword?q={searchTerms}&p={startPage?}&c={count?}&l={language?}&guest={alf:guest?}&format=atom</url>


Sometimes, it is necessary to configure a search engine proxy.  This means that the OpenSearch client indirectly submits a search request via the Alfresco Web Server (i.e. the proxy), rather than directly to the search engine.  This is particularly useful in scenarios where the client is an AJAX based browser limited by cross-domain scripting locks.

Creating a search engine proxy is as simple as adding the proxy attribute to the engine configuration.  The value of this attribute is a unique name that identifies the engine.

<engine label='Alfresco Open Source Talk' proxy='opentalk'>
  <url type='application/rss+xml'>{searchTerms}&amp;itemstart={startIndex?}&amp;itempage={startPage?}&amp;itemlimit={count?}</url>

When adding new search engines, the recommendation is to place them in:


Example Search Engine Registrations

The following 'extension' configuration file provides sample search engine registrations for a remote Alfresco Repository and the on-line Alfresco 'Open Talk' Blog.


Other Examples:

<engine label='Yahoo UK News' proxy='yahooUKNews'>
   <url type='application/rss+xml'>{searchTerms}

<engine label='Yahoo Search' proxy='yahoo'>
   <url type='application/rss+xml'>{searchTerms}&start={startIndex?}&results={count?}

<engine label='Wikipedia Search' proxy='wikipedia'>
   <url type='application/rss+xml'>{searchTerms}&{startIndex?}&results={count?}

<engine label='Yahoo Image Search' proxy='yahooImage'>
   <url type='application/rss+xml'>{searchTerms}&start={startIndex?}&results={count?}

To enable these registrations...

  1. Rename web-api-config-custom.xml.sample to web-api-config-custom.xml
  2. Within .xml file, find & replace [host] with server name of remote repository
  3. Within .xml file, find & replace [port] with server port of remote repository
  4. Re-start Alfresco server

Alfresco Keyword Search

This search mimics the keyword search of the Alfresco Web Client.  Documents containing the specified keywords in their name or content are returned.

The search URL template is:



  • searchTerms = keyword or keywords to search with
  • startPage (optional) = the page number of search results desired by the client
  • count (optional) = the number of search results per page (default: 10)
  • language (optional) = the locale to search with (XML 1.0 Language Id e.g. en-GB)

Response Formats:

  • HTML(default)
  • ATOM
  • RSS

Example Responses


Raw data representation of the result set - useful for custom display rendering and aggregation of multiple result sets.

<feed xmlns='' xmlns:opensearch='' xmlns:relevance=''>
  <generator version='2.0.0 (dev @build-number@)'>Alfresco (Community Network)</generator>
  <title>Alfresco Search: alfresco tuturial</title>
  <opensearch:Query role='request' searchTerms='alfresco tuturial' startPage='2'/>
  <link rel='alternate' href='http://localhost:8080/alfresco/service/search/keyword?q=alfresco tuturial&p=2&c=10&guest=&format=html' type='text/html'/>
  <link rel='self' href='http://localhost:8080/alfresco/service/search/keyword?q=alfresco tuturial&p=2&c=10&guest=&format=atom' type='application/atom+xml'/>
  <link rel='first' href='http://localhost:8080/alfresco/service/search/keyword?q=alfresco tuturial&p=1&c=10&guest=&format=atom' type='application/atom+xml'/>
  <link rel='previous' href='http://localhost:8080/alfresco/service/search/keyword?q=alfresco tuturial&p=1&c=10&guest=&format=atom' type='application/atom+xml'/>
  <link rel='last' href='http://localhost:8080/alfresco/service/search/keyword?q=alfresco tuturial&p=2&c=10&guest=&format=atom' type='application/atom+xml'/>
  <link rel='search' type='application/opensearchdescription+xml' href='http://localhost:8080/alfresco/service/search/keyword/keywordsearchdescription.xml'/>
    <link href='http://localhost:8080/alfresco/download/direct/workspace/SpacesStore/f01865f3-9022-11db-923d-5b4061816aa6/RSS_2.0_recent_docs.ftl'/>
    <summary>Renders a valid RSS2.0 XML document showing the documents in the current space created or modified in the last 7 days. The template should be configured to use the appropriate server and port before use.</summary>
    <link href='http://localhost:8080/alfresco/download/direct/workspace/SpacesStore/ef7d8547-9022-11db-923d-5b4061816aa6/doc_info.ftl'/>
    <summary>Displays useful information about the current document</summary>


Pre-formatted result set for display (currently used by Browsers) - for now, the HTML is not annotated with meta-data (e.g. micro-format).

Description Document


Response Formats:

  • opensearchdescription (default)

Alfresco Proxy Search

This search engine acts as the entry point for all other 'proxied' search engines registered with Alfresco.

The search URL template is:



  • engine = the name of the registered 'proxied' search engine
  • format = the specific engine url to proxy (as defined by response mimetype)

All URL arguments are passed as is to the proxied engine URL.  The response type is of the mimetype defined by format.

OpenSearch paging links within ATOM & RSS responses are re-written so that they are 'proxied' too.