[ You are here: XTF -> Tag Reference -> dynaXML -> Document Formatter Input -> Snippet Tag ]

Snippet Tag

This tag contains a snippet of text associated with a match found in the requested document. The snippet consists of the text matched along with some context text around it. This tag has the form:
<xtf:snippet hitNum="HitNumber" rank="MatchRelevanceRank" score="MatchRelevanceScore">
 
    Hit Text (and context text, if any)
 
</xtf:snippet>
where
xtf: is an XTF namespace prefix added to the tag to differentiate it from tags that came from the original XML document. The namespace URI for this prefix is: http://cdlib.org/xtf
hitNum="HitNumber" is the ordinal ID of the current hit. This attribute will also appear in hit tags in the main text, allowing the hit number for the next or previous in-context tag to be easily determined.
rank="MatchRelevanceRank" is the ranking of this match in the current document, with 1 being the most relevant match in the document.
score="MatchRelevanceScore" is the relevance score for this match ranging from 0% to 100%. The snippet with the highest overall relevance will receive a score of 100%, and less relevant snippets will receive lower scores.

The amount of context text displayed in a snippet is determined by the query tag in the original query. If the context length specified is less than the matched text, then only the matched text will be displayed.

Within the snippet itself, each matching word from the query will be marked with a single Term Tag, and the matching text around which the context text is centered on will also be marked with a single Hit Tag.