Get API

Could someone explain what this is all about.

"When getting a document, one can specify fields to fetch from it.
They will, when possible, be fetched as stored fields (fields mapped
as stored in the mapping). When using realtime GET, there is no notion
of stored fields (at least for a period of time, basically, until the
next flush), so they will be extracted from the source itself (note,
even if source is not enabled). It is a good practice to assume that
the fields will be loaded from source when using realtime GET, even if
the fields are stored."

Weird, but I don't get anything of it.

A type mapping can have specific mappings associated with certain fields.
One of those mapping option is the ability to store that field in order to
explicitly retrieve it.

But, elasticsearch, by default, stores the source document in the index (the
json document you indexed). This is what you get by default, when you don't
explicitly specify any fields to get back. You can specify something like
_source.obj1.field2 as a field to get back, and what will happen is that the
source will be loaded, parsed, and only the obj1.field2 will be returned.

elasticsearch goes a step forward, and, if you specify obj1.field2, and that
field is not explicitly mapped as stored, it will automatically load the
field from _source.

When using realtime get, the notion of stored fields is not preserved when
the field is loaded, only the _source is available. So, it will always go
through the path of parsing the source and trying to get back that field is
you explicitly specify fields to load.

On Mon, Jul 25, 2011 at 3:15 AM, ajsie johnny.weng.luu@gmail.com wrote:

Could someone explain what this is all about.

"When getting a document, one can specify fields to fetch from it.
They will, when possible, be fetched as stored fields (fields mapped
as stored in the mapping). When using realtime GET, there is no notion
of stored fields (at least for a period of time, basically, until the
next flush), so they will be extracted from the source itself (note,
even if source is not enabled). It is a good practice to assume that
the fields will be loaded from source when using realtime GET, even if
the fields are stored."

Weird, but I don't get anything of it.