Question about Custom Score and data field cache

Hi all,

I am planning to use a custom score query with the scripting module,
as explained in: http://www.elasticsearch.com/docs/elasticsearch/modules/scripting/
but I would like to know a bit how does it work.

My query would use: doc['field_name'].value, but I'd like to know how
is this mapped in Lucene. Does this use an approach similar to field
cache? so for example 'field_name' is loaded as an array of primitive
types or string indexes? (using more memory but being search time
efficient) Or is this computed getting the matching documents from
Lucene and for each then getting the field with 'field_name'? (being
memory inexpensive but search time more costly) I am asking this
because the performance is very different in both approaches and I
couldn't find the docs about this.

Thanks,
Sebastian.

doc['field_name'].value uses a similar concept to field cache (though more
advanced), all values for the field are loaded to memory and keyed by doc
id.

-shay.banon

On Sat, Oct 16, 2010 at 9:45 PM, Sebastian sgavarini@gmail.com wrote:

Hi all,

I am planning to use a custom score query with the scripting module,
as explained in:
http://www.elasticsearch.com/docs/elasticsearch/modules/scripting/
but I would like to know a bit how does it work.

My query would use: doc['field_name'].value, but I'd like to know how
is this mapped in Lucene. Does this use an approach similar to field
cache? so for example 'field_name' is loaded as an array of primitive
types or string indexes? (using more memory but being search time
efficient) Or is this computed getting the matching documents from
Lucene and for each then getting the field with 'field_name'? (being
memory inexpensive but search time more costly) I am asking this
because the performance is very different in both approaches and I
couldn't find the docs about this.

Thanks,
Sebastian.