Skip to main content
Skip table of contents

Search

The search API allows the UI to provide search functionality. It is based upon the Lucene query engine, so all semantics and search rules from Lucene apply here. A number of entities from the core discovery APIs are ingested into the search index, including:

  • VOD Editorials
  • BTV Editorials
  • BTV Programmes
  • BTV Series

Each entity is represented by the same schema within the search API.

Basic search query with no filter

The simplest search is against all categories without any filtering:

XML
http://server:port/metadata/solr/[provider]/search?q=sta wa

This would match content such as:

  • Star Wars (due to start of word matching)

Search query on actor field only

To search a single field only (actors for example), specify the field upfront:

XML
http://server:port/metadata/solr/[provider]/search?q=actors:"tom"
The 'q' field stands for query. This is the main search query field.

This would bring back content such as:

  • Top Gun (starring Tom Cruise)
  • Forest Gump (starring Tom Hanks)
  • Inception (starring Tom Hardy)

Search query filtered by actor

Alternatively, to actively search for films starring a specific actor, it can be filtered as follows:

XML
http://server:port/metadata/solr/[provider]/search?q=top&fq=actors:"tom cruise"
The 'fq' or filter query field acts as a concrete filter, rather than a fuzzy search term as with 'q'.

This would only bring back films starring "tom cruise", so:

  • Top Gun

Search filtered by rating

A filter in SOLR can also be a range of values. The canonical example of a range filter is to only search within certain ratings or age groups. For example, to filter films suitable for age group 15 or less (in this example the rating code for the "15" age group being conveniently represented by the precedence value 15):

XML
http://server:port/metadata/solr/[provider]/search?q=actors:"tom"&fq=rating.precedence:[0 TO 15]

Search filtered by ancestor

There may be cases where the search may be restricted to a certain catalogue branch (e.g. search through the "Action Movie" catalogue tree). The "descendantsOf" field is used to search through records that appear beneath the "Action Movie" catalogue node.

XML
http://server:port/metadata/solr/[provider]/search?q=sta wa&fq=descendantsOf:Action_Movies

Search filtered by vod scope with sort applied

There are two distinct scopes available within the search results:

  • vod
  • btv

It is a common requirement to search only BTV or VOD results rather than both at the same time. In the example below, content is restricted to vod content only and sorted by title ascending:

XML
http://server:port/metadata/solr/[provider]/search?q=sta wa&fq=scope:vod&sort=title asc
It is generally not advised to sort the results due to the fact that SOLR provides a suitability ranking - the first record being the closest search match. Sorting removes this benefit.

Search filtered by domain (deviceType and region)

A domain is a deviceType and Region concatenated by a "|" like "ipad|France"; where all deviceTypes are appropriate, the deviceType can be left blank. Equally where all regions are appropriate, the region can be left blank. e.g. ipad in all regions "ipad|" and all devices in a region "|France". For example, any content suitable for devices "iPad" or "Android":

XML
http://server:port/metadata/solr/[provider]/search?q=sta wa&fq=domain:("iPad|" OR "Android|")
The use of "descendantsOf" and "domain" together may bring unexpected results. It is possible for an asset to be a descendant of "Action_Movies" and be in the domain "ipad|". However, it is also possible that the asset under "Action_Movies" is not suitable for an iPad, in which case, the iPad version of this asset would be stored under a different catalogue node. The asset would still be returned in the results because it is available in "Action_Movies" and as an iPad asset.

Search filtered by entity

The SOLR schema caters for multiple entity types, for example:

  • series
  • content
  • programme
  • etc

Filter by entity type to search through different types of object. Below is an example of searching for series only:

XML
http://server:port/metadata/solr/[provider]/search?q=fr&fq=entity:series

This would give results such as :

  • Friends Season 1
  • Friends Season 2
  • Friends Season 3

See also​

Metadata Server (MDS) API Documentation

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.