nosql-engines.rst 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. .. _nosql engines:
  2. ===============
  3. NoSQL databases
  4. ===============
  5. .. sidebar:: further read
  6. - `NoSQL databases <https://en.wikipedia.org/wiki/NoSQL>`_
  7. - `redis.io <https://redis.io/>`_
  8. - `MongoDB <https://www.mongodb.com>`_
  9. .. contents::
  10. :depth: 2
  11. :local:
  12. :backlinks: entry
  13. .. sidebar:: info
  14. Initial sponsored by `Search and Discovery Fund
  15. <https://nlnet.nl/discovery>`_ of `NLnet Foundation <https://nlnet.nl/>`_.
  16. The following `NoSQL databases`_ are supported:
  17. - :ref:`engine redis_server`
  18. - :ref:`engine mongodb`
  19. All of the engines above are just commented out in the :origin:`settings.yml
  20. <searx/settings.yml>`, as you have to set various options and install
  21. dependencies before using them.
  22. By default, the engines use the ``key-value`` template for displaying results /
  23. see :origin:`simple <searx/templates/simple/result_templates/key-value.html>`
  24. theme. If you are not satisfied with the original result layout, you can use
  25. your own template, set ``result_template`` attribute to ``{template_name}`` and
  26. place the templates at::
  27. searx/templates/{theme_name}/result_templates/{template_name}
  28. Furthermore, if you do not wish to expose these engines on a public instance, you
  29. can still add them and limit the access by setting ``tokens`` as described in
  30. section :ref:`private engines`.
  31. Extra Dependencies
  32. ==================
  33. For using :ref:`engine redis_server` or :ref:`engine mongodb` you need to
  34. install additional packages in Python's Virtual Environment of your SearXNG
  35. instance. To switch into the environment (:ref:`searxng-src`) you can use
  36. :ref:`searxng.sh`::
  37. $ sudo utils/searxng.sh instance cmd bash
  38. (searxng-pyenv)$ pip install ...
  39. Configure the engines
  40. =====================
  41. `NoSQL databases`_ are used for storing arbitrary data without first defining
  42. their structure.
  43. .. _engine redis_server:
  44. Redis Server
  45. ------------
  46. .. _redis: https://github.com/andymccurdy/redis-py#installation
  47. .. sidebar:: info
  48. - ``pip install`` redis_
  49. - redis.io_
  50. - :origin:`redis_server.py <searx/engines/redis_server.py>`
  51. .. automodule:: searx.engines.redis_server
  52. :members:
  53. .. _engine mongodb:
  54. MongoDB
  55. -------
  56. .. _pymongo: https://github.com/mongodb/mongo-python-driver#installation
  57. .. sidebar:: info
  58. - ``pip install`` pymongo_
  59. - MongoDB_
  60. - :origin:`mongodb.py <searx/engines/mongodb.py>`
  61. .. automodule:: searx.engines.mongodb
  62. :members: