OpenWGA 7.0 - TMLScript reference
Object:
ResultSet
Description |
The ResultSet object represents the returned documents from a query of any type. The ResultSet may be regarded a collection like Lists and Lookup tables. But unlike these a ResultSet does not need to instantly load all the data that it is able to return. It instead is capable of only loading the set of data that is requested on its methods. This makes it a suitable for treating large result sets effectively, as only the documents that are requested are loaded. A ResultSet is iterable in JavaScript, so it may be used as parameter for the JavaScript function Iterator(). The returned objects are WGAPI WGContent objects representing the rest set contents. A ResultSet may be returned by a <tml:script> tag as tag result and then picked up by a <tml:foreach> tag to iterate over the values.
|
||||||
Retrieval |
Database queries for method query() of WGAPI object WGDatabase |
||||||
Allowed in script types |
|
||||||
Properties and methods |
|
||||||
Examples |
Using a ResultSet object with JavaScript iterator: var resultSet = WGA.app().query("lucene", "WGA").set(); for (c in Iterator(resultSet)) { addWarning(c.title); } Returning a ResultSet as tag result of <tml:script>, then pick that up with a <tml:foreach> tag for iterating: <tml:script id="thesearch" output="none"> return WGA.app().query("lucene", "WGA").set() </tml:script> <tml:foreach sourcetag="thesearch"> <tml:meta name="title"/><br> </tml:foreach> |