When elasticsearch-1.0.0.Beta2 index data [/ config / templates / template.json] is not in effect


(persist.kong) #1

I downloaded elasticsearch-1.0.0.Beta2.
and copied [elasticsearch-0.90.7/config/templates/mytemplate.json] to [elasticsearch-1.0.0.Beta2/config/templates/mytemplate.json],
but when I index data, I found that it did not work.
So I deleted the [mytemplate.json]. And I copied json from official website to [elasticsearch-1.0.0.Beta2/config/templates/test.json]
And I copied the official website json to
elasticsearch-1.0.0.Beta2/config/templates/test.json
(http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-templates.html
) .

{
"template_1": {
"template": "*",
"settings": {
"index.number_of_shards": 2
}
"mappings": {
"default": {
"_source": {
"enabled": false
}
}
"type1": {
"_all": {
"enabled": false
}
}
}
}
}

</ code>
My code

BulkRequestBuilder bulkRequest2 = client.prepareBulk ();
for (int i = 0; i <10; i + +) {
XContentBuilder endObject = jsonBuilder (). StartObject ()
. field ("user", "kimchy"). field ("postDate", new Date ())
. field ("age", i)
. field ("message", "trying out Elastic Search")
. endObject ();

bulkRequest2.add (client.prepareIndex ("test", "test") setSource
(endObject).);

}
bulkRequest2.execute () actionGet ().;

</ code>

Console Information
[2013-12-11 23:10:07,676] [INFO] [cluster.metadata] [Ymir] [test] creating
index, cause [auto (bulk api)], shards [5] / [1], mappi
ngs []
[2013-12-11 23:10:08,929] [INFO] [cluster.metadata] [Ymir] [test]
update_mapping [test] (dynamic)

Obviously the template does not work.
I need some help。

--
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/fd369a62-51f7-4398-898a-d2d5480d3b58%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(system) #2