Create an AND Query Expression Node with ignore 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() _ 
) As NetricsQuery
C#
public static NetricsQuery And(
   double[] weights,
   NetricsQuery[] nqs,
   double[] ignore_scores
)
C++
public:
 static NetricsQuery And(
   array<double>^ weights,
   array<NetricsQuery>^ nqs,
   array<double>^ ignore_scores
)
J#
public static NetricsQuery And(
   double[] weights,
   NetricsQuery[] nqs,
   double[] ignore_scores
)
JScript
public static  function And(
   weights : double[],
   nqs : NetricsQuery[],
   ignore_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

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 a set of scores, one per sub expression, that 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.

There are 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 setInvalidScore and setEmptyScore for how to change the score assigned in such cases). Instead of rejecting a record a sub expression can be ignored if empty or invalid data is encountered by setting the empty and invalid scores to -1.0 and then using the ignore threshold to ignore scores of -1.0. -2.0 can be used as an indicator that no ignore threshold processing is to be performed for this sub expression.

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. Thus ignore thresholds should only be applied in the rare cases where a low score indicates the sub expression is completely irrelevant and the record should score above close but imperfect matches on the sub expression. Another valid use would be to ignore empty fields as described above, although normally it is better to just let the default score of 0.0 be averaged into the output score.

See Also