Class FieldTermMatch


  • @Beta
    public class FieldTermMatch
    extends java.lang.Object
    Calculates the fieldTermMatch features
    Author:
    bratseth
    • Constructor Summary

      Constructors 
      Constructor Description
      FieldTermMatch()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Features compute​(java.lang.String queryTerm, java.lang.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 Detail

      • FieldTermMatch

        public FieldTermMatch()
    • Method Detail

      • compute

        public static Features compute​(java.lang.String queryTerm,
                                       java.lang.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