Class FieldTermMatch

java.lang.Object
com.yahoo.searchlib.ranking.features.FieldTermMatch

public class FieldTermMatch extends Object
Calculates the fieldTermMatch features
Author:
bratseth
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static Features
    compute(String queryTerm, String field)
    Computes the fieldTermMatch features: firstPosition - the position of the first occurrence of this query term in this index field occurrences - the position of the first occurrence of this query term in this index field

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • FieldTermMatch

      public FieldTermMatch()
  • Method Details

    • compute

      public static Features compute(String queryTerm, String field)
      Computes the fieldTermMatch features:
      • firstPosition - the position of the first occurrence of this query term in this index field
      • occurrences - the position of the first occurrence of this query term in this index field
      Parameters:
      queryTerm - the term to return these features for
      field - the field value to compute over, assumed to be a space-separated string of tokens
      Returns:
      a features object containing the two values described above