From da5983f42b5d7f7e5492c828a09dd5420447976c Mon Sep 17 00:00:00 2001 From: Florent Date: Thu, 24 Nov 2022 17:04:53 +0100 Subject: [PATCH] Support UUID search #44 --- config/default.yaml | 12 ++++++++++++ server/initializers/constants.ts | 20 ++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/config/default.yaml b/config/default.yaml index 35c4475..8e857e7 100644 --- a/config/default.yaml +++ b/config/default.yaml @@ -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' diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index 8132e3b..e181db1 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts @@ -45,6 +45,16 @@ const CONFIG = { ENABLED: config.get('videos-search.boost-languages.enabled') }, SEARCH_FIELDS: { + UUID: { + FIELD_NAME: 'uuid', + BOOST: config.get('videos-search.search-fields.uuid.boost'), + MATCH_TYPE: config.get('videos-search.search-fields.uuid.match_type') + }, + SHORT_UUID: { + FIELD_NAME: 'shortUUID', + BOOST: config.get('videos-search.search-fields.short-uuid.boost'), + MATCH_TYPE: config.get('videos-search.search-fields.short-uuid.match_type') + }, NAME: { FIELD_NAME: 'name', BOOST: config.get('videos-search.search-fields.name.boost'), @@ -98,6 +108,16 @@ const CONFIG = { }, PLAYLISTS_SEARCH: { SEARCH_FIELDS: { + UUID: { + FIELD_NAME: 'uuid', + BOOST: config.get('playlists-search.search-fields.uuid.boost'), + MATCH_TYPE: config.get('playlists-search.search-fields.uuid.match_type') + }, + SHORT_UUID: { + FIELD_NAME: 'shortUUID', + BOOST: config.get('playlists-search.search-fields.short-uuid.boost'), + MATCH_TYPE: config.get('playlists-search.search-fields.short-uuid.match_type') + }, DISPLAY_NAME: { FIELD_NAME: 'displayName', BOOST: config.get('playlists-search.search-fields.display-name.boost'),