Platform API‎ > ‎

Full Text Searching

Each Platform Store maintains a full text index of the RDF content in it's Metabox and this index can be searched using the search service. The basic search capability is required to perform searches. At present, the Search service and HTML form are accessed via the URI of the Store's Contentbox. This is a little confusing given that the search is over an index of the RDF in the Metabox, and maybe changed at some point in the future (though the API will maintain backwards compatibility wherever possible).

The supported search syntax is documented in Text Search Syntax. The following sections have some notes on sorting and post-processing of results.

A successful search will return an RSS 1.0 document. The service supports transformation of search result to create other formats.


URI Pattern

http://api.talis.com/stores/{storename}/items


Resource Operations

URI PatternMethodRequest BodySemanticsCapability required
/{storename}/itemsGETRetrieve a query formbasic search
/{storename}/items?query=GETSearch the Contentboxbasic search
/{storename}/itemsPOSTAny media typeStore Content in the Contentboxfull update


Request Parameters

ParameterRequired?DescriptionValues
queryYes (for searching)The query expression used to query the content boxAny valid Text Search Syntax
maxNoSpecify maximum number of results for a searchA positive integer. Default is 10. There is a fixed maximum of 100 results.
offsetNoSpecify an offset into search results. Use with maxto implement paging.An integer greater than zero.
sortNoSpecify a sort order for the searchA comma separated list of field names that should be used to order the results. Append :d to a field name to sort in descending order. See Sorting Search Results.
xslNoAn XSLT stylesheet to apply to the results. SeeTransforming Search Results.The URI of a stylesheet
content-typeNoSpecify the content type for delivering transformed search resultsA mime media type


Searching The Contentbox

Sorting Search Results

The sort parameter can be used to specify a sort order for search results. The value of the parameter should be a comma-separated list of field names that should be used for ordering. By default fields are sorted in ascending order. To specify descending ordering, add a :d suffix to the field name.

The names of the fields in a search, including ordering, is specified by the Field Predicate Map for the Store.


Transforming Search Results

An XSLT stylesheet can be applied to search results in order to generate alternate formats. As the stylesheet may generate any number of different mime types, the content-typeparameter can be specified to specify the mime type of the generated document.

Additional URL parameters will be provided to the XSLT stylesheet. Read the docs for the Transformation Service for additional notes on the XSLT functionality.


Caching Support

Responses from the Contentbox search functionality include HTTP caching headers: Last-Modified and ETag. This allows clients to use an HTTP Conditional Get in order to optimize repeated fetching of search results.

As the search results are delivered as an RSS 1.0 feed, this also means that well-designed feed readers should only re-fetch the feed when it has been changed.

Comments