# Java Native Scripting in 0.90

**URL:** <https://discuss.elastic.co/t/java-native-scripting-in-0-90/11866>\
**Category:** Elasticsearch\
**Created:** [May 7, 2013, 10:48pm UTC](https://discuss.elastic.co/t/java-native-scripting-in-0-90/11866 "2013-05-07T22:48:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Felipe\_Hummel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felipe_hummel/32/1263_2.png) [@Felipe\_Hummel](https://discuss.elastic.co/u/Felipe_Hummel)\
**Post date:** [May 7, 2013, 10:48pm UTC](https://discuss.elastic.co/t/java-native-scripting-in-0-90/11866/1 "2013-05-07T22:48:05Z")

</div>

I'm upgrading to ES 0.90 and I have some native scripts written in Java  
(currently using 0.19.8)

The _DocLookup_ in _AbstractFloatSearchScript_ (accessed through _doc()_)  
does not have the _numeric(string)_ method anymore, it was used like this:

_long myValue = doc().numeric("my\_number\_value_\*").getLongValue();\*

Now _DocLookup_ implements the _Map_ interface. So instead of  
doc().numeric("my\_number\_field"), I should do doc().get("my\_number\_field").  
Looking at the source code _get()_ returns a _ScriptDocValues_ (although  
the signature only says Object).

What should I do to get the _long_ value?

I'm gonna try:

NumericLong n = (NumericLong)doc().get("my\_number\_field");  
long v = n.getValue();

Is that the correct way of doing this?

Felipe Hummel

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 2:37am UTC](https://discuss.elastic.co/t/java-native-scripting-in-0-90/11866/2 "2017-07-06T02:37:49Z")

</div>

Closed on July 6, 2017, 2:37am UTC


