lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christine Poerschke (BLOOMBERG/ LONDON)" <cpoersc...@bloomberg.net>
Subject Re:solr learning_to_rank (normalizer) unmatched argument type issue
Date Tue, 04 Apr 2017 18:24:56 GMT
Hi Jianxiong,

Thanks for reporting this. I think this is a bug and have filed https://issues.apache.org/jira/browse/SOLR-10421
ticket for fixing it.

Regards,
Christine

----- Original Message -----
From: solr-user@lucene.apache.org
To: solr-user@lucene.apache.org
At: 03/31/17 23:19:27

Hi,
    I created a toy learning-to-rank model in solr in order to show the issues.

Feature.json
---------
[
  {
    "store" : "wikiFeatureStore",
    "name" : "doc_len",
    "class" : "org.apache.solr.ltr.feature.FieldLengthFeature",
    "params" : {"field":"a_text"}
  },
  {
    "store" : "wikiFeatureStore",
    "name" : "rankScore",
    "class" : "org.apache.solr.ltr.feature.OriginalScoreFeature",
    "params" : {}
  }
]

model.json
-------
{
  "store" : "wikiFeatureStore",
  "class" : "org.apache.solr.ltr.model.LinearModel",
  "name" : "wiki_qaModel",
  "features" : [
    { "name" : "doc_len",
      "norm" : {
          "class" : "org.apache.solr.ltr.norm.MinMaxNormalizer",
          "params" : {"min": "1.0", "max" : "113.77778" }
      }
    },
   { "name" : "rankScore",
      "norm" : {
          "class" : "org.apache.solr.ltr.norm.MinMaxNormalizer",
          "params" : {"min": "0.0", "max" : "49.60385" }
      }
    }
   ],
  "params" : {
      "weights": {
           "doc_len": 0.322,
           "rankScore": 0.98
      }
   }
}

I could upload both feature and model  and performed re-ranking based
on the above model.   The issue was that when I stopped the solr
server and restarted it.
I got error message when I ran the same query to extract the features:
"Caused by: org.apache.solr.common.SolrException: Failed to create new
ManagedResource /schema/model-store of type
org.apache.solr.ltr.store.rest.ManagedModelStore due to:
java.lang.IllegalArgumentException: argument type mismatch
    at org.apache.solr.rest.RestManager.createManagedResource(RestManager.java:700)
    at org.apache.solr.rest.RestManager.addRegisteredResource(RestManager.java:666)
    at org.apache.solr.rest.RestManager.access$300(RestManager.java:59)
    at org.apache.solr.rest.RestManager$Registry.registerManagedResource(RestManager.java:231)
    at org.apache.solr.ltr.store.rest.ManagedModelStore.registerManagedModelStore(ManagedModelStore.java:51)
    at org.apache.solr.ltr.search.LTRQParserPlugin.inform(LTRQParserPlugin.java:124)
    at org.apache.solr.core.SolrResourceLoader.inform(SolrResourceLoader.java:719)
    at org.apache.solr.core.SolrCore.&lt;init&gt;(SolrCore.java:931)
    ... 9 more
Caused by: java.lang.IllegalArgumentException: argument type mismatch
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.solr.util.SolrPluginUtils.invokeSetters(SolrPluginUtils.java:1077)
    at org.apache.solr.ltr.norm.Normalizer.getInstance(Normalizer.java:49)
"

I found that the issue was related to
solr-6.4.2/server/solr/my_collection/conf/_schema_model-store.json
"
{
  "initArgs":{},
  "initializedOn":"2017-03-31T20:51:59.494Z",
  "updatedSinceInit":"2017-03-31T20:54:54.841Z",
  "managedList":[{
      "name":"wiki_qaModel",
      "class":"org.apache.solr.ltr.model.LinearModel",
      "store":"wikiFeatureStore",
      "features":[
        {
          "name":"doc_len",
          "norm":{
            "class":"org.apache.solr.ltr.norm.MinMaxNormalizer",
            "params":{
              "min":1.0,
              "max":113.77777862548828}}},
...
"

Here the data type  for "min'' and "max" are double. When I manually
changed them to string. Then everything worked as expected.

"
 "norm":{
            "class":"org.apache.solr.ltr.norm.MinMaxNormalizer",
            "params":{
              "min": "1.0",
              "max": "113.77777862548828"}}},


Any insights into the above strange behavior?

Thanks

Jianxiong

Mime
View raw message