mirror of
https://github.com/searxng/searxng.git
synced 2026-05-29 22:24:13 +02:00
[mod] normalize variable name for the max number of results per request (#6131)
[mod] normalize variable name for the max number of results per request In the past, we have used different names for the variable that specifies the maximum number of hits in the outgoing request. - ``page_size`` - ``number_of_results`` - ``nb_per_page`` Since *page_size* is the most accurate term and is also used in the XPath engines, all other engines are adjusted accordingly within this patch .. documentation adjusted accordingly. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
@@ -56,7 +56,7 @@ the API key in the engine :ref:`core engine config`."""
|
||||
|
||||
categories = ["science", "scientific publications"]
|
||||
paging = True
|
||||
nb_per_page = 10
|
||||
page_size = 10
|
||||
base_url = "https://api.core.ac.uk/v3/search/works/"
|
||||
|
||||
|
||||
@@ -77,8 +77,8 @@ def request(query: str, params: "OnlineParams") -> None:
|
||||
# API v3 uses different parameters
|
||||
search_params = {
|
||||
"q": query,
|
||||
"offset": (params["pageno"] - 1) * nb_per_page,
|
||||
"limit": nb_per_page,
|
||||
"offset": (params["pageno"] - 1) * page_size,
|
||||
"limit": page_size,
|
||||
"sort": "relevance",
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user