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

contrib/ltr FieldValueFeature is silently 0.0 for external file fields

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 6.6
    • None
    • contrib - LTR
    • None

    Description

      By observation

      {
        "name" : "popularityScoreAsFieldValueFeature",
        "class" : "org.apache.solr.ltr.feature.FieldValueFeature",
        "params" : { "field" : "popularity_score" }
      }
      

      returns a score of 0.0 for external file fields e.g.

      <fieldType name="id2float" keyField="handle" defVal="0" class="solr.ExternalFileField" valType="float" />
      <field name="popularity_score"  type="id2float" />
      

      is schema content for the field.

      In comparison (and as a workaround of sorts)

      {
        "name" : "popularityScoreAsSolrFeature",
        "class" : "org.apache.solr.ltr.feature.SolrFeature",
        "params" : { "q" : "{!func}field(popularity_score)" }
      }
      

      returns the correct value.

      The FieldValueFeature javadocs mention no restrictions re: fields needing to be non-external (or stored or indexed or whatever).


      Improvements that could be made under this ticket:

      • extend the javadocs to clarify what is and what is not supported
      • add (further) test cases for not supported scenarios
      • maybe: add support for external file fields
      • maybe: throw an exception or noisely log (instead of silently returning 0.0) in not supported scenarios

      Attachments

        Activity

          People

            Unassigned Unassigned
            cpoerschke Christine Poerschke
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: