Shun Miyazawa 8 месяцев назад
Родитель
Сommit
799e57ed76

+ 1 - 1
apps/app/src/server/service/search-delegator/elasticsearch-client-delegator/es7-client-delegator.ts

@@ -11,7 +11,7 @@ export class ES7ClientDelegator {
 
 
   private client: Client;
   private client: Client;
 
 
-  delegetorVersion = 7 as const;
+  delegatorVersion = 7 as const;
 
 
   constructor(options: ClientOptions, rejectUnauthorized: boolean) {
   constructor(options: ClientOptions, rejectUnauthorized: boolean) {
     this.client = new Client({ ...options, ssl: { rejectUnauthorized } });
     this.client = new Client({ ...options, ssl: { rejectUnauthorized } });

+ 1 - 1
apps/app/src/server/service/search-delegator/elasticsearch-client-delegator/es8-client-delegator.ts

@@ -4,7 +4,7 @@ export class ES8ClientDelegator {
 
 
   private client: Client;
   private client: Client;
 
 
-  delegetorVersion = 8 as const;
+  delegatorVersion = 8 as const;
 
 
   constructor(options: ClientOptions, rejectUnauthorized: boolean) {
   constructor(options: ClientOptions, rejectUnauthorized: boolean) {
     this.client = new Client({ ...options, tls: { rejectUnauthorized } });
     this.client = new Client({ ...options, tls: { rejectUnauthorized } });

+ 1 - 1
apps/app/src/server/service/search-delegator/elasticsearch-client-delegator/es9-client-delegator.ts

@@ -4,7 +4,7 @@ export class ES9ClientDelegator {
 
 
   private client: Client;
   private client: Client;
 
 
-  delegetorVersion = 9 as const;
+  delegatorVersion = 9 as const;
 
 
   constructor(options: ClientOptions, rejectUnauthorized: boolean) {
   constructor(options: ClientOptions, rejectUnauthorized: boolean) {
     this.client = new Client({ ...options, tls: { rejectUnauthorized } });
     this.client = new Client({ ...options, tls: { rejectUnauthorized } });

+ 7 - 7
apps/app/src/server/service/search-delegator/elasticsearch-client-delegator/interfaces.ts

@@ -6,15 +6,15 @@ export type ElasticsearchClientDelegator = ES7ClientDelegator | ES8ClientDelegat
 
 
 
 
 // type guard
 // type guard
-export const isES7ClientDelegetor = (delegator: ElasticsearchClientDelegator): delegator is ES7ClientDelegator => {
-  return delegator.delegetorVersion === 7;
+// TODO: https://redmine.weseek.co.jp/issues/168446
+export const isES7ClientDelegator = (delegator: ElasticsearchClientDelegator): delegator is ES7ClientDelegator => {
+  return delegator.delegatorVersion === 7;
 };
 };
 
 
-export const isES8ClientDelegetor = (delegator: ElasticsearchClientDelegator): delegator is ES8ClientDelegator => {
-  return delegator.delegetorVersion === 8;
+export const isES8ClientDelegator = (delegator: ElasticsearchClientDelegator): delegator is ES8ClientDelegator => {
+  return delegator.delegatorVersion === 8;
 };
 };
 
 
-// TODO: https://redmine.weseek.co.jp/issues/168446
-export const isES9ClientDelegetor = (delegator: ElasticsearchClientDelegator): delegator is ES9ClientDelegator => {
-  return delegator.delegetorVersion === 9;
+export const isES9ClientDelegator = (delegator: ElasticsearchClientDelegator): delegator is ES9ClientDelegator => {
+  return delegator.delegatorVersion === 9;
 };
 };

+ 4 - 4
apps/app/src/server/service/search-delegator/elasticsearch.ts

@@ -25,7 +25,7 @@ import type { UpdateOrInsertPagesOpts } from '../interfaces/search';
 import { aggregatePipelineToIndex } from './aggregate-to-index';
 import { aggregatePipelineToIndex } from './aggregate-to-index';
 import type { AggregatedPage, BulkWriteBody, BulkWriteCommand } from './bulk-write';
 import type { AggregatedPage, BulkWriteBody, BulkWriteCommand } from './bulk-write';
 import {
 import {
-  getClient, type ElasticsearchClientDelegator, isES9ClientDelegetor, isES7ClientDelegetor, isES8ClientDelegetor,
+  getClient, type ElasticsearchClientDelegator, isES9ClientDelegator, isES7ClientDelegator, isES8ClientDelegator,
 } from './elasticsearch-client-delegator';
 } from './elasticsearch-client-delegator';
 
 
 const logger = loggerFactory('growi:service:search-delegator:elasticsearch');
 const logger = loggerFactory('growi:service:search-delegator:elasticsearch');
@@ -318,7 +318,7 @@ class ElasticsearchDelegator implements SearchDelegator<Data, ESTermsKey, ESQuer
 
 
   async createIndex(index: string) {
   async createIndex(index: string) {
     // TODO: https://redmine.weseek.co.jp/issues/168446
     // TODO: https://redmine.weseek.co.jp/issues/168446
-    if (isES7ClientDelegetor(this.client)) {
+    if (isES7ClientDelegator(this.client)) {
       const { mappings } = await import('^/resource/search/mappings-es7');
       const { mappings } = await import('^/resource/search/mappings-es7');
       return this.client.indices.create({
       return this.client.indices.create({
         index,
         index,
@@ -328,7 +328,7 @@ class ElasticsearchDelegator implements SearchDelegator<Data, ESTermsKey, ESQuer
       });
       });
     }
     }
 
 
-    if (isES8ClientDelegetor(this.client)) {
+    if (isES8ClientDelegator(this.client)) {
       const { mappings } = await import('^/resource/search/mappings-es8');
       const { mappings } = await import('^/resource/search/mappings-es8');
       return this.client.indices.create({
       return this.client.indices.create({
         index,
         index,
@@ -336,7 +336,7 @@ class ElasticsearchDelegator implements SearchDelegator<Data, ESTermsKey, ESQuer
       });
       });
     }
     }
 
 
-    if (isES9ClientDelegetor(this.client)) {
+    if (isES9ClientDelegator(this.client)) {
       const { mappings } = process.env.CI == null
       const { mappings } = process.env.CI == null
         ? await import('^/resource/search/mappings-es9')
         ? await import('^/resource/search/mappings-es9')
         : await import('^/resource/search/mappings-es9-for-ci');
         : await import('^/resource/search/mappings-es9-for-ci');