.oO SearXNG Developer Documentation Oo.
|
Functions | |
init (_) | |
_get_request_id (query, params) | |
request (query, params) | |
_strip_leading_strings (text) | |
parse_search_query (json_results) | |
response (resp) | |
Variables | |
dict | about |
bool | paging = True |
bool | safesearch = True |
bool | time_range_support = True |
bool | send_accept_language_header = True |
list | categories = ["general", "web"] |
str | search_type = "search" |
str | base_url = "https://presearch.com" |
dict | safesearch_map = {0: 'false', 1: 'true', 2: 'true'} |
Presearch supports the search types listed in :py:obj:`search_type` (general, images, videos, news). Configured ``presarch`` engines: .. code:: yaml - name: presearch engine: presearch search_type: search categories: [general, web] - name: presearch images ... search_type: images categories: [images, web] - name: presearch videos ... search_type: videos categories: [general, web] - name: presearch news ... search_type: news categories: [news, web] .. hint:: By default Presearch's video category is intentionally placed into:: categories: [general, web] Search type ``video`` ===================== The results in the video category are most often links to pages that contain a video, for instance many links from Preasearch's video category link content from facebook (aka Meta) or Twitter (aka X). Since these are not real links to video streams SearXNG can't use the video template for this and if SearXNG can't use this template, then the user doesn't want to see these hits in the videos category. Languages & Regions =================== In Presearch there are languages for the UI and regions for narrowing down the search. If we set "auto" for the region in the WEB-UI of Presearch and cookie ``use_local_search_results=false``, then the defaults are set for both (the language and the region) from the ``Accept-Language`` header. Since the region is already "auto" by default, we only need to set the ``use_local_search_results`` cookie and send the ``Accept-Language`` header. We have to set these values in both requests we send to Presearch; in the first request to get the request-ID from Presearch and in the final request to get the result list (see ``send_accept_language_header``). Implementations ===============
|
protected |
Definition at line 98 of file presearch.py.
Referenced by searx.engines.presearch.request().
|
protected |
Definition at line 151 of file presearch.py.
Referenced by searx.engines.presearch.parse_search_query().
searx.engines.presearch.init | ( | _ | ) |
Definition at line 93 of file presearch.py.
searx.engines.presearch.parse_search_query | ( | json_results | ) |
Definition at line 158 of file presearch.py.
References searx.engines.presearch._strip_leading_strings().
Referenced by searx.engines.presearch.response().
searx.engines.presearch.request | ( | query, | |
params ) |
Definition at line 143 of file presearch.py.
References searx.engines.presearch._get_request_id().
searx.engines.presearch.response | ( | resp | ) |
Definition at line 216 of file presearch.py.
References searx.engines.presearch.parse_search_query().
dict searx.engines.presearch.about |
Definition at line 72 of file presearch.py.
str searx.engines.presearch.base_url = "https://presearch.com" |
Definition at line 89 of file presearch.py.
list searx.engines.presearch.categories = ["general", "web"] |
Definition at line 84 of file presearch.py.
bool searx.engines.presearch.paging = True |
Definition at line 80 of file presearch.py.
bool searx.engines.presearch.safesearch = True |
Definition at line 81 of file presearch.py.
dict searx.engines.presearch.safesearch_map = {0: 'false', 1: 'true', 2: 'true'} |
Definition at line 90 of file presearch.py.
str searx.engines.presearch.search_type = "search" |
Definition at line 86 of file presearch.py.
bool searx.engines.presearch.send_accept_language_header = True |
Definition at line 83 of file presearch.py.
bool searx.engines.presearch.time_range_support = True |
Definition at line 82 of file presearch.py.