Ryan,

The retrieve mappings step is not necessary. If it's automated, then it 
would also need to handle the situation where the new mappings are not 
compatible with the existing mappings. And ES already does that.

Your steps to check for the index and then, only if the index doesn't 
exist, create the index and put the mappings is good. I wrote a tool that 
does this, and I call it before my bulk-load updates are performed. I can 
also use it to update mappings, though I use that only for experimentation 
and not much for production. Still, it works well but sometimes I run into 
the case where the new mappings aren't compatible and then I learn a new 
thing or two!

The template idea is good; I used to use that. But once I figured out the 
Java put and get mappings, I don't do that anymore. I have 6 different 
indices on my laptop and each has its own unique mapping that is very 
different from that of any other index. So a template would be of no use to 
me.

I do lock down ES so that an index is never created automatically, nor is a 
new field in a new type created automatically; an explicit mapping is 
always required. That has really helped me juggle those 6 different indices 
and catch field name spelling errors and bad data really quickly.

Hope this helps! Post back if you'd like additional details on the Java API 
for putting and updating mappings.

Brian

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/c511fe05-544d-422e-9f79-e1d3ef924bed%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to