.oO SearXNG Developer Documentation Oo.
|
Public Member Functions | |
__init__ (self, "Engine|types.ModuleType" engine) | |
initialize (self, t.Callable[["EngineProcessor", bool], bool] callback) | |
bool | init_engine (self) |
handle_exception (self, "ResultContainer" result_container, BaseException|str exception_or_message, bool suspend=False) | |
extend_container (self, "ResultContainer" result_container, float start_time, "list[Result | LegacyResult]|None" search_results) | |
bool | extend_container_if_suspended (self, "ResultContainer" result_container) |
RequestParams|None | get_params (self, "SearchQuery" search_query, str engine_category) |
search (self, str query, RequestParams params, "ResultContainer" result_container, float start_time, float timeout_limit) | |
get_tests (self) | |
get_default_tests (self) |
Public Attributes | |
engine = engine | |
logging.Logger | logger = engines[engine.name].logger |
SuspendedStatus | suspended_status = SUSPENDED_STATUS.setdefault(key, SuspendedStatus()) |
Protected Member Functions | |
_extend_container_basic (self, "ResultContainer" result_container, float start_time, "list[Result | LegacyResult]" search_results) |
Base classes used for all types of request processors.
Definition at line 111 of file abstract.py.
searx.search.processors.abstract.EngineProcessor.__init__ | ( | self, | |
"Engine|types.ModuleType" | engine ) |
Definition at line 116 of file abstract.py.
|
protected |
Definition at line 193 of file abstract.py.
References searx.result_types._base.LegacyResult.engine, searx.result_types._base.MainResult.engine, searx.result_types._base.Result.engine, and engine.
Referenced by extend_container().
searx.search.processors.abstract.EngineProcessor.extend_container | ( | self, | |
"ResultContainer" | result_container, | ||
float | start_time, | ||
"list[Result | LegacyResult]|None" | search_results ) |
Definition at line 210 of file abstract.py.
References _extend_container_basic(), handle_exception(), and suspended_status.
Referenced by searx.search.processors.offline.OfflineProcessor.search(), and searx.search.processors.online.OnlineProcessor.search().
bool searx.search.processors.abstract.EngineProcessor.extend_container_if_suspended | ( | self, | |
"ResultContainer" | result_container ) |
Definition at line 225 of file abstract.py.
References searx.result_types._base.LegacyResult.engine, searx.result_types._base.MainResult.engine, searx.result_types._base.Result.engine, engine, and suspended_status.
searx.search.processors.abstract.EngineProcessor.get_default_tests | ( | self | ) |
Definition at line 296 of file abstract.py.
RequestParams | None searx.search.processors.abstract.EngineProcessor.get_params | ( | self, | |
"SearchQuery" | search_query, | ||
str | engine_category ) |
Returns a dictionary with the :ref:`request parameters <engine request arguments>` (:py:obj:`RequestParams`), if the search condition is not supported by the engine, ``None`` is returned: - *time range* filter in search conditions, but the engine does not have a corresponding filter - page number > 1 when engine does not support paging - page number > ``max_page``
Reimplemented in searx.search.processors.online.OnlineProcessor, searx.search.processors.online_currency.OnlineCurrencyProcessor, searx.search.processors.online_dictionary.OnlineDictionaryProcessor, and searx.search.processors.online_url_search.OnlineUrlSearchProcessor.
Definition at line 233 of file abstract.py.
References searx.result_types._base.LegacyResult.engine, searx.result_types._base.MainResult.engine, searx.result_types._base.Result.engine, engine, and searx.get_setting().
searx.search.processors.abstract.EngineProcessor.get_tests | ( | self | ) |
Definition at line 292 of file abstract.py.
searx.search.processors.abstract.EngineProcessor.handle_exception | ( | self, | |
"ResultContainer" | result_container, | ||
BaseException | str | exception_or_message, | ||
bool | suspend = False ) |
Definition at line 165 of file abstract.py.
References searx.result_types._base.LegacyResult.engine, searx.result_types._base.MainResult.engine, searx.result_types._base.Result.engine, engine, and suspended_status.
Referenced by extend_container(), searx.search.processors.offline.OfflineProcessor.search(), and searx.search.processors.online.OnlineProcessor.search().
bool searx.search.processors.abstract.EngineProcessor.init_engine | ( | self | ) |
Reimplemented in searx.search.processors.online.OnlineProcessor.
Definition at line 151 of file abstract.py.
References searx.result_types._base.LegacyResult.engine, searx.result_types._base.MainResult.engine, searx.result_types._base.Result.engine, and engine.
Referenced by initialize().
searx.search.processors.abstract.EngineProcessor.initialize | ( | self, | |
t.Callable[["EngineProcessor", bool], bool] | callback ) |
Initialization of *this* :py:obj:`EngineProcessor`. If processor's engine has an ``init`` method, it is called first. Engine's ``init`` method is executed in a thread, meaning that the *registration* (the ``callback``) may occur later and is not already established by the return from this registration method. Registration only takes place if the ``init`` method is not available or is successfully run through.
Reimplemented in searx.search.processors.online_currency.OnlineCurrencyProcessor.
Definition at line 123 of file abstract.py.
References searx.result_types._base.LegacyResult.engine, searx.result_types._base.MainResult.engine, searx.result_types._base.Result.engine, engine, and init_engine().
searx.search.processors.abstract.EngineProcessor.search | ( | self, | |
str | query, | ||
RequestParams | params, | ||
"ResultContainer" | result_container, | ||
float | start_time, | ||
float | timeout_limit ) |
Reimplemented in searx.search.processors.offline.OfflineProcessor, and searx.search.processors.online.OnlineProcessor.
Definition at line 282 of file abstract.py.
searx.search.processors.abstract.EngineProcessor.engine = engine |
Definition at line 117 of file abstract.py.
Referenced by _extend_container_basic(), searx.search.processors.online.OnlineProcessor._search_basic(), searx.search.processors.online.OnlineProcessor._send_http_request(), extend_container_if_suspended(), get_params(), searx.search.processors.online.OnlineProcessor.get_params(), handle_exception(), init_engine(), searx.search.processors.online.OnlineProcessor.init_engine(), searx.search.processors.online.OnlineProcessor.init_network_in_thread(), initialize(), searx.search.processors.offline.OfflineProcessor.search(), and searx.search.processors.online.OnlineProcessor.search().
logging.Logger searx.search.processors.abstract.EngineProcessor.logger = engines[engine.name].logger |
Definition at line 118 of file abstract.py.
Referenced by searx.search.processors.online.OnlineProcessor.get_params(), searx.search.processors.offline.OfflineProcessor.search(), and searx.search.processors.online.OnlineProcessor.search().
SuspendedStatus searx.search.processors.abstract.EngineProcessor.suspended_status = SUSPENDED_STATUS.setdefault(key, SuspendedStatus()) |
Definition at line 121 of file abstract.py.
Referenced by extend_container(), extend_container_if_suspended(), and handle_exception().