summaryrefslogtreecommitdiff
path: root/searx/engines
diff options
context:
space:
mode:
authorDaniel Kukula <daniel.kuku@gmail.com>2024-05-16 20:44:34 +0100
committerMarkus Heiser <markus.heiser@darmarIT.de>2024-05-28 11:55:59 +0200
commit87165ac5322ab87a8b5bfded2c749a79b4958dca (patch)
tree2e3d66d70c8163e539561ef58cf360ee890b395f /searx/engines
parent75e4b65127668a1d3bfe559ecca38687b6433a7c (diff)
downloadsearxng-87165ac5322ab87a8b5bfded2c749a79b4958dca.tar.gz
searxng-87165ac5322ab87a8b5bfded2c749a79b4958dca.zip
[mod] engine hex: add sort_criteria & page_size to configuration
Diffstat (limited to 'searx/engines')
-rw-r--r--searx/engines/hex.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/searx/engines/hex.py b/searx/engines/hex.py
index 2c1036f4d..4c4920f68 100644
--- a/searx/engines/hex.py
+++ b/searx/engines/hex.py
@@ -21,6 +21,9 @@ categories = ["it", "packages"]
# engine dependent config
paging = True
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 = {
# lower-case : replacement
@@ -47,7 +50,7 @@ linked_terms = {
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}"
return params