Improve channels search relevancy

This commit is contained in:
Chocobozzz 2024-01-15 11:23:14 +01:00
parent 06890d094e
commit 944afc977d
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
3 changed files with 20 additions and 7 deletions

View File

@ -7,6 +7,8 @@ meilisearch:
channels: 'peertube-index-channels-test2' channels: 'peertube-index-channels-test2'
playlists: 'peertube-index-playlists-test2' playlists: 'peertube-index-playlists-test2'
force_settings_update_at_startup: true
search-instance: search-instance:
name_image: '/theme/framasoft/img/title.svg' name_image: '/theme/framasoft/img/title.svg'
theme: 'framasoft' theme: 'framasoft'
@ -30,6 +32,7 @@ instances-index:
- 'tube.nah.re' - 'tube.nah.re'
- 'video.passageenseine.fr' - 'video.passageenseine.fr'
- 'peertube.luga.at' - 'peertube.luga.at'
- 'peertube.ch'
api: api:
blacklist: blacklist:

View File

@ -10,7 +10,17 @@ export class ChannelIndexer extends AbstractIndexer <IndexableChannel, DBChannel
protected readonly filterableAttributes = [ 'url', 'host', 'videosCount', 'ownerAccount.handle', 'handle' ] protected readonly filterableAttributes = [ 'url', 'host', 'videosCount', 'ownerAccount.handle', 'handle' ]
protected readonly sortableAttributes = SORTABLE_COLUMNS.CHANNELS_SEARCH protected readonly sortableAttributes = SORTABLE_COLUMNS.CHANNELS_SEARCH
// Keep the order, most important first // Keep the order, most important first
protected readonly searchableAttributes = [ 'name', 'displayName', 'ownerAccount.displayName', 'description' ] protected readonly searchableAttributes = [ 'name', 'displayName', 'ownerAccount.name', 'ownerAccount.displayName', 'description' ]
protected readonly rankingRules = [
'words',
'typo',
'proximity',
'attribute',
'sort',
'exactness',
'followersCount:desc'
]
constructor () { constructor () {
super(CONFIG.MEILISEARCH.INDEXES.CHANNELS, formatChannelForDB) super(CONFIG.MEILISEARCH.INDEXES.CHANNELS, formatChannelForDB)

View File

@ -37,12 +37,12 @@ export class VideoIndexer extends AbstractIndexer <IndexableVideo, DBVideo> {
] ]
protected readonly rankingRules = [ protected readonly rankingRules = [
"words", 'words',
"typo", 'typo',
"proximity", 'proximity',
"attribute", 'attribute',
"sort", 'sort',
"exactness", 'exactness',
'language:asc', 'language:asc',
'views:desc' 'views:desc'
] ]