Browse Source

#647 wait for yellow status

Shinsuke Sugaya 9 năm trước cách đây
mục cha
commit
1b7ff889db

+ 2 - 2
src/main/java/org/codelibs/fess/es/client/FessEsClient.java

@@ -413,8 +413,8 @@ public class FessEsClient implements Client {
 
 
             final String updatedIndexName;
             final String updatedIndexName;
             if (isFessIndex) {
             if (isFessIndex) {
-                client.admin().indices().prepareRefresh(fessConfig.getIndexDocumentUpdateIndex()).execute()
-                        .actionGet(fessConfig.getIndexIndicesTimeout());
+                client.admin().cluster().prepareHealth(fessConfig.getIndexDocumentUpdateIndex()).setWaitForYellowStatus().execute()
+                        .actionGet();
                 final GetIndexResponse response =
                 final GetIndexResponse response =
                         client.admin().indices().prepareGetIndex().addIndices(fessConfig.getIndexDocumentUpdateIndex()).execute()
                         client.admin().indices().prepareGetIndex().addIndices(fessConfig.getIndexDocumentUpdateIndex()).execute()
                                 .actionGet(fessConfig.getIndexIndicesTimeout());
                                 .actionGet(fessConfig.getIndexIndicesTimeout());