Reduce description indexation size
This commit is contained in:
parent
1a2d9ea921
commit
2edc24cae3
|
@ -138,7 +138,7 @@
|
||||||
import Pagination from '../components/Pagination.vue'
|
import Pagination from '../components/Pagination.vue'
|
||||||
import SearchInput from '../components/SearchInput.vue'
|
import SearchInput from '../components/SearchInput.vue'
|
||||||
import SortButton from '../components/SortButton.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 Nprogress from 'nprogress'
|
||||||
import { APIPlaylist } from '../../../server/types/playlist.model'
|
import { APIPlaylist } from '../../../server/types/playlist.model'
|
||||||
import { PlaylistsSearchQuery } from '../../../server/types/search-query/playlist-search.model'
|
import { PlaylistsSearchQuery } from '../../../server/types/search-query/playlist-search.model'
|
||||||
|
|
|
@ -3,9 +3,9 @@ meilisearch:
|
||||||
api_key: '4kMeZtP0QsgE3QCDSEMYUt_WFusGjq5JgOc9atujpKw'
|
api_key: '4kMeZtP0QsgE3QCDSEMYUt_WFusGjq5JgOc9atujpKw'
|
||||||
|
|
||||||
indexes:
|
indexes:
|
||||||
videos: 'peertube-index-videos-test1'
|
videos: 'peertube-index-videos-test2'
|
||||||
channels: 'peertube-index-channels-test1'
|
channels: 'peertube-index-channels-test2'
|
||||||
playlists: 'peertube-index-playlists-test1'
|
playlists: 'peertube-index-playlists-test2'
|
||||||
|
|
||||||
search-instance:
|
search-instance:
|
||||||
name_image: '/theme/framasoft/img/title.svg'
|
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 { formatVideoForDB } from '../meilisearch/meilisearch-videos'
|
||||||
import { getVideo } from '../requests/peertube-instance'
|
import { getVideo } from '../requests/peertube-instance'
|
||||||
import { DBVideo, IndexableVideo } from '../../types/video.model'
|
import { DBVideo, IndexableVideo } from '../../types/video.model'
|
||||||
import { client } from '../../helpers/meilisearch'
|
|
||||||
|
|
||||||
export class VideoIndexer extends AbstractIndexer <IndexableVideo, DBVideo> {
|
export class VideoIndexer extends AbstractIndexer <IndexableVideo, DBVideo> {
|
||||||
protected readonly indexQueue: QueueObject<QueueParam>
|
protected readonly indexQueue: QueueObject<QueueParam>
|
||||||
|
@ -34,7 +33,7 @@ export class VideoIndexer extends AbstractIndexer <IndexableVideo, DBVideo> {
|
||||||
'tags',
|
'tags',
|
||||||
'account.displayName',
|
'account.displayName',
|
||||||
'channel.displayName',
|
'channel.displayName',
|
||||||
'description'
|
'searchableDescription'
|
||||||
]
|
]
|
||||||
|
|
||||||
protected readonly rankingRules = [
|
protected readonly rankingRules = [
|
||||||
|
|
|
@ -109,6 +109,7 @@ export function formatVideoForDB (v: IndexableVideo | IndexableVideoDetails): DB
|
||||||
|
|
||||||
truncatedDescription: v.truncatedDescription,
|
truncatedDescription: v.truncatedDescription,
|
||||||
description: v.description,
|
description: v.description,
|
||||||
|
searchableDescription: (v.description || v.truncatedDescription || '').slice(0, 250),
|
||||||
|
|
||||||
waitTranscoding: v.waitTranscoding,
|
waitTranscoding: v.waitTranscoding,
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,8 @@ interface DBVideoShared {
|
||||||
|
|
||||||
host: string
|
host: string
|
||||||
url: string
|
url: string
|
||||||
|
|
||||||
|
searchableDescription: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DBVideo extends Omit<Video, IgnoredVideoFields>, DBVideoShared {
|
export interface DBVideo extends Omit<Video, IgnoredVideoFields>, DBVideoShared {
|
||||||
|
|
Loading…
Reference in New Issue