Table of Contents
This document describes the objects within the Velocity Context that are available from the Search Templates included with the SiteSeeker Search module for SiteVision.
In addition to the objects listed below, the GenericTools are available. Documentaion can be found at the Apache Velocity Project home page.
Table 1.
Object | Type | Description |
---|---|---|
$ages | Age[] | Age filter: List of available options. The age filter narrows down the query by modification date, e.g. "last week". |
$bestBets | BestBet[] | List of Best Bets. Best Bets are hits that are similar to "sponsored links" and are added by SiteSeeker administrators. |
$categoryGroups | CategoryGroup[] | Category filter: List of available options, divided by category group.
Each category group contains a list of categories;
Category[]
|
$fileFormats | FileFormat[] | File format filter: List of available options. The file format filter narrows down the query by file format, e.g. "html" or "pdf". |
$hits | Hit[] | List of hits. |
$lang | LanguageResource | Localisation manager. Provides a localised version of a text string for display on the search page. |
$languages | Language[] | Language filter: List of available options. The language filter narrows down the query by language, e.g. "English". |
$message | String | A natural language message describing the interpreted query and the number of results, to be displayed to the user, e.g. "45 hits for annual report in Press Room". |
$pageLinks | PageLink[] | Pagination links. Use this list of links to implement a pagination widget. |
$portletId | String | Identifier of this portlet instance. |
$query | String | Search query. |
$requestParameters | RequestParameters | The names of the request parameters handled by the SiteSeeker search portlet. |
$searchPageId | String | The SiteVision identifier of the current page. |
$sessionId | String | The current user's browser session identifier. |
$sortOrders | SortOrder[] |
The following predefined sort orders:
|
$spellingSuggestions | SpellingSuggestion[] | List of spelling suggestions. |
$uiLanguage | String | Contains the language code for this page, which will either be the empty string or a lowercase ISO 639 code. |
$url | String | The URL for the portlet. Use this in the action attribute of the HTML form. |
$util | SearchPortletUtil[] | Collection of methods for (un)escaping XML and encode/decode URL strings. |
Table 2. Age
Represents an age filter option.
Property | Type | Description |
---|---|---|
.ClickUrl | String | URL to the search page with this filter option applied. |
.GroupName | String | Symbolic name of this filter, i.e. "age". The symbolic name may be used as a key for localisation. |
.Id | Integer | The identifier of this filter option. |
.IsSelected | Boolean | Returns true if this option is currently applied. False otherwise. |
.Name | String | Symbolic name of this filter option (e.g. "yesterday", "week" or "any"). The symbolic name may be used as a key for localisation. |
.NHits | Integer | Number of hits matching this filter option. |
.NPages | Integer | Total number of pages matching this filter option (regardless of the query). |
Table 3. BestBet
Property | Type | Description |
---|---|---|
.Description | String | The description of the current best bet. May contain HTML code. |
.IsExternal | Boolean | True if best bet is referring to an external location, false if it is a local reference. |
.Keywords | String[] | List of keywords matching this best bet. |
.Number | Integer | Ordinal number of this best bet. |
.Title | String | Title of the best bet, with formatting. |
.TitleNoFormatting | String | Title of the best bet, without formatting (HTML tags). |
.Url | String | The URL to the content of this best bet. |
Table 4. Category
Represents a category filter option.
Property | Type | Description |
---|---|---|
.ClickUrl | String | URL to the search page with this filter option applied. |
.GroupName | String | The localised name for the category group. |
.Id | Integer | The identifier of this filter option. |
.IsSelected | Boolean | Returns true if this option is currently applied. False otherwise. |
.Name | String | The localised name for the category. |
.NHits | Integer | Number of hits matching this filter option. |
.NPages | Integer | Total number of pages matching this filter option (regardless of the query). |
Table 5. CategoryGroup
Property | Type | Description |
---|---|---|
.Id | Integer | An identifier of the category group. |
.Name | String | The name of the category group. |
.Categories | Category[] | The category objects of this group. |
.NCategoriesWithHits | Integer | Returns the number of categories in this group that contains one or more hits. This is useful when listing the category groups, if you want to exclude groups which do not contain any categories with hits that match the current search. |
Table 6. FileFormat
Represents a file format filter option.
Property | Type | Description |
---|---|---|
.ClickUrl | String | URL to the search page with this filter option applied. |
.GroupName | String | Symbolic name of this filter, i.e. "doctype". The symbolic name may be used as a key for localisation. |
.Id | Integer | The identifier of this filter option. |
.IsSelected | Boolean | Returns true if this option is currently applied. False otherwise. |
.Name | String | Symbolic name of this filter option (e.g. "doc", "pdf" or "html"). The symbolic name may be used as a key for localisation. |
.NHits | Integer | Number of hits matching this filter option. |
.NPages | Integer | Total number of pages matching this filter option (regardless of the query). |
Table 7. Hit
A hit holds dynamic, i.e. query specific, and static information of
an indexed page matching the current search request. Hit objects are available
in the $hits[]
array.
Property | Type | Description |
---|---|---|
.Number | Integer | An ordinal number of the hit for the current search request. |
.Title | String | The title of the indexed page. |
.DynamicSnippet | String | A dynamic (query specific) snippet (summary) of the indexed page. |
.Meta.<name> | String | Get the value of the typed meta data parameter <name> . If the requested meta data parameter does not exist,
null will be returned, which can be used for selection. If it does exist, the value is a string, which optionally can be converted
into an integer or a float (for logical comparison). To do so, add .Integer or .Float after the meta parameter. For example, #if ( $hit.Meta.Price ) $hit.Meta.Price.Integer #end
will print the meta data named Price, if it exists in $hit , converted to an Integer. |
.MetaDescription | String | An optional meta description of the indexed page. See also: http://www.siteseeker.se/sv/kunskapsdatabas/faq/soksidan/metabeskrivningar/. |
.MetaIdentifier | Integer | An optional meta identifier for the indexed page. |
.Size | Integer | The size of the indexed page in bytes. |
.StaticSnippet | String | The value of an optional "eri-desc"-section within the indexed page. See also: http://www.siteseeker.se/sv/kunskapsdatabas/faq/soksidan/brodsmulor-i-trafflistan/ a.k.a "eri-desc"-sections. |
.HumanReadableSize | String | The size of the indexed page in bytes, kB, MB or GB, depending of the size in bytes |
.Url | String | The raw URL of the page. |
.CacheUrl | String | URL of a cached version of the indexed page with the current query terms highlighted. |
.SortDate | String | The date and time used for sorting and filtering of the indexed page. |
.YearMonthDay | String | The date expressed as YYYY-MM-DD. |
.IsInFrame | Boolean | Indicates whether the indexed page was found in an HTML frame or not. |
.Rank | Integer | The rank of the hit. Rank is an integer between 0 and 30. Higher value corresponds to higher ranking. |
.FileFormat | FileFormat | The type of the document, HTML, PDF etc. |
.Categories | Category[] | List of categories. |
.Attachments | Hit[] | List of other hits attached to this hit. |
Table 8. Language
Represents a language filter option.
Property | Type | Description |
---|---|---|
.ClickUrl | String | URL to the search page with this filter option applied. |
.GroupName | String | Symbolic name of this filter, i.e. "language". The symbolic name may be used as a key for localisation. |
.Id | Integer | The identifier of this filter option. |
.IsSelected | Boolean | Returns true if this option is currently applied. False otherwise. |
.Name | String | Symbolic name of this filter option (e.g. "sv", "en" or "no"). The symbolic name may be used as a key for localisation. |
.NHits | Integer | Number of hits matching this filter option. |
.NPages | Integer | Total number of pages matching this filter option (regardless of the query). |
Table 9. LanguageResource
Method | Type | Description |
---|---|---|
.get(String $key) | String | Returns the localised text string for the given $key . |
Table 10. PageLink
Property | Type | Description |
---|---|---|
.ClickUrl | String | The URL pointing at the result page. |
.IsHidden | Boolean | Determines if this page link is hidden in the pager. A hidden page link is usually displayed as dots (...) in the pager view. |
.IsSelected | Boolean | Determines if this page link points at the currently viewed/selected page. |
.PageNumber | Integer | The ordinal number of the search result page that this link points at. First page has page number 1. |
Table 11. RequestParameters
Property | Type | Description |
---|---|---|
.Query | String | The name of the search query parameter. |
.Age | String | The name of the age filter parameter. |
.Categories | String | The name of the categories filter parameter. |
.FileFormat | String | The name of the file format filter parameter. |
.Language | String | The name of the language filter parameter. |
Table 12. SearchPortletUtil
Method | Type | Description |
---|---|---|
.escapeXml(String $xml) | String |
Escapes the characters in a String using XML entities.
For example: "bread" & "butter" ⇒ "bread" & "butter" .
Supports only the five basic XML entities (gt, lt, quot, amp, apos ).
Note that unicode characters greater than 0x7f are currently escaped to their numerical \\u equivalent.
|
.unescapeXml(String $escapedXml) | String | Unescapes a string containing XML entity escapes to a string containing the actual Unicode characters corresponding to the escapes. |
.urlEncode(String $url) | String | Translates a string into application/x-www-form-urlencoded format. |
.urlDecode(String $encodedUrl) | String | Decodes an application/x-www-form-urlencoded string. |
Table 13. SortOrder
Property | Type | Description |
---|---|---|
.Id | Integer | An identifier of the sort order. |
.Name | String | The name of the sort order. |
.SelectUrl | String | The URL to be used for selecting the sort order. |
Table 14. SpellingSuggestion
Property | Type | Description |
---|---|---|
.Terms | String | The suggested terms. |
.TermsNoFormatting | String | Same as .Terms but without HTML markup. |
.RequestUrl | String | The URL to be used for sending a new search request with the suggested query terms. |