o19s / elasticsearch-learning-to-rank

Plugin to integrate Learning to Rank (aka machine learning for better relevance) with Elasticsearch
http://opensourceconnections.com/blog/2017/02/14/elasticsearch-learning-to-rank/
Apache License 2.0
1.48k stars 369 forks source link

Error uploading RankLib model (null_pointer_exception) #401

Closed ur2021 closed 2 years ago

ur2021 commented 2 years ago

Hi, I am trying to upload a RankLib model, but I get the follwing error:

{
    "error": {
        "root_cause": [
            {
                "type": "null_pointer_exception",
                "reason": "Cannot invoke \"org.elasticsearch.common.xcontent.XContentParser.currentToken()\" because \"parser\" is null"
            }
        ],
        "type": "null_pointer_exception",
        "reason": "Cannot invoke \"org.elasticsearch.common.xcontent.XContentParser.currentToken()\" because \"parser\" is null"
    },
    "status": 500
}

I checked other issues here and couldn't find anything with such error. The payload is here: upload_model.zip

nathancday commented 2 years ago

What version of ES are you using?

I have a feeling this is unrelated to the plugin. Could you include the minimal code you ran to generate that error too?

ur2021 commented 2 years ago

ES version: 7.13.4

I am not sure what to put as minimal code. I just do "POST _featureset/orbis_features/_createmodel" where the payload is what I attached in the original message.

If it helps, I am attaching here also the ES log.

nomoa commented 2 years ago

@ur2021 I think you did not provide any content to the _createmodel endpoint. The json model must be passed as the request body of the POST request:

curl -XPOST -H "Content-Type: application/json" localhost:9200/_ltr/_featureset/orbis_features/_createmodel -d @model_file.json

But I agree that the plugin should provide better explanation of what is missing instead of throwing an NPE.