Class FieldTermMatch


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

      • FieldTermMatch

        public FieldTermMatch()
    • Method Detail

      • 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