<p>All of the engines above are added to <codeclass="docutils literal notranslate"><spanclass="pre">settings.yml</span></code> just commented out, as you have to
set the required attributes for the engines, e.g. <codeclass="docutils literal notranslate"><spanclass="pre">database</span></code>. By default, the engines use
<codeclass="docutils literal notranslate"><spanclass="pre">key-value</span></code> template for displaying results. If you are not satisfied with the original result layout,
you can use your owm template by placing the template under
<codeclass="docutils literal notranslate"><spanclass="pre">searx/templates/{theme_name}/result_templates/{template_name}</span></code> and setting
<codeclass="docutils literal notranslate"><spanclass="pre">result_template</span></code> attribute to <codeclass="docutils literal notranslate"><spanclass="pre">{template_name}</span></code>.</p>
<p>As mentioned in previous blog posts, if you do not wish to expose these engines on a
public instance, you can still add them and limit the access by setting <codeclass="docutils literal notranslate"><spanclass="pre">tokens</span></code>
as described in the <aclass="reference external"href="private-engines.html#private-engines">blog post about private engines</a>.</p>
<divclass="section"id="configure-the-engines">
<h2>Configure the engines<aclass="headerlink"href="#configure-the-engines"title="Permalink to this headline">¶</a></h2>
<p>The configuration of the new database engines are similar. You must put a valid
SELECT SQL query in <codeclass="docutils literal notranslate"><spanclass="pre">query_str</span></code>. At the moment you can only bind at most
one parameter in your query. By setting the attribute <codeclass="docutils literal notranslate"><spanclass="pre">limit</span></code> you can
define how many results you want from the SQL server. Basically, it
is the same as the LIMIT keyword in SQL.</p>
<p>Please, do not include LIMIT or OFFSET in your SQL query as the engines
rely on these keywords during paging. If you want to configure the number of returned results
use the option <codeclass="docutils literal notranslate"><spanclass="pre">limit</span></code>.</p>
<divclass="section"id="postgresql">
<h3>PostgreSQL<aclass="headerlink"href="#postgresql"title="Permalink to this headline">¶</a></h3>
<p>PostgreSQL is a powerful and robust open source database.</p>
<p>Before configuring the PostgreSQL engine, you must install the dependency <codeclass="docutils literal notranslate"><spanclass="pre">psychopg2</span></code>.</p>
<p>You can find an example configuration below:</p>
<h3>MySQL<aclass="headerlink"href="#mysql"title="Permalink to this headline">¶</a></h3>
<p>MySQL is said to be the most popular open source database.</p>
<p>Before enabling MySQL engine, you must install the package <codeclass="docutils literal notranslate"><spanclass="pre">mysql-connector-python</span></code>.</p>
<p>The authentication plugin is configurable by setting <codeclass="docutils literal notranslate"><spanclass="pre">auth_plugin</span></code> in the attributes.
By default it is set to <codeclass="docutils literal notranslate"><spanclass="pre">caching_sha2_password</span></code>.</p>
<p>This is an example configuration for quering a MySQL server:</p>
<h3>SQLite<aclass="headerlink"href="#sqlite"title="Permalink to this headline">¶</a></h3>
<p>SQLite is a small, fast and reliable SQL database engine. It does not require
any extra dependency.</p>
<p>You can read from your database <codeclass="docutils literal notranslate"><spanclass="pre">my_database</span></code> using this example configuration:</p>
<h2>Next steps<aclass="headerlink"href="#next-steps"title="Permalink to this headline">¶</a></h2>
<p>The next step is to add support for more data stores, e.g. Redis and MongoDB.</p>
</div>
<divclass="section"id="acknowledgement">
<h2>Acknowledgement<aclass="headerlink"href="#acknowledgement"title="Permalink to this headline">¶</a></h2>
<p>This development was sponsored by <aclass="reference external"href="https://nlnet.nl/discovery">Search and Discovery Fund</a> of <aclass="reference external"href="https://nlnet.nl/">NLnet Foundation</a> .</p>