Index template

I've created the following template:

$ curl 'http://myserver:9200/_template/template_1' -d '
{
"template" : "*",
"order" : 0,
"settings" : {
"number_of_shards" : 5,
"number_of_replicas" : 1
},
"analysis" : {
"analyzer" : {
"default" : {
"type" : "keyword"
}
}
},
"mappings" : {
"content" : {
"Abstract" : {
"type" : "string",
"index" : "analyzed"
},
"Title" : {
"type" : "string",
"index" : "analyzed"
},
"SubTitle" : {
"type" : "string",
"index" : "analyzed"
},
"Body" : {
"type" : "string",
"index" : "analyzed"
},
"CreatedOn" : { "type" : "date" },
"AvailableOn" : { "type" : "date" },
"PubDate" : { "type" : "date" },
"PublishedOn" : { "type" : "date" }
}
}
}}'

2 Questions.....

#1 is this an appropriate spot to define the analyzer (assuming its
want I want as default in my indexes) ?

#2 When I create a new index the mapping doesnt seem to apply, I try
the following:

$ curl -XPUT 'http://myserver:9200/testthetemplate'
{"ok":true,"acknowledged":true}

$ curl 'http://ec2-107-22-54-249.compute-1.amazonaws.com:9200/
testthetemplate/_mapping'
{"testthetemplate":{"content":{"properties":{}}}}

My template is blank...it sees the content type there but none of the
fields are defined....further (in case it needed me to populate...)
when I add data the mappings do not apply.

I'm using ES 0.18.2

Any help appreciated.

Hi Mehtryx

On Tue, 2011-11-08 at 12:52 -0800, Mehtryx wrote:

I've created the following template:

Please gist these curl statements instead of pasting into the email.
See Elasticsearch Platform — Find real-time answers at scale | Elastic

$ curl 'http://myserver:9200/_template/template_1' -d '
{
"template" : "*",
"order" : 0,
"settings" : {
"number_of_shards" : 5,
"number_of_replicas" : 1
},
"analysis" : {
"analyzer" : {
"default" : {
"type" : "keyword"
}
}
},

The analysis section should be part of 'settings' - that's probably
throwing the mapping off.

clint