The SearchResults class
Support in HbbTV
Available since: HbbTV 1.5 (ETSI TS 102 796 V1.2.1, OIPF DAE V1.2)
Comment
Broadcast-related
The SearchResults class represents the results of a metadata search. Since the result set may contain a large number of items, applications request a ‘window’ on to the result set, similar to the functionality provided by the OFFSET and LIMIT clauses in SQL.
Applications MAY request the contents of the result in groups of an arbitrary size, based on an offset from the beginning of the result set. The data SHALL be fetched from the appropriate source, and the application SHALL be notified when the data is available.
The set of results SHALL only be valid if a call to getResults()has been made and a MetadataSearch event notifying the application that results are available has been dispatched. If this event has not been dispatched, the set of results SHALL be empty (i.e. the value of the totalSize property SHALL be 0 and calls to item() SHALL return undefined).
In addition to the properties and methods defined below a SearchResults object SHALL support the array notation to access the results in this collection.
Properties
readonly Integer length |
The number of items in the current window within the overall result set. The value of this property SHALL be zero until getResults()has been called and a MetadataSearch event notifying the application that results are available has been dispatched. If the current window onto the result set is in fact the whole result set then length will be the same as totalSize. Otherwise length will be less than totalSize. |
readonly Integer offset |
The current offset into the total result set. |
readonly Integer totalSize |
The total number of items in the result set. The value of this property SHALL be zero until getResults() has been called and a MetadataSearch event notifying the application that results are available has been dispatched. |
Methods