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( { diff --git a/frontend/src/components/SearchExampleQueries.tsx b/frontend/src/components/SearchExampleQueries.tsx index 1c181c6e..a4822b61 100644 --- a/frontend/src/components/SearchExampleQueries.tsx +++ b/frontend/src/components/SearchExampleQueries.tsx @@ -104,6 +104,10 @@ const SearchExampleQueries = () => { auto-generated subtitles only, or user to search through user-uploaded subtitles only +
full:javascript channel:corey schafer)
+