I really don't understand why in core types link it says in the attributes descriptions (for a number, for example):
- store - Set to yes to store actual field in the index, no to not store it. Defaults to no (note, the JSON document itself is stored, and it can be retrieved from it)
- index - Set to no if the value should not be indexed. In this case, store should be set to yes, since if it’s not indexed and not stored, there is nothing to do with it
The two bold parts seem to contradict. If "index":"no", "store":"no"
I could still get the value from the source. This could be a good use if I have a field containing a URL for example. No?
I had a little experiment, where I had two mappings, in one a field was set to "store":"yes"
and in the other to "store":"no"
.
In both cases I could still specify in my query:
{"query":{"match_all":{}}, "fields":["my_test_field"]}
and I got the same answer, returning the field.
I thought that if "store"
is set to "no"
it would mean I could not retreive the specific field, but had to get the whole _source
and parse it on the client side.
So, what benefit is there in setting "store"
to "yes"
? Is it only relevant if I exclude the field from the "_source"
field explicitly?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…