Support description truncation config
This commit is contained in:
parent
4064d313fc
commit
4b17bfa14f
|
@ -65,3 +65,6 @@ indexer:
|
|||
|
||||
# How much time to wait before bulk indexing in Meilisearch data
|
||||
bulk_indexation_interval_ms: 10000
|
||||
|
||||
videos:
|
||||
max_description_characters: 250
|
||||
|
|
|
@ -49,7 +49,10 @@ const CONFIG = {
|
|||
},
|
||||
INDEXER: {
|
||||
HOST_CONCURRENCY: config.get<number>('indexer.host_concurrency'),
|
||||
BULK_INDEXATION_INTERVAL_MS: config.get<number>('indexer.bulk_indexation_interval_ms')
|
||||
BULK_INDEXATION_INTERVAL_MS: config.get<number>('indexer.bulk_indexation_interval_ms'),
|
||||
VIDEOS: {
|
||||
MAX_DESCRIPTION_CHARACTERS: config.get<number>('indexer.videos.max_description_characters')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -128,7 +128,7 @@ export function formatVideoForDB (v: IndexableVideo | IndexableVideoDetails): DB
|
|||
|
||||
truncatedDescription: v.truncatedDescription,
|
||||
description: v.description,
|
||||
searchableDescription: (v.description || v.truncatedDescription || '').slice(0, 250),
|
||||
searchableDescription: (v.description || v.truncatedDescription || '').slice(0, CONFIG.INDEXER.VIDEOS.MAX_DESCRIPTION_CHARACTERS),
|
||||
|
||||
waitTranscoding: v.waitTranscoding,
|
||||
|
||||
|
|
Loading…
Reference in New Issue