Native(Java) script performance

is there any documents available about performance of native script ?? I am
facing search performance issue due to native script. General guideline to
optimize script performance will be helpful.

Here is specific details where i am facing performance issue.

I am using script to find documents which overlap betweens two date ranges.
(i.e. find documents between [01-Aug, 2-Nov]... where document contain two
fields (start_time, end_time)) . First, startRange-endRange are params.

My script filter is,

===================
{
"script": {
"script": "xyz",
"params": {
"startRange": 1407939675, // Timestamp in
milliseconds
"endRange": 1410531675 // Timestamp in
milliseconds
},
"lang": "native",
"_cache": true
}
},

===================
My Native(Java) script code

====================

ScriptDocValues XsDocValue = (ScriptDocValues) doc().get(

"start_time");

long XsLong = 0l;

if (XsDocValue != null && !XsDocValue.isEmpty()) {

XsLong = ((ScriptDocValues.Longs) doc().get("start_time"))

.getValue();

}

ScriptDocValues XeDocValue = (ScriptDocValues) doc().get("end_time");

long XeLong = 0l;

if (XeDocValue != null && !XeDocValue.isEmpty()) {

XeLong = ((ScriptDocValues.Longs) doc().get("end_time"))

.getValue();

}

if ((endRange >= XsLong) && (startRange <= XeLong)) {

return true;

}

===========================

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/e6f056a0-4e47-4e04-abd2-e74f27bd2e68%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.