在domain上指定settings
@Document(indexName = "myindex", type = "mylog", shards = 1, replicas = 1)
@Setting(settingPath = "elasticsearch/settings.json")
public class MyLog {
//...
}
在resources文件夹下建立指定的配置
src/main/resources/elasticsearch/settings.json
{
"index": {
"action.write_consistency" : "all"
}
}
测试
@Test
public void reCreateIndex() {
elasticsearchTemplate.deleteIndex(MyLog.class);
elasticsearchTemplate.createIndex(MyLog.class);
}
查看
curl -XGET 192.168.99.100:9200/myindex/_settings
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。