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
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?
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.
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.
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.