.oO SearXNG Developer Documentation Oo.
|
Public Member Functions | |
None | __init__ (self, "PluginCfg" plg_cfg) |
bool | on_result (self, "SXNG_Request" request, "SearchWithPlugins" search, Result result) |
bool | init (self, "flask.Flask" app) |
![]() | |
None | __init__ (self, PluginCfg plg_cfg) |
int | __hash__ (self) |
__eq__ (self, other) | |
bool | pre_search (self, SXNG_Request request, "SearchWithPlugins" search) |
None|typing.Sequence[Result] | post_search (self, SXNG_Request request, "SearchWithPlugins" search) |
Public Attributes | |
info | |
Protected Member Functions | |
dict[re.Pattern, str]|set|None | _load_regular_expressions (self, settings_key) |
Additional Inherited Members | |
![]() | |
str | id = "" |
typing | active .ClassVar[bool] |
list | keywords = [] |
logging | log .Logger |
str | fqn = "" |
Rewrite hostnames, remove results or prioritize them.
Definition at line 114 of file hostnames.py.
None searx.plugins.hostnames.SXNGPlugin.__init__ | ( | self, | |
"PluginCfg" | plg_cfg ) |
Definition at line 119 of file hostnames.py.
References __init__().
Referenced by __init__().
|
protected |
Definition at line 165 of file hostnames.py.
References searx.plugins._core.Plugin.id.
Referenced by init().
bool searx.plugins.hostnames.SXNGPlugin.init | ( | self, | |
"flask.Flask" | app ) |
Initialization of the plugin, the return value decides whether this plugin is active or not. Initialization only takes place once, at the time the WEB application is set up. The base methode always returns ``True``, the methode can be overwritten in the inheritances, - ``True`` plugin is active - ``False`` plugin is inactive
Reimplemented from searx.plugins._core.Plugin.
Definition at line 151 of file hostnames.py.
References _load_regular_expressions(), and searx.plugins._core.Plugin.id.
Referenced by searx.sqlitedb.SQLiteAppl.connect().
bool searx.plugins.hostnames.SXNGPlugin.on_result | ( | self, | |
"SXNG_Request" | request, | ||
"SearchWithPlugins" | search, | ||
Result | result ) |
Runs for each result of each engine and returns a boolean: - ``True`` to keep the result - ``False`` to remove the result from the result list The ``result`` can be modified to the needs. .. hint:: If :py:obj:`Result.url <searx.result_types._base.Result.url>` is modified, :py:obj:`Result.parsed_url <searx.result_types._base.Result.parsed_url>` must be changed accordingly: .. code:: python result["parsed_url"] = urlparse(result["url"])
Reimplemented from searx.plugins._core.Plugin.
Definition at line 128 of file hostnames.py.
searx.plugins.hostnames.SXNGPlugin.info |
Definition at line 121 of file hostnames.py.