Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-10383

NPE on debug query in SOLR UI - LTR OriginalScoreFeature

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 6.4, 6.4.1, 6.4.2, 6.5
    • 6.5.1, 6.6, 7.0
    • None
    • None

    Description

      Hi,

      there is a NPE if I want to debug query in SOLR UI.

      I'm using LTR for reranking result.

      My features:

      {
        "initArgs":{},
        "initializedOn":"2017-03-29T05:32:52.160Z",
        "updatedSinceInit":"2017-03-29T05:56:28.721Z",
        "managedList":[
          {
            "name":"documentRecency",
            "class":"org.apache.solr.ltr.feature.SolrFeature",
            "params":{"q":"{!func}recip( ms(NOW,initial_release_date), 3.16e-11, 1, 1)"},
            "store":"_DEFAULT_"},
          {
            "name":"niceness",
            "class":"org.apache.solr.ltr.feature.SolrFeature",
            "params":{"fq":["{!func}recip(niceness, 0.1, 1, 1)"]},
            "store":"_DEFAULT_"},
          {
            "name":"originalScore",
            "class":"org.apache.solr.ltr.feature.OriginalScoreFeature",
            "params":null,
            "store":"_DEFAULT_"}]}
      

      My model:

      {
        "initArgs":{},
        "initializedOn":"2017-03-29T05:32:52.167Z",
        "updatedSinceInit":"2017-03-29T05:54:26.100Z",
        "managedList":[{
            "name":"myModel",
            "class":"org.apache.solr.ltr.model.LinearModel",
            "store":"_DEFAULT_",
            "features":[
              {
                "name":"documentRecency",
                "norm":{"class":"org.apache.solr.ltr.norm.IdentityNormalizer"}},
              {
                "name":"niceness",
                "norm":{"class":"org.apache.solr.ltr.norm.IdentityNormalizer"}},
              {
                "name":"originalScore",
                "norm":{"class":"org.apache.solr.ltr.norm.IdentityNormalizer"}}],
            "params":{"weights":{
                "documentRecency":0.1,
                "niceness":1.0,
                "originalScore":0.5}}}]}
      

      NPE occurs in this method, where docInfo is null.

      OriginalScoreFeature.java
      @Override
            public float score() throws IOException {
              // This is done to improve the speed of feature extraction. Since this
              // was already scored in step 1
              // we shouldn't need to calc original score again.
              final DocInfo docInfo = getDocInfo();
              return (docInfo.hasOriginalDocScore() ? docInfo.getOriginalDocScore() : originalScorer.score());
            }
      

      Attachments

        1. SOLR-10383.patch
          2 kB
          Christine Poerschke
        2. SOLR-10383-prep.patch
          8 kB
          Christine Poerschke
        3. SOLR-10383.patch
          3 kB
          Christine Poerschke

        Issue Links

          Activity

            People

              cpoerschke Christine Poerschke
              zaky.vit Vitezslav Zak
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 0.5h
                  0.5h
                  Remaining:
                  Remaining Estimate - 0.5h
                  0.5h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified