Yuki Takei 6 лет назад
Родитель
Сommit
de8d8b3aa9

+ 1 - 1
src/server/routes/apiv3/search.js

@@ -77,7 +77,7 @@ module.exports = (crowi) => {
 
 
       switch (operation) {
       switch (operation) {
         case 'normalize':
         case 'normalize':
-          search.initIndices();
+          search.normalizeIndices();
           break;
           break;
         case 'rebuild':
         case 'rebuild':
           search.buildIndex();
           search.buildIndex();

+ 2 - 2
src/server/service/search-delegator/elasticsearch.js

@@ -94,7 +94,7 @@ class ElasticsearchDelegator {
   }
   }
 
 
   async init() {
   async init() {
-    return this.initIndices();
+    return this.normalizeIndices();
   }
   }
 
 
   async getInfo() {
   async getInfo() {
@@ -197,7 +197,7 @@ class ElasticsearchDelegator {
     await client.indices.delete({ index: tmpIndexName });
     await client.indices.delete({ index: tmpIndexName });
   }
   }
 
 
-  async initIndices() {
+  async normalizeIndices() {
     const { client, indexName, aliasName } = this;
     const { client, indexName, aliasName } = this;
 
 
     const tmpIndexName = `${indexName}-tmp`;
     const tmpIndexName = `${indexName}-tmp`;

+ 4 - 0
src/server/service/search.js

@@ -72,6 +72,10 @@ class SearchService {
     return this.delegator.getInfoForAdmin();
     return this.delegator.getInfoForAdmin();
   }
   }
 
 
+  async normalizeIndices() {
+    return this.delegator.normalizeIndices();
+  }
+
   async buildIndex() {
   async buildIndex() {
     return this.delegator.buildIndex();
     return this.delegator.buildIndex();
   }
   }