afs:relevance - AFS

AFS Integration Guide

Reference Guide

afs:relevance can either include basic or rich information. By default, basic information is provided. Rich information is delivered when afs:explain=relevance is added to the query.

In basic mode, afs:relevance has one mandatory attribute rank. Its value contains the position of the document in the reply set (the document at position 1 is the most relevant document).

In rich mode, afs:relevance has three other attributes: pathlen, words, weight and fieldMatch:

  • pathlen contains the minimal path length (distance) between the query words in the document. Usually documents with lower pathlen values are more relevant.
  • words contains the number of the query words that have been found in the document. Usually the documents with greater words value are more relevant.
  • weight contains information about the relevancy of the query words in the document. This information is stored as a percentage where 100 is very relevant and 1 not relevant at all.
  • fieldMatch is true when an entire XML field from indexed data has been matched by the query. See afs:sort for more information about fieldMatch.