Stored fields


(Albin Stigo) #1

Hi,

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?

--Albin

On Thu, Oct 28, 2010 at 12:05 PM, Shay Banon
shay.banon@elasticsearch.com wrote:

Hi,
Just pushed support ip address support (with auto
detection): http://github.com/elasticsearch/elasticsearch/issues/issue/461
(as discussed in a previous) thread.
Here is a simple test I do to have the previous mentioned question
(yea.., in java):

    client.prepareIndex("test", "type1", "1").setSource("from",

"192.168.0.5", "to", "192.168.0.10").setRefresh(true).execute().actionGet();
SearchResponse search = client.prepareSearch()

.setQuery(boolQuery().must(rangeQuery("from").lt("192.168.0.7")).must(rangeQuery("to").gt("192.168.0.7")))
.execute().actionGet();

-shay.banon


(Shay Banon) #2

Hi,

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.

Hope it make sense.

-shay.banon

On Thu, Oct 28, 2010 at 5:24 PM, Albin Stigo albin.stigo@gmail.com wrote:

Hi,

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?

--Albin

On Thu, Oct 28, 2010 at 12:05 PM, Shay Banon
shay.banon@elasticsearch.com wrote:

Hi,
Just pushed support ip address support (with auto
detection):
http://github.com/elasticsearch/elasticsearch/issues/issue/461
(as discussed in a previous) thread.
Here is a simple test I do to have the previous mentioned question
(yea.., in java):

    client.prepareIndex("test", "type1", "1").setSource("from",

"192.168.0.5", "to",
"192.168.0.10").setRefresh(true).execute().actionGet();
SearchResponse search = client.prepareSearch()

.setQuery(boolQuery().must(rangeQuery("from").lt("192.168.0.7")).must(rangeQuery("to").gt("192.168.0.7")))

            .execute().actionGet();

-shay.banon


(system) #3