Class FieldLengthFeature

java.lang.Object
org.apache.lucene.search.Query
org.apache.solr.ltr.feature.Feature
org.apache.solr.ltr.feature.FieldLengthFeature
All Implemented Interfaces:
org.apache.lucene.util.Accountable

public class FieldLengthFeature extends Feature
This feature returns the length of a field (in terms) for the current document. Example configuration:
 {
   "name":  "titleLength",
   "class": "org.apache.solr.ltr.feature.FieldLengthFeature",
   "params": {
     "field": "title"
   }
 }
 
Note: since this feature relies on norms values that are stored in a single byte the value of the feature could have a lightly different value. (see also ClassicSimilarity)