[ You are here: XTF -> Tag Reference -> crossQuery -> Search Result Formatter -> Snippet Tag ]

Snippet Tag

This tag contains a snippet of text associated with a match found in a document. The snippet consists of the text matched along with some context text around it. This tag has the form:
<snippet rank="MatchRelevanceRank" score="MatchRelevanceScore">
 
    Hit Text (and context text, if any)
 
</snippet>
where
rank="MatchRelevanceRank" is the ordinal ranking of this match in the current document, with 1 being the most relevant match in the document. Note that this is an absolute ranking for the match with respect to the entire document, and not a page relative ranking. For more information about paged queries, see the query tag.
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. Note that this score is an overall relevance score and is not affected by paging. For information about paged queries, see the query tag.

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.