@Document(indexName = "myindex", type = "mylog", shards = 1, replicas = 1) @Setting(settingPath = "elasticsearch/settings.json") public class MyLog { //... }
src/main/resources/elasticsearch/settings.jsonjava
{ "index": { "action.write_consistency" : "all" } }
@Test public void reCreateIndex() { elasticsearchTemplate.deleteIndex(MyLog.class); elasticsearchTemplate.createIndex(MyLog.class); }
查看git
curl -XGET 192.168.99.100:9200/myindex/_settings