.oO SearXNG Developer Documentation Oo.
Loading...
Searching...
No Matches
offline.py
Go to the documentation of this file.
1
# SPDX-License-Identifier: AGPL-3.0-or-later
2
"""Processors for engine-type: ``offline``
3
4
"""
5
6
from
.abstract
import
EngineProcessor
7
8
9
class
OfflineProcessor
(
EngineProcessor
):
10
"""Processor class used by ``offline`` engines"""
11
12
engine_type =
'offline'
13
14
def
_search_basic
(self, query, params):
15
return
self.
engine
.search(query, params)
16
17
def
search(self, query, params, result_container, start_time, timeout_limit):
18
try
:
19
search_results = self.
_search_basic
(query, params)
20
self.
extend_container
(result_container, start_time, search_results)
21
except
ValueError
as
e:
22
# do not record the error
23
self.
logger
.exception(
'engine {0} : invalid input : {1}'
.
format
(self.
engine_name
engine_name
, e))
24
except
Exception
as
e:
# pylint: disable=broad-except
25
self.
handle_exception
(result_container, e)
26
self.
logger
.exception(
'engine {0} : exception : {1}'
.
format
(self.
engine_name
engine_name
, e))
searx.search.processors.abstract.EngineProcessor
Definition
abstract.py:58
searx.search.processors.abstract.EngineProcessor.engine
engine
Definition
abstract.py:64
searx.search.processors.abstract.EngineProcessor.engine_name
engine_name
Definition
abstract.py:65
searx.search.processors.abstract.EngineProcessor.logger
logger
Definition
abstract.py:66
searx.search.processors.abstract.EngineProcessor.handle_exception
handle_exception(self, result_container, exception_or_message, suspend=False)
Definition
abstract.py:85
searx.search.processors.abstract.EngineProcessor.extend_container
extend_container(self, result_container, start_time, search_results)
Definition
abstract.py:120
searx.search.processors.offline.OfflineProcessor
Definition
offline.py:9
searx.search.processors.offline.OfflineProcessor._search_basic
_search_basic(self, query, params)
Definition
offline.py:14
searx.search.processors.offline.OfflineProcessor.engine_name
engine_name
Definition
offline.py:23
searx.format
format
Definition
__init__.py:94
searxng
searx
search
processors
offline.py
Generated on Sat Nov 16 2024 00:10:57 for .oO SearXNG Developer Documentation Oo. by
1.12.0