Obsolete Pages{{Obsolete}}
The official documentation is at: http://docs.alfresco.com
OpenSearchWeb Scripts2.1
Welcome to the Alfresco OpenSearch WIKI.
Back to HTTP API.
NOTE:
This document describes features to be found in Alfresco v2.1 onwards.
Documentation for OpenSearch in Alfresco v2.0 can be found 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:
Alfresco exposes its search engines via OpenSearch and also provides a new aggregate open search feature in the Alfresco Web Client.
Sidebar Query:
Dashboard Query
Note: For details on general OpenSearch support such as Authentication, Response Formats and Logging see Web Scripts Framework.
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.
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:
http://<host>:<port>/alfresco/service/api/search/keyword?q={searchTerms}&p={startPage?}&c={count?}&l={language?}
where:
Raw data representation of the result set - useful for custom display rendering and aggregation of multiple result sets.
<feed xmlns='http://www.w3.org/2005/Atom' xmlns:opensearch='http://a9.com/-/spec/opensearch/1.1/' xmlns:relevance='http://a9.com/-/opensearch/extensions/relevance/1.0/'>
<generator version='2.0.0 (dev @build-number@)'>Alfresco (Community Network)</generator>
<title>Alfresco Search: alfresco tutorial</title>
<updated>2006-12-20T13:43:40GMT</updated>
<icon>http://localhost:8080/alfresco/images/logo/AlfrescoLogo16.ico</icon>
<author>
<name>admin</name>
</author>
<id>urn:uuid:19c2d38a-9030-11db-be55-975f5973e046</id>
<opensearch:totalResults>12</opensearch:totalResults>
<opensearch:startIndex>11</opensearch:startIndex>
<opensearch:itemsPerPage>10</opensearch:itemsPerPage>
<opensearch:Query role='request' searchTerms='alfresco tutorial' startPage='2'/>
<link rel='alternate' href='http://localhost:8080/alfresco/service/search/keyword?q=alfresco tutorial&p=2&c=10&guest=&format=html' type='text/html'/>
<link rel='self' href='http://localhost:8080/alfresco/service/search/keyword?q=alfresco tutorial&p=2&c=10&guest=&format=atom' type='application/atom+xml'/>
<link rel='first' href='http://localhost:8080/alfresco/service/search/keyword?q=alfresco tutorial&p=1&c=10&guest=&format=atom' type='application/atom+xml'/>
<link rel='previous' href='http://localhost:8080/alfresco/service/search/keyword?q=alfresco tutorial&p=1&c=10&guest=&format=atom' type='application/atom+xml'/>
<link rel='last' href='http://localhost:8080/alfresco/service/search/keyword?q=alfresco tutorial&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/description.xml'/>
<entry>
<title>RSS_2.0_recent_docs.ftl</title>
<link href='http://localhost:8080/alfresco/download/direct/workspace/SpacesStore/f01865f3-9022-11db-923d-5b4061816aa6/RSS_2.0_recent_docs.ftl'/>
<icon>http://localhost:8080/alfresco/images/filetypes/ftl.gif'</icon>
<id>urn:uuid:f01865f3-9022-11db-923d-5b4061816aa6</id>
<updated>2006-12-20T12:09:32GMT</updated>
<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>
<author>
<name>System</name>
</author>
<relevance:score>0.056</relevance:score>
</entry>
<entry>
<title>doc_info.ftl</title>
<link href='http://localhost:8080/alfresco/download/direct/workspace/SpacesStore/ef7d8547-9022-11db-923d-5b4061816aa6/doc_info.ftl'/>
<icon>http://localhost:8080/alfresco/images/filetypes/ftl.gif'</icon>
<id>urn:uuid:ef7d8547-9022-11db-923d-5b4061816aa6</id>
<updated>2006-12-20T12:09:32GMT</updated>
<summary>Displays useful information about the current document</summary>
<author>
<name>System</name>
</author>
<relevance:score>0.055</relevance:score>
</entry>
</feed>
Pre-formatted result set for display (currently used by Browsers) - for now, the HTML is not annotated with meta-data (e.g. micro-format).
http://<host>:<port>/alfresco/service/api/search/keyword/description.xml
To list all search engines registered with Alfresco, issue:
http://<host>:<port>/alfresco/service/api/search/engines[?type={type?}]
where:
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.
The following simple steps allow for Alfresco searches in your browser of choice:
The list of registered search engines accessible to Alfresco is configured in:
/config/alfresco/web-scripts-config.xml
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.
<config evaluator='string-compare' condition='OpenSearch'>
<opensearch>
<engines>
<engine label-id='keyword_search' label='Alfresco Keyword Search'>
<url type='application/opensearchdescription+xml'>/api/search/keyword/description.xml</url>
<url type='application/atom+xml'>/api/search/keyword?q={searchTerms}&p={startPage?}&c={count?}&l={language?}&guest={alf:guest?}&format=atom</url>
</engine>
</engines>
</opensearch>
</config>
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'>http://blogs.alfresco.com/opentalk/os-query?s={searchTerms}&itemstart={startIndex?}&itempage={startPage?}&itemlimit={count?}</url>
</engine>
When adding new search engines, the recommendation is to place them in:
/config/alfresco/extension/web-scripts-config-custom.xml
The following 'extension' configuration file provides sample search engine registrations for a remote Alfresco Repository and the on-line Alfresco 'Open Talk' Blog.
/alfresco/extension/web-scripts-config-custom.xml.sample
To enable these registrations...
This search engine acts as the entry point for all other 'proxied' search engines registered with Alfresco.
The search URL template is:
http://<host>:<port>/alfresco/service/api/search/engine/{engine}/{format}?[argName=argValue]*
where:
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.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.