Hit List Component

The Hit List displays the results for a given query. The Hit List also allows for links that target another template so that the content represented by the result may be displayed in the browser when the user clicks on it.

Function Names

Name Description
Hitlist Displays the results for a given query

URL Parameters

The Hit List component has the most complex URL syntax of any component. Usually, you make a call to the Hit List to set up its default configuration. The Hit List then stores those parameters in its session specific property bag and references them when other calls are made. (The property bag stores session information, much the same way a cookie does, except that the information is stored on the server.)

These other calls include things like changing the query, clearing the query, going to the next/previous group of hits, or displaying the hit result in the document frame.

Generally, you use Hit List parameters as follows:

Parameter Purpose
INIT When you first use the template
QRY Each time you change the query
NAV When you want to go to next or previous hit
RD When you redirect the Hit List to the target document (when a link is targeted to the document frame and you use the Hit List to temporarily prepare the Document component with the correct hit location and highlighting.

Hit List Variables

Name Use Possible Values Description
f n/a HitList Function to execute. Use this when you are executing the Hit List with the c parameter.
t INIT Filename Template to use with the Hit List, especially when the frame gets refreshed.
tf INIT Frame name Specifies the frame to target for links.
tt INIT Filename Specifies the template to target for links.
ht INIT Filename Hitlist Template to use. If there is a successful query, then the #hitlist replacement variable gets replaced with the template that is specified with this parameter. This template should contain the <!-- #hitlist:body --> replacement variable in order to stream in the actual hits.
m INIT Number (default is 100) Maximum number of hits to return.
v INIT 2.0 The version of the URL syntax for query form processing. This must be 2.0.
s INIT Relevance-weight | Field:<Field name>[,direction] | Contents The sort type to use. Default is Relevance-weight if syntax (x parameter) is "simple" or Contents (table of contents order) if syntax is "advanced." Direction can be [Asc|Desc] (ascending or descending).
d QRY Domain string Specifies the domain to use to restrict the portion of content that is searched. The domain must be in the form defined by the domain format. Specifying an empty string clears the current domain and sets it to all available content.
h INIT Context string in the form:

<markup type>
<context item 1>
<context item 2>
<context item 3>
.
.
.
<context item n>
Hit context information that tells NXT 4 what to return. Must use these syntax rules:

Hit-Context :=MarkupType?Kwic?Fields?
MarkupType :=([HTML]|[XML])
Kwic :=[Kwic,words(,FieldName)?]
Fields :=[Hit-Field,FieldName(,Contents)?(:([Field,
FieldName(,Contents)?])+)?]
Contents :=Text|Bounds|All
FieldName := [a-zA-Z][a-z|A-Z|0-9]*
a INIT Any of the properties that a h# parameter can take. Which column to put the document anchor (link) on. This is the property name (that appears before the []) rather than the display text.
n INIT Number (default is 25) Number of hits to include in each chunk before inserting a "next" button.
q QRY Query string The query to use
x QRY Simple | Advanced (default is Simple) The query syntax to use. This can be any syntax specified in the querylist.ini file.
h1-h10
r1-r10
QRY hit-context[text,nn] The heading or row specifies a property to include in the Hit List.

H# parameter values take the form:

<Property>[<Display Text>, <percent width>]

For example, Content-Type[Document type, 50]

R# parameter values take the form of

<Property>[<Display Text>]

If the Hit-Context is used, it takes the form:

Hit-Context[<name>,<percent width>,...]

where each name is the name of the field/kwic and the width is the width of the column. Possible properties include:

ID
Content-Type
Content-Version
Title
Name
Path (name path)
Title-Path
Field:<FieldName><
Field-Contents:<FieldName> (surrounding markup)
Hit-Context (Context of hit such as field)
Relevance-Weight (rank value)
Hit (hit number)
Home-title
Home-name
c NAV, RD Next | Prev | Redirect Command mode for the hit list to execute in. If you want the document component to move to the Next/Previous hit document, then call the Hit List component with the Next/Prev command (all of the current query information is retrieved from the property bag).

The Redirect command stores the given query parameter in the property bag and then redirects to the template specified by the t parameter. This is used in cases such as when a search form is displayed in the top-level browser frame.

Since simply redirecting the desired ending frame would not allow the query parameters to be passed to the Hit List component, you must first call the Hit List component, so that it can store those parameters in its property bag, and then have it redirect to the actual desired template.

This in turn causes the Hit List component to be called again, but this time its query parameters can be retrieved from the property bag.

Replacement Variables

Name Description
HITLIST With no sub-parameter, the component determines if there is currently a query.

If there is not a current query, it streams in and gets replaced by the contents of hitlist-empty.htm.

If there is a current query, it determines if the query has timed out, in which case it streams in hitlist-timeout.htm.

If the query doesn't time out, it determines if there are any hits to the query.

If there are no hit results, it streams in hitlist-nohits.htm.

If there are hits to the query, then the template specified with the ht parameter is streamed in.
HITLIST:BODY Inserts the main Hit List text. This replacement variable is normally found in an HTML fragment template that is called with the ht parameter.
HITLIST:PREV Inserts the Previous button if there are previous hits.
HITLIST:NEXT Inserts the Next button if there are more hits.
HITLIST:QUERY Inserts the current query.
HITLIST:HITCOUNT_FIRST Displays the number of the first hit displayed on the page.
HITLIST:HITCOUNT_LAST Displays the number of the last hit displayed on the page.
HITLIST:HITCOUNT_TOTAL Displays the total number of hits for the query.

The following items represent the replacement variables that NXT 4 generates when creating a hit list stream. If you want to write your own Document component you can use these replacement variables to enhance the functionality.

Name Description
HIT_BEGIN Hit starting marker
HIT_END Hit ending marker
KWIC_BEGIN Beginning of KWIC information
KWIC_END End of KWIC information
HIT_FIELD_BEGIN:<Field name> Beginning of the specified field
HIT_FIELD_END End of the specified field
HIT_FIELD_BOUNDS_BEGIN Beginning of bound information
HIT_FIELD_BOUNDS_END End of bound information

Alternatively, if the hit context stream is requested as an XML stream instead of an HTML stream then the following elements are returned instead of their corresponding replacement variables.

Name Description
<Lp-Hit> Marks the beginning and ending (with an end tag) of a hit. Can be used for hit highlighting.
<Lp-Kwic> Marks the beginning and ending (with an end tag) of kwik information.
<Lp-Field> Marks the beginning and ending (with an end tag) of field information. The tag contains two attributes: Bounds and Name. Bounds can have the value of True | False to demonstrate whether it is a bound or not. Name is the name of the field represented by the element.

Style Sheet Styles

Name Description
HITLIST-EVENROW Applied to all even rows in the Hit List.
HITLIST-ODDROW Applied to all odd rows in the Hit List.
HITLIST-HEADERROW Applied to the header row, if one has been requested in the column (H1-H10) parameters.