Dynamic Score Cutoffs
Because it is inappropriate to cut off search results at a static score threshold, there are several configurable dynamic methods which can be used. Cutoff types are defined by the lcutoff_t enumerated type in the DevKit header. A cutoff is specified by creating an LPAR_LST_CUTOFF which contains an LPAR_INT_CUTOFFTYPE and optional parameters specific to that type of cutoff.
All cutoffs use the score type specified in LPAR_INT_SORTSCORE (LKT_SCORE_NORMAL by default) to perform the cutoff.
Cutoff types are shown below with their associated parameters.
|
LKT_CUTOFF_NONE |
A cutoff of this type behaves the same way as if no LPAR_LST_CUTOFF is specified at all. |
|
LKT_CUTOFF_EXACTPLUS |
A cutoff of this type returns exact matches plus a specified number of additional records. The number of additional records is given by adding an LPAR_INT_DBNUMRECORDS to the LPAR_LST_CUTOFF. This parameter must be supplied. |
|
LKT_CUTOFF_PERCENTOFTOP |
A cutoff of this type returns all records with a match score greater than or equal to a specified percentage of the match score of the first record returned. The percentage is given by adding an LPAR_DBL_PERCENTAGE to the LPAR_LST_CUTOFF. Valid values for this parameter are doubles from 0 to 100. This parameter must be supplied. |
|
LKT_CUTOFF_SIMPLEGAP |
A cutoff of this type returns all records until a gap between the match scores of consecutive records is greater than a specified percentage of the match score of the first record returned. The percentage is given by adding an LPAR_DBL_PERCENTAGE to the LPAR_LST_CUTOFF. Valid values for this parameter are doubles from 0 to 100. This parameter must be supplied. |
|
LKT_CUTOFF_ABSOLUTE |
A cutoff of this type returns all records above a fixed absolute score. The score is given by adding an LPAR_DBL_MATCHSCORE to the LPAR_LST_CUTOFF. Valid values for this parameter are doubles from 0.0 to 1.0. The parameter must be supplied. This cutoff type is not dynamic and should be used with caution, as it might very easily cut good records. |
Score cutoffs only reduce the number of records returned from a search. Under no circumstances you ever receive more records than the number specified by the LPAR_INT_MATCHESREQ search parameter (or its default value, if none is specified). For example, if you request a cutoff type of LKT_CUTOFF_EXACTPLUS, this is not guarantee that you receive all exact matches. If there are more exact matches in your database than your requested number of records, you only receive a portion of the exact matches.
In addition to specifying a cut off with the LPAR_LST_CUTOFF parameter in the search options, a cutoff can be specified by passing a true value for the LPAR_BOOL_USEMODELTHRESH parameter in the LPAR_LST_QOPTS list of an Learn score combiner. If this is done and the Learn model contains a threshold value, that value is used as the cutoff value to the LKT_CUTOFF_ABSOLUTE cutoff method. This supersedes any cutoff specified in the search options.