Search Result Variables

In addition to the Global Template Variables, the following table lists all available search result variables that can be used to extend the functionality of the default search result templates or to create new templates from scratch.


Table 12. Search Result Variables

Variable Name Description

$$Author

The name of the original author of a document returned in a hit.

$$BeginAuthorized

Begins a section for a search result that the user has rights to see. Used in conjunction with $$EndAuthorized. If a search result is authorized, this section of text and template variables will be processed. If unauthorized, this section is removed from the output. See also $$BeginUnAuthorized.

$$BeginUnAuthorized

Begins a section for a search result that the user does not have rights to see. Used in conjunction with $$EndUnAuthorized. If a search result is not authorized, this section of text and template variables will be processed. If the search result is authorized, this section is removed from the output. See also $$BeginAuthorized.

$$EndAuthorized

Ends a section for a search result that the user has rights to see. For more information, see the description for the $$BeginAuthorized variable.

$$EndUnAuthorized

Ends a section for a search result item that the user does not have rights to see. For more information, see the description for the $$EndUnAuthorized variable.

$$Index

The name of the index in which a particular search result item was found.

$$DateTime[date_format]

The date and time of a hit. This is automatically written in Java's medium format using the client's locale (all calendars, translations, date and time formats are observed).

$$DateTime[ ] can use an optional date and time format provided within the brackets [ ]. The text should conform to the Java DateFormat syntax.

$$Description

The abstract, description, or first 255 display bytes of the result item.

$$FileFormat

Indicates a specific document type. For example, .DOC or .PDF.

$$FirstHit

The hit number of the first item in the current result page. Is displayed using the client's locale.

$$Language

The language of the result item. $$Language is displayed in the language of the client's locale.

$$LastHit

The hit number of the last item in the current result page. Is displayed using the client's locale.

$$MoreHits[page#, text]

A conditional text section to be included only if there are additional hits in the search results that can be retrieved.

If the first section of the conditional text contains a number followed by a comma (for example, $$MoreHits[3, text to be included]), then the server will first determine if the designated search results page exists. If the page# is missing, 1 (the next page) is assumed. If the designated page is available, the remaining text after the comma and up to the closing bracket is written to the result page.

Note that the initial number is relative to the current page. That is, -1 references the page immediately before the current page and 1 references the page immediately after. Zero refers to either the previous page or the next page.

$$MoreHitsURL[page_number]

The URL needed to display another page of search results. The optional parameter identifies the desired search result page number. If not provided, 1 is assumed. Note that the page number is relative to the current page. That is, -1 refers to the page immediately before the current page and 1 references the page immediately after. Zero (0) refers to the current page.

The URL is inserted only if the designated page exists.

$$Number

The hit number of the current result item. Possible numbers begin with 1 and end with $$TotalHits. Is displayed using the client's locale.

$$PageNum[page#]

Inserts a user-specified search result page number. The optional page# parameter identifies the relative page from the current result page. That is, minus one (-1) refers to the page immediately before the current page and one (1) references the page immediately after. Zero (0) refers to the current page.

The page number is inserted only if the designated page exists.

$$PrintURL[first_hit_number, number_of_hits]

The URL used to print the hits listed on the current search result page.

The optional parameters can be specified to define the beginning search result number and the number of search results to include in the print job.

The number_of_hits parameter can use the $$TotalHits template variable.

$$Relevance

How closley the result matches the user's query, indicated by percentages (1% to 100%).

$$SearchFor[number]

Query entered by the client into the search field. See $$Query[number] for more information.

$$SearchTime

Inserts the amount of time used to process the current search request. $$SearchTime is displayed using the client's locale.

$$Size

The size of the data pointed to by the result item's URL. Is displayed using the client's locale.

$$SortByURL[sortfield.sortorder ...]

The URL used to show the current result page sorted by one or more search result fields.

Sort field names include title, author, changedate, filelength, language, summary, relevance, url, index, format, and document_number.

Optional sort orders include ascending and descending.

Sort field and sort order names are separated by a period.

Multiple sort fields are separated by a space.

$$Title

If a title is not available in documents being searched, $$URL is used instead; if the URL is unavailable, < title unavailable > continues to be used.

$$TotalHits

The total number of hits that match the search query. This is not the same as the number of hits displayed in any particular result page. Is displayed using the client's locale.

$$URL

URL of the result item.



Previous | Next