Heya,
By default in elasticsearch, the _source (the document one indexed) is
stored. This means when you search, you can get the actual document source
back. Moreover, elasticsearch will automatically extract fields / objects
from the _source and return them if you explicitly ask for it (as well as
possibly use it in other components, like highlighting).
You can specify that a specific field is also stored. This menas that
the data for that field will be stored "on its own". Meaning that if you
ask for "field1" (which is stored), elasticsearch will identify that its
stored, and load it from the index instead of getting it from the _source
(assuming _source is enabled).
When do you want to enable storing specific fields? Most times, you
don't. Fetching the _source is fast and extracting it is fast as well. If
you have very large documents, where the cost of storing the _source, or
the cost of parsing the _source is high, you can explicitly map some fields
to be stored instead.
Note, there is a cost of retrieving each stored field. So, for example,
if you have a json with 10 fields with reasonable size, and you map all of
them as stored, and ask for all of them, this means loading each one (more
disk seeks), compared to just loading the _source (which is one field,
possibly compressed).
-shay.banon
On Thu, Nov 17, 2011 at 7:51 AM, David Pilato david@pilato.fr wrote:
Elasticsearch Platform — Find real-time answers at scale | Elastic
David
@dadoonet
Le 17 nov. 2011 à 05:57, Nick Hoffman nick@deadorange.com a écrit :
Cool, that makes sense. Where/how does one configure whether or not the
whole document is stored? I looked around on the ES website, but couldn't
find this detail.