org.apache.solr.ltr.feature

Class SolrFeature



  • public class SolrFeature
    extends Feature
    This feature allows you to reuse any Solr query as a feature. The value of the feature will be the score of the given query for the current document. See Solr documentation of other parsers you can use as a feature. Example configurations:
    [{ "name": "isBook",
      "class": "org.apache.solr.ltr.feature.SolrFeature",
      "params":{ "fq": ["{!terms f=category}book"] }
    },
    {
      "name":  "documentRecency",
      "class": "org.apache.solr.ltr.feature.SolrFeature",
      "params": {
          "q": "{!func}recip( ms(NOW,publish_date), 3.16e-11, 1, 1)"
      }
    }]