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:
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:
http://server:port/metadata/solr/[provider]/search?q=actors:"tom"
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:
http://server:port/metadata/solr/[provider]/search?q=top&fq=actors:"tom cruise"
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):
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.
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:
http://server:port/metadata/solr/[provider]/search?q=sta wa&fq=scope:vod&sort=title asc
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":
http://server:port/metadata/solr/[provider]/search?q=sta wa&fq=domain:("iPad|" OR "Android|")
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:
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