Merge branch 'search-uuid' into 'master'

Support UUID search #44

See merge request framasoft/peertube/search-index!14
This commit is contained in:
Chocobozzz 2022-12-05 09:48:40 +00:00
commit 2d532893f6
2 changed files with 32 additions and 0 deletions

View File

@ -68,6 +68,12 @@ videos-search:
# * default: use default Elastic Search match query, including fuzziness
# * phrase: use Elastic Search phrase match query
search-fields:
uuid:
boost: 100
match_type: 'default'
short-uuid:
boost: 100
match_type: 'default'
name:
boost: 5
match_type: 'default'
@ -117,6 +123,12 @@ playlists-search:
# * default: use default Elastic Search match query, including fuzziness
# * phrase: use Elastic Search phrase match query
search-fields:
uuid:
boost: 100
match_type: 'default'
short-uuid:
boost: 100
match_type: 'default'
display-name:
boost: 5
match_type: 'default'

View File

@ -45,6 +45,16 @@ const CONFIG = {
ENABLED: config.get<boolean>('videos-search.boost-languages.enabled')
},
SEARCH_FIELDS: {
UUID: {
FIELD_NAME: 'uuid',
BOOST: config.get<number>('videos-search.search-fields.uuid.boost'),
MATCH_TYPE: config.get<string>('videos-search.search-fields.uuid.match_type')
},
SHORT_UUID: {
FIELD_NAME: 'shortUUID',
BOOST: config.get<number>('videos-search.search-fields.short-uuid.boost'),
MATCH_TYPE: config.get<string>('videos-search.search-fields.short-uuid.match_type')
},
NAME: {
FIELD_NAME: 'name',
BOOST: config.get<number>('videos-search.search-fields.name.boost'),
@ -98,6 +108,16 @@ const CONFIG = {
},
PLAYLISTS_SEARCH: {
SEARCH_FIELDS: {
UUID: {
FIELD_NAME: 'uuid',
BOOST: config.get<number>('playlists-search.search-fields.uuid.boost'),
MATCH_TYPE: config.get<string>('playlists-search.search-fields.uuid.match_type')
},
SHORT_UUID: {
FIELD_NAME: 'shortUUID',
BOOST: config.get<number>('playlists-search.search-fields.short-uuid.boost'),
MATCH_TYPE: config.get<string>('playlists-search.search-fields.short-uuid.match_type')
},
DISPLAY_NAME: {
FIELD_NAME: 'displayName',
BOOST: config.get<number>('playlists-search.search-fields.display-name.boost'),