Relevance ranking modules are applied in the order in which they are listed in the relevance ranking strategy. For example, the following relevance ranking strategy,
<property name="relRankStrategy" value="exact,glom,static(quantity_sold,descending)">
invokes modules named exact
, glom
, and static
, in that order.
Each module applies a different set of criteria to sort records into various strata. In each resulting stratum, the next module sorts the records into substrata. The sorting continues until all modules have been applied, or until there are no further ties among records. If any ties remain after all modules have been invoked, the ties are resolved by a default sorting rule.
The field
and maxfield
modules take into account the priority of records. A record’s priority corresponds to the position in the search interface’s fields
array of the member that the record matches. Records matched to members closer to the beginning of the array have higher priority than records matched to members closer to the end. If a record matches more than one member, its priority is based on the member that is closest to the beginning of the fields
array.
The exact,
first
, nterms
, and proximity
modules can optionally take a parameter named considerFieldRanks
. The considerFieldRanks
parameter indicates that the module should further sort records according to their priority, after the module has sorted records according to its own criteria. In the relevance ranking strategy, the parameter is specified in parentheses after the module name; for example:
<property name="relRankStrategy"
value="exact(considerFieldRanks),glom,static(quantity_sold,descending)">