If this is a stupid question, please excuse me, I'm new in search.
What is the main advantage of stored fields... I know that they can be
selectively loaded but can they not just be selectively loaded from
the _source field instead?
They can be selectively loaded from the _source field, either by
specifying a notation to load them (_source.obj1.field1) or getting the full
_source and using them on the client side.
Returning the full _source field means loading it from disk and returning
it. For large docs this might not be an option. Note that compression can
really help in this option (it "travels" compressed right up to the client /
REST layer).
Getting it using the _source notion means loading the _source on the
relevant shard, parsing it, and returning the relevant data.
Storing fields means that only those fields can be loaded from disk. The
benefit is that you load less data, at the expense of storing more data. One
important thing to note is that if you choose to load several fields, it
might be slower than loading a single _source field, even if the _source
field is bigger than the total size of the fields loaded.
If this is a stupid question, please excuse me, I'm new in search.
What is the main advantage of stored fields... I know that they can be
selectively loaded but can they not just be selectively loaded from
the _source field instead?
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.