Reduce description indexation size
This commit is contained in:
parent
1a2d9ea921
commit
2edc24cae3
|
@ -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'
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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 = [
|
||||
|
|
|
@ -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,
|
||||
|
||||
|
|
|
@ -21,6 +21,8 @@ interface DBVideoShared {
|
|||
|
||||
host: string
|
||||
url: string
|
||||
|
||||
searchableDescription: string
|
||||
}
|
||||
|
||||
export interface DBVideo extends Omit<Video, IgnoredVideoFields>, DBVideoShared {
|
||||
|
|
Loading…
Reference in New Issue