Release 1.3 - ...
<masterquery> element
This element contains the masterquery configuration. All these elements are used when constructing the main search query and is also defines the paging query.
Example
XML |
Copy Code
|
<masterquery>
<query><![CDATA[
SELECT {this.selectfields()}
FROM {this.tableorview()} c
JOIN (
SELECT {this.rankingfields()}
FROM (
{this.searchquery(default="SELECT Nr, 0 As SearchRank FROM Contents WHERE Nr=-1")}
) rq
GROUP BY rq.Nr
) vt2 ON c.Nr=vt2.Nr
{this.joinclause(default="")}
WHERE {this.whereclause(default="(1=1)")}
]]>
</query>
<fields>
ROW_NUMBER() OVER (ORDER BY searchrank DESC, c.Nr) AS rownum, c.Nr AS Nr, CAST(vt2.searchrank AS INT) AS searchrank, c.contenttype, c.author, c.ModDate AS ModDate, c.Title AS Title, c.Description AS Description, c.Body AS Body, ft.FileExtension
</fields>
<joins>
JOIN FileTypes ft ON c.FileType=ft.Nr
</joins>
<unionclause> UNION ALL </unionclause>
<rankingfields>
nr, SUM(searchrank) AS searchrank
</rankingfields>
<paging><![CDATA[
SELECT * FROM (
{this.searchquery(default="SELECT Nr, 0 As SearchRank FROM Contents WHERE Nr=-1")}
) x
WHERE rownum BETWEEN ?:lowerbound AND ?:upperbound
]]>
</paging>
</masterquery>
|
Attributes
Attribute name |
Required |
Description |
connection |
No |
Connection id, which shoud refer to an existing database id within the Smartsite.Data.config. Can be used to create a Faceted Search environment embedded in the local site, but which searches through an external database. |
defaultsources |
No |
Determines the default (initial) sources which are included within theĀ (initial) search result. When the Faceted Search Environment includes the sources facet, the user can then select a different (set of) source(s) which must be included within the search result. When this attribute has not been specified, the first source specified within the query xml will be used. |
Parent element
Element name |
Description |
<configuration> |
Master (such as the masterquery properties) configuration. |
Child elements
Element name |
Description |
<query> |
Defines the masterquery. |
<fields> |
Defines the select fields used within the masterquery. |
<joins> |
Defines the JOIN clauses in use within the masterquery. |
<unionclause> |
Defines the union clause. |
<rankingfields> |
Defines the select fields for the ranking query. |
<paging> |
Defines the (outer) paging query. |