|
@@ -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');
|