You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Vincent <vi...@openindex.io> on 2017/03/06 13:15:51 UTC

Learning to rank - Bad Request

Hi all,

I've been trying to get learning to rank working on our own search 
index. Following the LTR-readme 
(https://github.com/bloomberg/lucene-solr/blob/master-ltr/solr/contrib/ltr/example/README.md) 
I ran the example python script to train and upload the model, but I 
already get an error during the uploading of the features:

Bad Request (400) - Expected Map to create a new ManagedResource but 
received a java.util.ArrayList
     at 
org.apache.solr.rest.RestManager$RestManagerManagedResource.doPut(RestManager.java:523)
     at 
org.apache.solr.rest.ManagedResource.doPost(ManagedResource.java:355)
     at 
org.apache.solr.rest.RestManager$ManagedEndpoint.post(RestManager.java:351)
     at 
org.restlet.resource.ServerResource.doHandle(ServerResource.java:454)
     ...

This makes sense: the json feature file is an array, and the RestManager 
needs a Map in doPut.

Using the curl command from the cwiki 
(https://cwiki.apache.org/confluence/display/solr/Learning+To+Rank) 
yields the same error, but instead of it having "received a 
java.util.ArrayList" it "received a java.lang.String".

I wonder how this actually is supposed to work, and what's going wrong 
in this case. I have tried the LTR with the default techproducts 
example, and that worked just fine. Does anyone have an idea of what's 
going wrong here?

Thanks in advance!
Vincent