What happens to properties that are not explicitly named in the mapping?


(Pawel Krakowiak) #1

Say I have a simple mapping that defines only a few properties. Then I
index documents that have a few times more properties, including the
ones specified in the mapping. What happens to those extra properties
that were not defined in the mapping? Are they simply omitted (i.e.,
ignored - not indexed, not analyzed, not stored)?


(Clinton Gormley) #2

On Wed, 2011-07-20 at 02:10 -0700, Pawel Krakowiak wrote:

Say I have a simple mapping that defines only a few properties. Then I
index documents that have a few times more properties, including the
ones specified in the mapping. What happens to those extra properties
that were not defined in the mapping? Are they simply omitted (i.e.,
ignored - not indexed, not analyzed, not stored)?

They are dynamically added to the mapping based on the type of data they
appear to be, eg strings are added as analyzed, numbers as not_analyzed.

No field is set to 'stored' by default, as it is usually more efficient
to just get the data out of _source (ie the JSON document that you
index)

clint


(Pawel Krakowiak) #3

On 20 Lip, 11:14, Clinton Gormley clin...@iannounce.co.uk wrote:

They are dynamically added to the mapping based on the type of data they
appear to be, eg strings are added as analyzed, numbers as not_analyzed.

So if I don't want to store something, I need to tell ES explicitly to
skip it? Please note that I am talking of a scenario where I already
have a mapping in place (hence not the situation where there's no
mapping and I'm adding a document for the first time).


(Clinton Gormley) #4

Hiya

On 20 Lip, 11:14, Clinton Gormley clin...@iannounce.co.uk wrote:

They are dynamically added to the mapping based on the type of data they
appear to be, eg strings are added as analyzed, numbers as not_analyzed.

So if I don't want to store something, I need to tell ES explicitly to
skip it? Please note that I am talking of a scenario where I already
have a mapping in place (hence not the situation where there's no
mapping and I'm adding a document for the first time).

Note: there is a difference between 'store' and 'index'. No field is
stored by default (except for the _source).

However, all fields will be indexed by default, unless you specify
otherwise

clint


(Pawel Krakowiak) #5

On 20 Lip, 12:32, Clinton Gormley clin...@iannounce.co.uk wrote:

Note: there is a difference between 'store' and 'index'. No field is
stored by default (except for the _source).

Noted. Sorry for incorrect wording.

However, all fields will be indexed by default, unless you specify
otherwise

I see. Thank you for the clarification.


(system) #6