mirror of
https://git.vectorsigma.ru/public/tubearchivist.git
synced 2026-08-05 02:09:28 +00:00
implement source and lang keywords for full text search
This commit is contained in:
@@ -252,6 +252,8 @@ class SearchParser:
|
||||
"full": {
|
||||
"index": "ta_subtitle",
|
||||
"term": [],
|
||||
"lang": [],
|
||||
"source": [],
|
||||
},
|
||||
}
|
||||
|
||||
@@ -481,6 +483,14 @@ class QueryBuilder:
|
||||
}
|
||||
)
|
||||
|
||||
if (lang := self.query_map.get("lang")) is not None:
|
||||
must_list.append({"term": {"subtitle_lang": {"value": lang[0]}}})
|
||||
|
||||
if (source := self.query_map.get("source")) is not None:
|
||||
must_list.append(
|
||||
{"term": {"subtitle_source": {"value": source[0]}}}
|
||||
)
|
||||
|
||||
query = {
|
||||
"size": 30,
|
||||
"_source": {"excludes": "subtitle_line"},
|
||||
|
||||
Reference in New Issue
Block a user