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

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • contrib - LTR
    • 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

              Unassigned Unassigned
              stevenspasbo Steven Spasbo
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: