diff --git a/backend/common/src/searching.py b/backend/common/src/searching.py index 17c164b1..44b75d0b 100644 --- a/backend/common/src/searching.py +++ b/backend/common/src/searching.py @@ -113,6 +113,7 @@ class SearchParser: "index": "ta_subtitle", "lang": [], "source": [], + "channel": [], }, } @@ -345,6 +346,22 @@ class QueryBuilder: """build query for fulltext search""" must_list = [] + if (channel := self.query_map.get("channel")) is not None: + must_list.append( + { + "multi_match": { + "query": channel, + "type": "bool_prefix", + "fuzziness": self._get_fuzzy(), + "operator": "and", + "fields": [ + "subtitle_channel", + "subtitle_channel.keyword", + ], + } + } + ) + if (term := self.query_map.get("term")) is not None: must_list.append( {