I am trying to do a simple test to get ES to use a template of relying on default mapping to make sure the correct mappings are applied for each data type and not analyze all fields. It does not seem to apply the template. I dropped the index and template, reloaded using the template below but nothing changes. Any idea what I am doing wrong here? Regards, Frank.
config file output:
elasticsearch
{
manage_template => true
template => "c:/elasticsearch-1.6.0/config/templates/map-test/map-test.json"
host => "localhost"
index => "map-test"
workers => 1
document_type => "test1"
}
my template:
{
"template": "map-test",
"order" : 1,
"mappings" : {
"properties" : {
"test1" : {
"pk_col" : { "type": "string", "index": "not_analyzed"},
"dt_type" : { "type": "date", "format": "yyyy MM dd HH:mm:ss:SSS", "index": "not_analyzed" },
"int_type": { "type": "integer" ,"index": "not_analyzed"},
"float_type" : { "type" : "float", "index": "not_analyzed" },
"str_type_analyzed" : { "type" : "string", "index" : "analyzed" },
"str_type_not_analyzed" : { "type" : "string", "index" : "not_analyzed" }
}
}
}
}
It sees the templates per the log file:
{:timestamp=>"2015-08-10T13:57:22.609000-0500", :message=>"Automatic template management enabled", :manage_template=>"true", :level=>:info}
{:timestamp=>"2015-08-10T13:57:22.765000-0500", :message=>"Using mapping template", :template=>{"template"=>"map-test", "order"=>1, "mappings"=>{"properties"=>{"test1"=>{"pk_col"=>{"type"=>"string", "index"=>"not_analyzed"}, "dt_type"=>{"type"=>"date", "format"=>"yyyy MM dd HH:mm:ss:SSS", "index"=>"not_analyzed"}, "int_type"=>{"type"=>"integer", "index"=>"not_analyzed"}, "float_type"=>{"type"=>"float", "index"=>"not_analyzed"}, "str_type_analyzed"=>{"type"=>"string", "index"=>"analyzed"}, "str_type_not_analyzed"=>{"type"=>"string", "index"=>"not_analyzed"}}}}}, :level=>:info}