Răsfoiți Sursa

Merge branch 'support/support-es9' into imprv/168543-make-search-query-type-safe

Shun Miyazawa 9 luni în urmă
părinte
comite
0f0ad9749e

+ 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;
 
-  delegetorVersion = 7 as const;
+  delegatorVersion = 7 as const;
 
   constructor(options: ClientOptions, rejectUnauthorized: boolean) {
     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;
 
-  delegetorVersion = 8 as const;
+  delegatorVersion = 8 as const;
 
   constructor(options: ClientOptions, rejectUnauthorized: boolean) {
     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;
 
-  delegetorVersion = 9 as const;
+  delegatorVersion = 9 as const;
 
   constructor(options: ClientOptions, rejectUnauthorized: boolean) {
     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
-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;
 };

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

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