Class LegacyFieldValueFeature

  • All Implemented Interfaces:

    public class LegacyFieldValueFeature
    extends FieldValueFeature
    This feature returns the value of a field in the current document. The field must have stored="true" or docValues="true" properties. Example configuration:
       "name":  "rawHits",
       "class": "org.apache.solr.ltr.feature.LegacyFieldValueFeature",
       "params": {
         "field": "hits"

    There are 4 different types of FeatureScorers that a FieldValueFeatureWeight may use. The chosen scorer depends on the field attributes.

    FieldValueFeatureScorer (FVFS): used for stored=true, no matter if docValues=true or docValues=false

    NumericDocValuesFVFS: used for stored=false and docValues=true, if docValueType == NUMERIC

    SortedDocValuesFVFS: used for stored=false and docValues=true, if docValueType == SORTED

    DefaultValueFVFS: used for stored=false and docValues=true, a fallback scorer that is used on segments where no document has a value set in the field of this feature

    Matches FieldValueFeature behaviour prior to 9.4 i.e. DocValues are not used when docValues=true is combined with stored=true.

    • Constructor Detail

      • LegacyFieldValueFeature

        public LegacyFieldValueFeature​(String name,
                                       Map<String,​Object> params)