mirror of
https://github.com/searxng/searxng.git
synced 2024-11-29 22:21:02 +00:00
[mod] engine hex: add sort_criteria & page_size to configuration
This commit is contained in:
parent
75e4b65127
commit
87165ac532
2 changed files with 7 additions and 1 deletions
|
@ -21,6 +21,9 @@ categories = ["it", "packages"]
|
||||||
# engine dependent config
|
# engine dependent config
|
||||||
paging = True
|
paging = True
|
||||||
search_url = "https://hex.pm/api/packages/"
|
search_url = "https://hex.pm/api/packages/"
|
||||||
|
# Valid values: name inserted_at updated_at total_downloads recent_downloads
|
||||||
|
sort_criteria = "recent_downloads"
|
||||||
|
page_size = 10
|
||||||
|
|
||||||
linked_terms = {
|
linked_terms = {
|
||||||
# lower-case : replacement
|
# lower-case : replacement
|
||||||
|
@ -47,7 +50,7 @@ linked_terms = {
|
||||||
|
|
||||||
|
|
||||||
def request(query: str, params):
|
def request(query: str, params):
|
||||||
args = urlencode({"page": params["pageno"], "search": query})
|
args = urlencode({"page": params["pageno"], "per_page": page_size, "sort": sort_criteria, "search": query})
|
||||||
params["url"] = f"{search_url}?{args}"
|
params["url"] = f"{search_url}?{args}"
|
||||||
return params
|
return params
|
||||||
|
|
||||||
|
|
|
@ -923,6 +923,9 @@ engines:
|
||||||
engine: hex
|
engine: hex
|
||||||
shortcut: hex
|
shortcut: hex
|
||||||
disabled: true
|
disabled: true
|
||||||
|
# Valid values: name inserted_at updated_at total_downloads recent_downloads
|
||||||
|
sort_criteria: "recent_downloads"
|
||||||
|
page_size: 10
|
||||||
|
|
||||||
- name: crates.io
|
- name: crates.io
|
||||||
engine: crates
|
engine: crates
|
||||||
|
|
Loading…
Reference in a new issue