Create an AND Query Expression Node with ignore scores and reject scores
Namespace: NetricsServerInterface
Assembly: NetricsServerInterface (in NetricsServerInterface.dll)
Syntax
Visual Basic (Declaration) |
---|
Public Shared Function And( _ ByVal weights As Double(), _ ByVal nqs As NetricsQuery(), _ ByVal ignore_scores As Double(), _ ByVal reject_scores As Double() _ ) As NetricsQuery |
C# |
---|
public static NetricsQuery And( double[] weights, NetricsQuery[] nqs, double[] ignore_scores, double[] reject_scores ) |
C++ |
---|
public: static NetricsQuery And( array<double>^ weights, array<NetricsQuery>^ nqs, array<double>^ ignore_scores, array<double>^ reject_scores ) |
J# |
---|
public static NetricsQuery And( double[] weights, NetricsQuery[] nqs, double[] ignore_scores, double[] reject_scores ) |
JScript |
---|
public static
function And( weights : double[], nqs : NetricsQuery[], ignore_scores : double[], reject_scores : double[] ) : NetricsQuery |
Parameters
- weights
- array of floats that are the weights for the sub expressions of this query
- nqs
- array of NetricsQuery objects that are the sub expressions for this AND
- ignore_scores
- array of floats that are the ignore-scores for the sub expressions for this AND
- reject_scores
- array of floats that are the reject-scores for the sub expressions for this AND
Remarks
This is used to combine multiple NetricsQuery scores into a single score. This is usually performed with a simple average, but can be a weighted average if the user utilizes the weights parameter.
This version allows the caller to specify both a set of ignore scores and a set of reject scores. Ignore scores define a lower bound for the sub expression score. If the score is below the specified lower bound the sub expression will be ignored completely when computing the average or weighted average for the output score. Reject scores define a lower bound also. But in the case of the reject score if the sub expression score is below the reject score the entire record will be rejected. (More precisely the record is assigned a score of -1.0, which causes the record to be rejected unless the score is ignored in a higher level And expression.)
Both ignore scores and reject scores support two special score values: -1.0 is the special score used to indicate a record should be rejected. Typically this is used to reject records when a search on empty or invalid data is performed (see methods
If either of the ignore scores or reject scores are null then no ignore or reject test respectively are performed for this And. If a sub expression is assigned both an ignore score and a reject score then the lesser value takes precedence over its range, the greater value is applied to the range from the lesser to the greater. E.g. if the reject score for sub expression 1 is 0.2 and the ignore score for sub expression 1 is 0.4 then records with a sub expression 1 score less than 0.2 are rejected and records with a score from 0.2 to 0.4 will ignore sub expression 1. Conversely if the ignore score is 0.2 and the reject score 0.4 then scores less than 0.2 will cause sub expression 1 to be ignored whereas scores from 0.2 to 0.4 will cause the record to be rejected.
A cautionary note on ignore scores: Ignore threshold scores should be used with extreme caution. Ignoring a low score in one sub expression will likely boost the score of a record with a poor match on that sub expression (i.e. a score below the threshold) above the score of a similar record with a good match on that sub expression (i.e. above the threshold). Thus when used inappropriately ignore score thresholds will tend to push poorer matches above better matches. This is especially true if ignore thresholds are applied to more than one sub expression.
Further care is needed when using both ignore thresholds and reject thresholds on the same set of sub expressions. Ignore thresholds tend to favor records with high scores for one expression and very low scores for the others. Reject thresholds will pass a record only if all sub expressions are above the given threshold values. Thus combining ignore thresholds and reject thresholds can result in few or no records being returned.