Cannot insert a geopoint

I try to insert a document with body:

{
"user_uuid":"234",
"description":"",
"category":"art",
"location":{
"lat":52.582014799999996,
"lon":13.4913122
},
"url":"http://172.19.0.4:9000/arbotti/r1RgVuQJMS1xRg4_Xkz"
}

And get the error:
{
"error": {
"root_cause": [
{
"type": "remote_transport_exception",
"reason": "[172.19.0.2][172.19.0.2:9300][indices:data/write/bulk[s][p]]"
}
],
"type": "class_cast_exception",
"reason": "java.lang.Double cannot be cast to java.lang.Float"
},
"status": 500
}

I do not understand why the lat/lon pair is treated as Double.

What is the mapping on that field?

Mark,

The problem seems gone after I dropped the index and recreated it.
The mapping is geopoint. Seems to work now.

Thank you Mark anyway!

Marek

Dear Mark,

Perhaps you can help me. I am using elastic version 5.5.0
I am having a problem with this simple update:

http://localhost:9200/post_elastic/AV_e3-gqARzXw_Stq0-5/_update

{
"script" : {
"inline": "ctx._source.likes += 1",
"lang": "painless"
}
}

This leads to:

{
"error": {
"root_cause": [
{
"type": "remote_transport_exception",
"reason": "[172.19.0.3][172.19.0.3:9300][indices:data/write/update[s]]"
}
],
"type": "illegal_argument_exception",
"reason": "failed to execute script",
"caused_by": {
"type": "script_exception",
"reason": "compile error",
"script_stack": [],
"script": "ctx._source.likes += 1",
"lang": "painless",
"caused_by": {
"type": "runtime_exception",
"reason": "java.lang.ClassNotFoundException: org.elasticsearch.painless.PainlessError"
}
}
},
"status": 400
}

The field to be incremented is an integer.
"likes": {
"type": "integer"
},

Can you please help me to get to the root of the problem?
Thank you.

Best regards,
Marek

It'd be better if you started another thread, as that's unrelated to the original question so those that can best assist are unlikely to see the question :slight_smile:

Thank you Mark. I have created the new thread: Cannot execute update by script https://discuss.elastic.co/t/cannot-execute-update-by-script/108795

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.