Static Mapping vs Dynamic Mapping when using templates


(Mysurf Mail) #1

Hi,
I have let my system run with dynamic mapping for a while.
It created a huge index form all of my entity data (current and history )
Many fields that I wouldn't like to index are being index.

So, I thought to change it to static mapping.
This way I would set only thte fields I need,
My problem is that
a. The index is still very big, but that's ok.
b. In dynamic mapping a lot of definitions are now written in one place - the template (using matcher).
In static mapping I will not be able to define it in one place.

Changing a behavior in static mapping will require me to change it in multiple places.

Is there a way to apply a template behaviour in static mapping ?
When is it considered a good practice to use static mapping?


How to properly define a hashmap in ElasticSearch
(Mark Walkom) #2

This is the choice you need to make between the two.
It'd be nice if we could use the wildcard matching with a strict template, but it's just not currently possible unfortunately.


(system) #3