Native custom script performance: stored fields

Hello,

I'm trying to use a CustomScore query to score documents based on a
function of several of their fields, and am looking to optimize its
performance.

I am using a native (Java) custom score script, which accesses several
document fields, all of which are indexed (but not stored).

When profiling the code using VisualVM, I see that most of the time taken
by the query is spent in

  1. org.elasticsearch.search.lookup.DocLookup.get() --- I am retrieving
    several text fields

org.elasticsearch.search.index.fieldData.ScriptDocValues$Doubles.getValues()
--- I am retrieving an array of doubles

Is the speed at which the above complete affected by the stored property on
those fields? In general, what is the fastest way of accessing document
fields in native scripts?

Thanks!

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Hi,

On Thu, Jun 20, 2013 at 5:09 PM, Maciej Kula aggregaccount@gmail.comwrote:

Is the speed at which the above complete affected by the stored property
on those fields? In general, what is the fastest way of accessing document
fields in native scripts?

Performance is unrelated to the stored property of your fields. The fastest
way to access document fields in native scripts is through the doc()
method, but given that you see DocLookup.get in your profiles, it looks
like this is what you are already doing.

--
Adrien Grand

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Thank you. That's really useful.

Maciej

On Friday, June 21, 2013 8:16:03 AM UTC+1, Adrien Grand wrote:

Hi,

On Thu, Jun 20, 2013 at 5:09 PM, Maciej Kula <aggreg...@gmail.com<javascript:>

wrote:

Is the speed at which the above complete affected by the stored property
on those fields? In general, what is the fastest way of accessing document
fields in native scripts?

Performance is unrelated to the stored property of your fields. The
fastest way to access document fields in native scripts is through the
doc() method, but given that you see DocLookup.get in your profiles, it
looks like this is what you are already doing.

--
Adrien Grand

--
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.
For more options, visit https://groups.google.com/groups/opt_out.