mirror of
https://github.com/tubearchivist/tubearchivist.git
synced 2024-09-20 15:27:15 +00:00
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": {
|
"full": {
|
||||||
"index": "ta_subtitle",
|
"index": "ta_subtitle",
|
||||||
"term": [],
|
"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 = {
|
query = {
|
||||||
"size": 30,
|
"size": 30,
|
||||||
"_source": {"excludes": "subtitle_line"},
|
"_source": {"excludes": "subtitle_line"},
|
||||||
|
Loading…
Reference in New Issue
Block a user