Previous Page: Exploring Search Page Variables  Next Page: Exploring Print Result Variables

Exploring Search Result 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 5. Search Result Variables

Variable Name Description of Use

$$Author

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

$$DateTime[dateformat]

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 1st 255 display bytes of the result item.

$$IncludeFiletemplatename

See the description for this variable in Table 4.

$$Language

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

$$Number

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

$$Relevance

The significance of the current result item. 1% - 100%.

$$Size

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

$$Title

Title of the result item. For empty titles, <title unavailable> is displayed. The TITLE variable is localized using the client's locale.

$$URL

URL of the result item.

$$BeginLoop

End of the header section. Beginning of the repeating body section. This section is repeatedly parsed until there are no further result items to process.

$$EndLoop

End of the repeating body section. Beginning of the footer section.

$$BeginCollectionsLoop

The beginning of a repetitive section that will be re-processed for each collection the user specified in the search query. See also $$QueryCollection

$$EndCollectionsLoop

The end of a repetitive section that will be re-processed for each collection the user specified in the search query. See also $$QueryCollection

$$BeginReturnFieldsLoop

The beginning of a repetitive section that will be re-processed for each return field the user specified in the search query. See also $$QueryReturnField

$$EndReturnFieldsLoop

The end of a repetitive section that will be re-processed for each return field the user specified in the search query. See also $$QueryReturnField

$$Countervariablenumber, incrementnumber

See the description for this variable in Table 4.

$$FirstHit

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

$$LastHit

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

$$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. $$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 refers to the current page.

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

$$TemplateName

See the description for this variable in Table 4.

$$TemplateLocale

See the description for this variable in Table 4.

$$TemplateTheme

See the description for this variable in Table 4.

$$ResultEncoding

See the description for this variable in Table 4.

$$SearchFor

Query entered by the client into the search field.

$$SearchTime

Inserts the amount of time used to process the current search request. $$SearchTime 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 (e.g. $$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.

$$MoreHitsURLpagenumber

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 of 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 refers to the current page.

The URL is inserted only if the designated page exists.

$$PrintURLfirsthitnumber, numberofhits]

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 numberofhits parameter can use the $$TotalHits template variable.

$$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, and document_number.

Optional sort orders include ascending and descending.

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

Multiple sort fields are separated by a space.

$$NumQueryItems

The number of query items contained within the current query. While most queries use only 1 query item, it is possible to construct a query with multiple search criteria, each weighted with a value between 1 and 100. While the resultant search contains hits from each of the queries, the search results are organized with the most relevant hits first (from any of the individual queries).

$$QueryCollection

The name(s) of the collections the user specified in the search query. See also $$Begin/EndCollectionsLoop

$$QueryCountry

The country requested by the client. Note that this must be an upper-case, 2-character value as specified in ISO 3166-1.

$$QueryDate

The begin date requested by the client.

$$QueryLanguage

The language requested by the client. Note that this must be a lower-case, 2-character value as specified in ISO 639.

$$QueryNumHits

The number of search results requested by the client.

$$QueryOperator

The type of the current search:

  • Zero (0) = boolean AND search
  • One (1) = boolean OR search
  • Two (2) = phrase search

$$QueryReturnField

The name(s) of the return fields the user specified in the search query. See also $$Begin/EndReturnFieldsLoop

$$QueryTemplate

The template name requested by the client.

$$QueryVersion

The version number of the current query format.



  Previous Page: Exploring Search Page Variables  Next Page: Exploring Print Result Variables