implement source and lang keywords for full text search
This commit is contained in:
parent
a40ebc7bbc
commit
55a73995c8
|
@ -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"},
|
||||
|
|
Loading…
Reference in New Issue