Searching

The Content Store web service includes a search service based on OpenSearch. OpenSearch is a standard for:

  • Describing how to search in Atom collections

  • Annotating search results returned in Atom feeds

For details see http://www.opensearch.org/Home. Using OpenSearch helps to ensure that the search service complies with REST principles, and can be searched by clients with no prior knowledge of the Content Store or its internal structures.

Every http://www.vizrt.com/types/relation/subsection entry feed returned by the web service contains an http://www.vizrt.com/types/relation/content-items link:

...
    <link rel="http://www.vizrt.com/types/relation/content-items" 
          href="http://host-ip-address/webservice/escenic/section/22/content-items" 
          type="application/atom+xml"/>
...
</feed>

This link returns an empty feed resource representing the collection of all content items in the section. It also, however, contains a search link:

<link rel="search" 
     href="http://host-ip-address/webservice/open-search/escenic/22/content-search-description.xml" 
     type="application/opensearchdescription+xml"/>

This link returns an OpenSearch document containing URI templates that can be used to search for content items in the section:

<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
  <ShortDescription>Escenic search</ShortDescription>
  <Description/>
  <Url type="application/atom+xml" 
       template="http://host-ip-address/webservice/publication/publication-name/search/escenic/22/
{searchTerms}/?pw={startPage?}&amp;c={count?}&amp;tag={tagIdentifier?}"/>
  <Url type="text/html" 
       template="http://host-ip-address/webservice/publication/publication-name/search/escenic/22/
{searchTerms}/?pw={startPage?}&amp;c={count?}&amp;tag={tagIdentifier?}&amp;format=html"/>
  <Contact>http://www.escenic.com/</Contact>
  <Tags/>
  <LongName>Escenic Content Engine Search</LongName>
  <Image height="16" width="16" type="image/x-icon">http://host-ip-address/webservice/images/ece.ico</Image>
  <Query role="example" searchTerms="cat"/>
  <Developer>Escenic AS</Developer>
  <Attribution/>
  <SyndicationRight>private</SyndicationRight>
  <AdultContent>false</AdultContent>
  <OutputEncoding>UTF-8</OutputEncoding>
  <InputEncoding>UTF-8</InputEncoding>
</OpenSearchDescription>

One of the templates returns results in a paged Atom feed, the other returns the results as HTML. The client can use one of them to construct and submit a search request:

curl -u user:password -X GET http://host-ip-address/webservice/escenic/publication/pub-name/search/22/Obama/?pw=1&c=10

If the Atom feed template (type="application/atom+xml") is used, then a paged Atom feed is returned in which the actual results are wrapped in an OpenSearch element and presented in elements belonging to a proprietary, undocumented and deprecated CCI Europe format identified by the namespace http://www.escenic.com/2007/content-engine. The use of this format is temporary and you should not invest any effort in attempting to make use of it: it will be replaced with a properly documented and supported format in a future version of the Content Store.