diff --git a/server/lib/indexers/channel-indexer.ts b/server/lib/indexers/channel-indexer.ts index 501ff11..689f400 100644 --- a/server/lib/indexers/channel-indexer.ts +++ b/server/lib/indexers/channel-indexer.ts @@ -1,7 +1,7 @@ import { logger } from '../../helpers/logger' import { CONFIG } from '../../initializers/constants' import { DBChannel, IndexableChannel } from '../../types/channel.model' -import { formatChannelForDB } from '../elastic-search/elastic-search-channels' +import { buildChannelsMapping, formatChannelForDB } from '../elastic-search/elastic-search-channels' import { getChannel } from '../requests/peertube-instance' import { AbstractIndexer } from './shared' @@ -24,4 +24,8 @@ export class ChannelIndexer extends AbstractIndexer { @@ -13,4 +13,8 @@ export class PlaylistIndexer extends AbstractIndexer { protected readonly indexQueue: AsyncQueue abstract indexSpecificElement (host: string, uuid: string): Promise + abstract buildMapping (): object constructor ( protected readonly indexName: string, @@ -33,7 +34,7 @@ export abstract class AbstractIndexer { } initIndex () { - return buildIndex(this.indexName, buildVideosMapping()) + return buildIndex(this.indexName, this.buildMapping()) } scheduleIndexation (host: string, identifier: string) { diff --git a/server/lib/indexers/video-indexer.ts b/server/lib/indexers/video-indexer.ts index 4002fb7..42e0f3a 100644 --- a/server/lib/indexers/video-indexer.ts +++ b/server/lib/indexers/video-indexer.ts @@ -1,7 +1,7 @@ import { logger } from '../../helpers/logger' import { CONFIG } from '../../initializers/constants' import { DBVideo, IndexableVideo } from '../../types/video.model' -import { formatVideoForDB } from '../elastic-search/elastic-search-videos' +import { buildVideosMapping, formatVideoForDB } from '../elastic-search/elastic-search-videos' import { getVideo } from '../requests/peertube-instance' import { AbstractIndexer } from './shared' @@ -18,4 +18,8 @@ export class VideoIndexer extends AbstractIndexer { return this.indexElements([ video ], true) } + + buildMapping () { + return buildVideosMapping() + } }