Add channel filter support to subtitle search queries
This commit is contained in:
parent
a30528f358
commit
f99a6cdf69
|
|
@ -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(
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue