Search For Content

Every entry in a subsection feed contains a link with the rel attribute http://www.vizrt.com/types/relation/content-items. This relationship indicates that the link points to a collection of all the content items belonging to the section. If a client application follows one of these links:

curl -u user:password -X GET http://host-ip-address/webservice/escenic/section/22/content-items

what is returned is an empty feed that contains no actual content item entries, but does contain a link with the rel attribute search.

<feed xmlns="http://www.w3.org/2005/Atom">
  <author>
    <name>Escenic Content Engine</name>
  </author>
  <id>http://host-ip-address/webservice/escenic/section/22/content-items</id>
  <link rel="self" 
        href="http://host-ip-address/webservice/escenic/section/22/content-items" 
        type="application/atom+xml"/>
  <updated>2010-06-03T12:19:57.058Z</updated>
  <author/>
  <title type="text">Content items for section with dbid="22"</title>
  <link rel="search" 
        href="http://host-ip-address/webservice/open-search/escenic/22/content-search-description.xml" 
        type="application/opensearchdescription+xml"/>
</feed>

If the client application then follows this link:

curl -u user:password -X GET http://host-ip-address/webservice/open-search/escenic/22/content-search-description.xml

The web service returns an OpenSearch document describing the URL format required to search through the section's content items:

<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>

From this information the client can construct a URL that submits a query and specifies how the results are to be returned. Note that two different query templates are supplied: one that returns an Atom feed suitable for further processing, and one that returns HTML suitable for display. To obtain an Atom feed, for example, the client might submit the following request:

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

You can use the tag={tagIdentifier?} component of the search template to search for content items with a specific tag. Note that you must specify the identifier of the required tag, not its title.