| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 | ===============================Preparation for offline engines===============================Offline engines===============To extend the functionality of searx, offline engines are going to beintroduced.  An offline engine is an engine which does not need Internetconnection to perform a search and does not use HTTP to communicate.Offline engines can be configured as online engines, by adding those to the`engines` list of :origin:`settings.yml <searx/settings.yml>`.  Thus, searxfinds the engine file and imports it.Example skeleton for the new engines:.. code:: python   from subprocess import PIPE, Popen   categories = ['general']   offline = True   def init(settings):       pass   def search(query, params):       process = Popen(['ls', query], stdout=PIPE)       return_code = process.wait()       if return_code != 0:           raise RuntimeError('non-zero return code', return_code)       results = []       line = process.stdout.readline()       while line:           result = parse_line(line)           results.append(results)           line = process.stdout.readline()       return resultsDevelopment progress====================First, a proposal has been created as a Github issue.  Then it was moved to thewiki as a design document.  You can read it here: :wiki:`Offline-engines`.In this development step, searx core was prepared to accept and perform offlinesearches.  Offline search requests are scheduled together with regular offlinerequests.As offline searches can return arbitrary results depending on the engine, thecurrent result templates were insufficient to present such results.  Thus, a newtemplate is introduced which is caplable of presenting arbitrary key value pairsas a table. You can check out the pull request for more details see:pull:`1700`.Next steps==========Today, it is possible to create/run an offline engine. However, it is going to be publicly available for everyone who knows the searx instance. So the next step is to introduce token based access for engines. This way administrators are able to limit the access to private engines.Acknowledgement===============This development was sponsored by `Search and Discovery Fund`_ of `NLnet Foundation`_ ... _Search and Discovery Fund: https://nlnet.nl/discovery.. _NLnet Foundation: https://nlnet.nl/| Happy hacking.| kvch // 2019.10.21 17:03
 |