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.