I have a mvel script (groovy looks the same) as follows:
if (!ctx._source.list.contains(document)) {ctx._source.list +=
document;} else {ctx.op = "none"}";
I have a java map
map.put("id", 100L);
When I try to match the above document to an existing ES document it will
fail because it's a "long".
If both documents are "long" like above the match fails. Mapping doesn't
matter (mapping field with long will still fail)
Using java integer works ie
map.put("id", 100);
It seems the scripts (mvel and groovy) cast the number to integer before
doing the match (?)
This is okay for now but if my numbers exceed the java integer max I will
need a solution.
I suspect at that point they'll pop out as Longs. Its just my suspicion. I
haven't read that bit of the code.
On May 11, 2015 10:08 AM, eunever32@gmail.com wrote:
I have a mvel script (groovy looks the same) as follows:
if (!ctx._source.list.contains(document)) {ctx._source.list +=
document;} else {ctx.op = "none"}";
I have a java map
map.put("id", 100L);
When I try to match the above document to an existing ES document it will
fail because it's a "long".
If both documents are "long" like above the match fails. Mapping doesn't
matter (mapping field with long will still fail)
Using java integer works ie
map.put("id", 100);
It seems the scripts (mvel and groovy) cast the number to integer before
doing the match (?)
This is okay for now but if my numbers exceed the java integer max I will
need a solution.
I see there are no answers yet. Any help appreciated.
But just to repeat the question:
the mvel script fails to match documents
I have a list in elasticsearch containing longs.
I submit one element in mvel script like this if
(document.contains(element)) { ... }
But it never matches.
If I change my document to integer then the script starts to work.
This means the script requires integer to work
So even though things are working now, if my ES data goes above 2*32 then
the application won't work !
On Monday, May 11, 2015 at 3:16:01 PM UTC+1, Nikolas Everett wrote:
I suspect at that point they'll pop out as Longs. Its just my suspicion. I
haven't read that bit of the code.
On May 11, 2015 10:08 AM, <eune...@gmail.com <javascript:>> wrote:
I have a mvel script (groovy looks the same) as follows:
if (!ctx._source.list.contains(document)) {ctx._source.list +=
document;} else {ctx.op = "none"}";
I have a java map
map.put("id", 100L);
When I try to match the above document to an existing ES document it will
fail because it's a "long".
If both documents are "long" like above the match fails. Mapping doesn't
matter (mapping field with long will still fail)
Using java integer works ie
map.put("id", 100);
It seems the scripts (mvel and groovy) cast the number to integer before
doing the match (?)
This is okay for now but if my numbers exceed the java integer max I will
need a solution.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.