Hello,
I'm kind of new to elasticsearch. I had a question regarding using transport client ( v5.0.1 and my elasticsearch cluster is also at 5.0.1). I'm seeing this error when I try to call update operation.
My document is of following format:
{
x: [ _array_of_longs]
}
I tried to use script to have an append only if it exists in the array kind of operation. I don't know if elasticsearch supports Set data structure. Whenever i try with small integer like 100, 200 it works. But when I enter longs, l get this error. Any idea, what I'm doing wrong here ?
Caused by: java.lang.IllegalArgumentException: Invalid int constant [9000000000001].
at org.elasticsearch.painless.Executable$Script.compile(if(ctx._source.x.contains(9000000000001)) { ctx.op = 'none'} else { ctx._source.x.add(9000000000001)} @ :33) ~[na:na]
at org.elasticsearch.painless.node.ENumeric.analyze(ENumeric.java:107) ~[na:na]
at org.elasticsearch.painless.node.PSubDefCall.analyze(PSubDefCall.java:67) ~[na:na]
at org.elasticsearch.painless.node.PCallInvoke.analyze(PCallInvoke.java:92) ~[na:na]
at org.elasticsearch.painless.node.SIfElse.analyze(SIfElse.java:66) ~[na:na]
at org.elasticsearch.painless.node.SSource.analyze(SSource.java:190) ~[na:na]
at org.elasticsearch.painless.node.SSource.analyze(SSource.java:162) ~[na:na]
at org.elasticsearch.painless.Compiler.compile(Compiler.java:104) ~[na:na]
at org.elasticsearch.painless.PainlessScriptEngineService$2.run(PainlessScriptEngineService.java:171) ~[na:na]
at org.elasticsearch.painless.PainlessScriptEngineService$2.run(PainlessScriptEngineService.java:168) ~[na:na]
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_31]
at org.elasticsearch.painless.PainlessScriptEngineService.compile(PainlessScriptEngineService.java:168) ~[na:na]
I'm using prepareUpdate call from transport client (lang is painless) something like this ...
client.prepareUpdate(request.getIndex(),
request.getType(), request.getId())
.setScript(request.getScript()).setUpsert(request.getDocument()).execute().get();