Heya,
You did not wait enough :), by default, the index timeout is 1 minute, and then you would have gotten an UnavailableShards failure. This happens because you start a single node, and create an index with 2 replicas. By default, an index request will be executed only if there is a quorum of shards active (in our case, 2). But, since we have only 1 node, we have 1 shard and no replicas allocated.
You can control the timeout by passing the timeout parameter. You can control the consistency level as well on writes.
If this make sense, and you verify it with testing (I did locally), you can close the issue. This is the expected behavior
-shay.banon
On Tuesday, January 11, 2011 at 4:53 PM, medcl2000@gmail.com wrote:
hey shay,
seems there is a problem on dynamic mapping,after using index template,the dynamic mapping doesn't seems to work,and here is ther recreation,can you pls have a look at.
curl -XPUT http://localhost:9200/_template/temp12 -d'{"mappings":{"mytype":{"properties":{"identity":{"precision_step":4,"type":"float","boost":1.0,"include_in_all":true,"index":"analyzed","store":"no"},"datetime":{"precision_step":4,"type":"date","boost":1.0,"include_in_all":true,"index":"analyzed","store":"no"}}}},"template":"tte*","order":0,"settings":{"number_of_shards":3,"number_of_replicas":2}}'
curl -XPUT http://localhost:9200/tte124 -d'{"settings":{"number_of_shards":3,"number_of_replicas":2}}'
echo " //that works"
curl -XPUT http://localhost:9200/tte123/type/123 -d'{"a":543}'
echo "//time_out with dynamic type and data ï¼data with 123 will missing"
and iâve created a issue track it,here:dynamic mapping doesn't work after using index template · Issue #619 · elastic/elasticsearch · GitHub