.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
6from .abstract import EngineProcessor
7
8
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_nameengine_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_nameengine_name, e))
handle_exception(self, result_container, exception_or_message, suspend=False)
Definition abstract.py:85
extend_container(self, result_container, start_time, search_results)
Definition abstract.py:120