on gh-pages help sign in
searx/blog/search-database-engines.html
182 lines 11 kB history raw
2<!DOCTYPE html>
4<html>
5 <head>
6 <meta charset="utf-8" />
7 <meta name="viewport" content="width=device-width, initial-scale=1.0" />
8 <meta name="viewport" content="width=device-width, initial-scale=1">
9 <title>Query more of your NoSQL stores &#8212; Searx Documentation (Searx-1.0.0.tex)</title>
10 <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
11 <link rel="stylesheet" type="text/css" href="../_static/searx.css" />
12 <link rel="stylesheet" type="text/css" href="../_static/tabs.css" />
13 <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
14 <script src="../_static/jquery.js"></script>
15 <script src="../_static/underscore.js"></script>
16 <script src="../_static/doctools.js"></script>
17 <link rel="index" title="Index" href="../genindex.html" />
18 <link rel="search" title="Search" href="../search.html" />
19 <link rel="next" title="Query SQL servers" href="sql-engines.html" />
20 <link rel="prev" title="Blog" href="index.html" />
21 </head><body>
22 <div class="related" role="navigation" aria-label="related navigation">
23 <h3>Navigation</h3>
24 <ul>
25 <li class="right" style="margin-right: 10px">
26 <a href="../genindex.html" title="General Index"
27 accesskey="I">index</a></li>
28 <li class="right" >
29 <a href="../py-modindex.html" title="Python Module Index"
30 >modules</a> |</li>
31 <li class="right" >
32 <a href="sql-engines.html" title="Query SQL servers"
33 accesskey="N">next</a> |</li>
34 <li class="right" >
35 <a href="index.html" title="Blog"
36 accesskey="P">previous</a> |</li>
37 <li class="nav-item nav-item-0"><a href="../index.html">Searx Documentation (Searx-1.0.0.tex)</a> &#187;</li>
38 <li class="nav-item nav-item-1"><a href="index.html" accesskey="U">Blog</a> &#187;</li>
39 <li class="nav-item nav-item-this"><a href="">Query more of your NoSQL stores</a></li>
40 </ul>
41 </div>
43 <div class="document">
44 <div class="documentwrapper">
45 <div class="bodywrapper">
46 <div class="body" role="main">
48 <div class="section" id="query-more-of-your-nosql-stores">
49<h1>Query more of your NoSQL stores<a class="headerlink" href="#query-more-of-your-nosql-stores" title="Permalink to this headline">¶</a></h1>
50<p>From now on, searx lets you to query your NoSQL data stores:</p>
51<ul class="simple">
52<li><p><a class="reference external" href="https://redis.io/">Redis</a></p></li>
53<li><p><a class="reference external" href="https://mongodb.com/">MongoDB</a></p></li>
54</ul>
55<p>The reference configuration of the engines are included <code class="docutils literal notranslate"><span class="pre">settings.yml</span></code> just commented out,
56as you have to set various options and install dependencies before using them.</p>
57<p>By default, the engines use <code class="docutils literal notranslate"><span class="pre">key-value</span></code> template for displaying results.
58If you are not satisfied with the original result layout,
59you can use your owm template by placing the template under
60<code class="docutils literal notranslate"><span class="pre">searx/templates/{theme_name}/result_templates/{template_name}</span></code> and setting
61<code class="docutils literal notranslate"><span class="pre">result_template</span></code> attribute to <code class="docutils literal notranslate"><span class="pre">{template_name}</span></code>.</p>
62<p>Futhermore, if you do not want to expose these engines on a public instance, you can
63still add them and limit the access by setting <code class="docutils literal notranslate"><span class="pre">tokens</span></code> as described in the <a class="reference external" href="private-engines.html#private-engines">blog post about
64private engines</a>.</p>
65<div class="section" id="configuring-searx-to-use-the-stores">
66<h2>Configuring searx to use the stores<a class="headerlink" href="#configuring-searx-to-use-the-stores" title="Permalink to this headline">¶</a></h2>
67<p>NoSQL data stores are used for storing arbitrary data without first defining their
68structure.</p>
69<div class="section" id="redis">
70<h3>Redis<a class="headerlink" href="#redis" title="Permalink to this headline">¶</a></h3>
71<p>Reqired package: <code class="docutils literal notranslate"><span class="pre">redis</span></code></p>
72<p>Redis is a key value based data store usually stored in memory.</p>
73<p>Select a database to search in and set its index in the option <code class="docutils literal notranslate"><span class="pre">db</span></code>. You can
74either look for exact matches or use partial keywords to find what you are looking for
75by configuring <code class="docutils literal notranslate"><span class="pre">exact_match_only</span></code>.</p>
76<p>In this example you can search for exact matches in your first database:</p>
77<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="p p-Indicator">-</span> <span class="nt">name </span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">mystore</span>
78 <span class="nt">engine </span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">redis_server</span>
79 <span class="nt">exact_match_only </span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">True</span>
80 <span class="nt">host </span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">127.0.0.1</span>
81 <span class="nt">port </span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">6379</span>
82 <span class="nt">password </span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">secret-password</span>
83 <span class="nt">db </span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">0</span>
84 <span class="nt">shortcut </span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">rds</span>
85 <span class="nt">enable_http </span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">True</span>
86</pre></div>
87</div>
88</div>
89<div class="section" id="mongodb">
90<h3>MongoDB<a class="headerlink" href="#mongodb" title="Permalink to this headline">¶</a></h3>
91<p>Required package: <code class="docutils literal notranslate"><span class="pre">pymongo</span></code></p>
92<p>MongoDB is a document based database program that handles JSON like data.</p>
93<p>In order to query MongoDB, you have to select a <code class="docutils literal notranslate"><span class="pre">database</span></code> and a <code class="docutils literal notranslate"><span class="pre">collection</span></code>. Furthermore,
94you have to select a <code class="docutils literal notranslate"><span class="pre">key</span></code> that is going to be searched. MongoDB also supports the option <code class="docutils literal notranslate"><span class="pre">exact_match_only</span></code>, so configure it
95as you wish.</p>
96<p>Above is an example configuration for using a MongoDB collection:</p>
97<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="p p-Indicator">-</span> <span class="nt">name </span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">mymongo</span>
98 <span class="nt">engine </span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">mongodb</span>
99 <span class="nt">shortcut </span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">md</span>
100 <span class="nt">host </span><span class="p">:</span> <span class="s">&#39;127.0.0.1&#39;</span>
101 <span class="nt">port </span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">27017</span>
102 <span class="nt">database </span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">personal</span>
103 <span class="nt">collection </span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">income</span>
104 <span class="nt">key </span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">month</span>
105 <span class="nt">enable_http</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">True</span>
106</pre></div>
107</div>
108</div>
109</div>
110<div class="section" id="acknowledgement">
111<h2>Acknowledgement<a class="headerlink" href="#acknowledgement" title="Permalink to this headline">¶</a></h2>
112<p>This development was sponsored by <a class="reference external" href="https://nlnet.nl/discovery">Search and Discovery Fund</a> of <a class="reference external" href="https://nlnet.nl/">NLnet Foundation</a> .</p>
113<div class="line-block">
114<div class="line">Happy hacking.</div>
115<div class="line">kvch // 2021.07.13 23:16</div>
116</div>
117</div>
118</div>
121 <div class="clearer"></div>
122 </div>
123 </div>
124 </div>
125 <span id="sidebar-top"></span>
126 <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
127 <div class="sphinxsidebarwrapper">
130 <p class="logo"><a href="../index.html">
131 <img class="logo" src="../_static/searx_logo_small.png" alt="Logo"/>
132 </a></p>
135 <h3>Project Links</h3>
136 <ul>
137 <li><a href="blog/index.html">Blog</a>
139 <li><a href="https://github.com/searx/searx">Source</a>
141 <li><a href="https://github.com/searx/searx/wiki">Wiki</a>
143 <li><a href="https://searx.space">Public instances</a>
145 <li><a href="https://twitter.com/Searx_engine">Twitter</a>
147 <li><a href="https://github.com/searx/searx/issues">Issue Tracker</a>
148 </ul><h3>Navigation</h3>
149<ul>
150 <li><a href="../index.html">Overview</a>
151 <ul>
152 <li><a href="index.html">Blog</a>
153 <ul>
154 <li>Previous: <a href="index.html" title="previous chapter">Blog</a>
155 <li>Next: <a href="sql-engines.html" title="next chapter">Query SQL servers</a></ul>
156 </li>
157 </ul>
158 </li>
159</ul>
160<div id="searchbox" style="display: none" role="search">
161 <h3 id="searchlabel">Quick search</h3>
162 <div class="searchformwrapper">
163 <form class="search" action="../search.html" method="get">
164 <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
165 <input type="submit" value="Go" />
166 </form>
167 </div>
168</div>
169<script>$('#searchbox').show(0);</script>
170 </div>
171 </div>
172 <div class="clearer"></div>
173 </div>
175 <div class="footer" role="contentinfo">
176 &#169; Copyright 2015-2021, Adam Tauber, Noémi Ványi.
177 Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
178 </div>
179 <script src="../_static/version_warning_offset.js"></script>
181 </body>
182</html>