on master help sign in
searx/docs/blog/search-database-engines.rst
95 lines 2.7 kB history raw
1===============================
2Query more of your NoSQL stores
3===============================
5From now on, searx lets you to query your NoSQL data stores:
7* `Redis`_
8* `MongoDB`_
10The reference configuration of the engines are included ``settings.yml`` just commented out,
11as you have to set various options and install dependencies before using them.
13By default, the engines use ``key-value`` template for displaying results.
14If you are not satisfied with the original result layout,
15you can use your owm template by placing the template under
16``searx/templates/{theme_name}/result_templates/{template_name}`` and setting
17``result_template`` attribute to ``{template_name}``.
19Futhermore, if you do not want to expose these engines on a public instance, you can
20still add them and limit the access by setting ``tokens`` as described in the `blog post about
21private engines`_.
23Configuring searx to use the stores
24===================================
26NoSQL data stores are used for storing arbitrary data without first defining their
27structure.
29Redis
30-----
32Reqired package: ``redis``
34Redis is a key value based data store usually stored in memory.
36Select a database to search in and set its index in the option ``db``. You can
37either look for exact matches or use partial keywords to find what you are looking for
38by configuring ``exact_match_only``.
40In this example you can search for exact matches in your first database:
42.. code:: yaml
44 - name : mystore
45 engine : redis_server
46 exact_match_only : True
47 host : 127.0.0.1
48 port : 6379
49 password : secret-password
50 db : 0
51 shortcut : rds
52 enable_http : True
55MongoDB
56-------
58Required package: ``pymongo``
60MongoDB is a document based database program that handles JSON like data.
62In order to query MongoDB, you have to select a ``database`` and a ``collection``. Furthermore,
63you have to select a ``key`` that is going to be searched. MongoDB also supports the option ``exact_match_only``, so configure it
64as you wish.
66Above is an example configuration for using a MongoDB collection:
68.. code:: yaml
70 - name : mymongo
71 engine : mongodb
72 shortcut : md
73 host : '127.0.0.1'
74 port : 27017
75 database : personal
76 collection : income
77 key : month
78 enable_http: True
81Acknowledgement
82===============
84This development was sponsored by `Search and Discovery Fund`_ of `NLnet Foundation`_ .
86.. _Redis: https://redis.io/
87.. _MongoDB: https://mongodb.com/
88.. _blog post about private engines: private-engines.html#private-engines
89.. _Search and Discovery Fund: https://nlnet.nl/discovery
90.. _NLnet Foundation: https://nlnet.nl/
93| Happy hacking.
94| kvch // 2021.07.13 23:16