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

Improve details on ModelException when the feature of a model has not been defined

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: contrib - LTR
    • Labels:
      None

      Description

      While trying to create a model definition, I was getting back the response:

      {
        "responseHeader":{
        [...]
        "error":{
          [...]
          "msg":"org.apache.solr.ltr.model.ModelException: Model type does not exist org.apache.solr.ltr.model.LinearModel",
          "code":400}
          }
      }
      

      I initially thought this was related to the library, but after a while figured out that I had forgotten to create a feature in my feature store. After creating that the model was created as expected.

      To recreate this:

      curl -XPOST -H 'Content-Type: application/json' \
      -d '{
        "store" : "myStore",
        "name" : "myModel",
        "class" : "org.apache.solr.ltr.model.LinearModel",
        "features" : [{
          "name" : "nonExistentFeature"
        }],
        "params" : {
          "nonExistentFeature" : 1.0
        }
      }' http://localhost:8983/solr/$CORE/schema/model-store
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                stevenspasbo Steven Spasbo
              • Votes:
                2 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: