Reduce description indexation size

This commit is contained in:
Chocobozzz 2023-11-13 11:01:17 +01:00
parent 1a2d9ea921
commit 2edc24cae3
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
5 changed files with 8 additions and 6 deletions

View File

@ -138,7 +138,7 @@
import Pagination from '../components/Pagination.vue'
import SearchInput from '../components/SearchInput.vue'
import SortButton from '../components/SortButton.vue'
import { VideoChannelsSearchQuery, ResultList, VideosSearchQuery } from '@peertube/peertube-types'
import type { VideoChannelsSearchQuery, ResultList, VideosSearchQuery } from '@peertube/peertube-types'
import Nprogress from 'nprogress'
import { APIPlaylist } from '../../../server/types/playlist.model'
import { PlaylistsSearchQuery } from '../../../server/types/search-query/playlist-search.model'

View File

@ -3,9 +3,9 @@ meilisearch:
api_key: '4kMeZtP0QsgE3QCDSEMYUt_WFusGjq5JgOc9atujpKw'
indexes:
videos: 'peertube-index-videos-test1'
channels: 'peertube-index-channels-test1'
playlists: 'peertube-index-playlists-test1'
videos: 'peertube-index-videos-test2'
channels: 'peertube-index-channels-test2'
playlists: 'peertube-index-playlists-test2'
search-instance:
name_image: '/theme/framasoft/img/title.svg'

View File

@ -5,7 +5,6 @@ import { CONFIG, SORTABLE_COLUMNS } from '../../initializers/constants'
import { formatVideoForDB } from '../meilisearch/meilisearch-videos'
import { getVideo } from '../requests/peertube-instance'
import { DBVideo, IndexableVideo } from '../../types/video.model'
import { client } from '../../helpers/meilisearch'
export class VideoIndexer extends AbstractIndexer <IndexableVideo, DBVideo> {
protected readonly indexQueue: QueueObject<QueueParam>
@ -34,7 +33,7 @@ export class VideoIndexer extends AbstractIndexer <IndexableVideo, DBVideo> {
'tags',
'account.displayName',
'channel.displayName',
'description'
'searchableDescription'
]
protected readonly rankingRules = [

View File

@ -109,6 +109,7 @@ export function formatVideoForDB (v: IndexableVideo | IndexableVideoDetails): DB
truncatedDescription: v.truncatedDescription,
description: v.description,
searchableDescription: (v.description || v.truncatedDescription || '').slice(0, 250),
waitTranscoding: v.waitTranscoding,

View File

@ -21,6 +21,8 @@ interface DBVideoShared {
host: string
url: string
searchableDescription: string
}
export interface DBVideo extends Omit<Video, IgnoredVideoFields>, DBVideoShared {