Bladeren bron

修复number_of_shards无效

zhou-hao 4 jaren geleden
bovenliggende
commit
8025753407

+ 1 - 1
jetlinks-components/elasticsearch-component/src/main/java/org/jetlinks/community/elastic/search/index/ElasticSearchIndexProperties.java

@@ -19,7 +19,7 @@ public class ElasticSearchIndexProperties {
     public Settings toSettings() {
 
         return Settings.builder()
-            .put("number_of_shards", Math.min(1, numberOfShards))
+            .put("number_of_shards", Math.max(1, numberOfShards))
             .put("number_of_replicas", numberOfReplicas)
             .build();
     }