org.apache.solr.ltr.model

Class LTRScoringModel

  • Direct Known Subclasses:
    LinearModel, MultipleAdditiveTreesModel


    public abstract class LTRScoringModel
    extends Object
    A scoring model computes scores that can be used to rerank documents.

    A scoring model consists of

    • a list of features (Feature) and
    • a list of normalizers (Normalizer) plus
    • parameters or configuration to represent the scoring algorithm.

    Example configuration (snippet):

    {
       "class" : "...",
       "name" : "myModelName",
       "features" : [
           {
             "name" : "isBook"
           },
           {
             "name" : "originalScore",
             "norm": {
                 "class" : "org.apache.solr.ltr.norm.StandardNormalizer",
                 "params" : { "avg":"100", "std":"10" }
             }
           },
           {
             "name" : "price",
             "norm": {
                 "class" : "org.apache.solr.ltr.norm.MinMaxNormalizer",
                 "params" : { "min":"0", "max":"1000" }
             }
           }
       ],
       "params" : {
           ...
       }
    }

    LTRScoringModel is an abstract class and concrete classes must implement the score(float[]) and explain(LeafReaderContext, int, float, List) methods.