Deploying to gh-pages from @ 57e7e3bbf6 🚀

This commit is contained in:
kvch 2022-09-29 21:02:26 +00:00
parent 14d43c388e
commit 341eb1df8d
23 changed files with 1494 additions and 26 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

View File

@ -0,0 +1,129 @@
=====================================
Run shell commands from your instance
=====================================
Command line engines are custom engines that run commands in the shell of the
host. In this article you can learn how to create a command engine and how to
customize the result display.
The command
===========
When specifyng commands, you must make sure the commands are available on the
searx host. Searx will not install anything for you. Also, make sure that the
``searx`` user on your host is allowed to run the selected command and has
access to the required files.
Access control
==============
Be careful when creating command engines if you are running a public
instance. Do not expose any sensitive information. You can restrict access by
configuring a list of access tokens under tokens in your ``settings.yml``.
Available settings
==================
* ``command``: A comma separated list of the elements of the command. A special
token ``{{QUERY}}`` tells searx where to put the search terms of the
user. Example: ``['ls', '-l', '-h', '{{QUERY}}']``
* ``query_type``: The expected type of user search terms. Possible values:
``path`` and ``enum``. ``path`` checks if the uesr provided path is inside the
working directory. If not the query is not executed. ``enum`` is a list of
allowed search terms. If the user submits something which is not included in
the list, the query returns an error.
* ``delimiter``: A dict containing a delimiter char and the "titles" of each
element in keys.
* ``parse_regex``: A dict containing the regular expressions for each result
key.
* ``query_enum``: A list containing allowed search terms if ``query_type`` is
set to ``enum``.
* ``working_dir``: The directory where the command has to be executed. Default:
``.``
* ``result_separator``: The character that separates results. Default: ``\n``
Customize the result template
=============================
There is a default result template for displaying key-value pairs coming from
command engines. If you want something more tailored to your result types, you
can design your own template.
Searx relies on `Jinja2 <https://jinja.palletsprojects.com/>`_ for
templating. If you are familiar with Jinja, you will not have any issues
creating templates. You can access the result attributes with ``{{
result.attribute_name }}``.
In the example below the result has two attributes: ``header`` and ``content``.
To customize their diplay, you need the following template (you must define
these classes yourself):
.. code:: html
<div class="result">
<div class="result-header">
{{ result.header }}
</div>
<div class="result-content">
{{ result.content }}
</div>
</div>
Then put your template under ``searx/templates/{theme-name}/result_templates``
named ``your-template-name.html``. You can select your custom template with the
option ``result_template``.
.. code:: yaml
- name: your engine name
engine: command
result_template: your-template-name.html
Examples
========
Find files by name
------------------
The first example is to find files on your searx host. It uses the command
`find` available on most Linux distributions. It expects a path type query. The
path in the search request must be inside the ``working_dir``.
The results are displayed with the default `key-value.html` template. A result
is displayed in a single row table with the key "line".
.. code:: yaml
- name : find
engine : command
command : ['find', '.', '-name', '{{QUERY}}']
query_type : path
shortcut : fnd
tokens : []
disabled : True
delimiter :
chars : ' '
keys : ['line']
Find files by contents
-----------------------
In the second example, we define an engine that searches in the contents of the
files under the ``working_dir``. The search type is not defined, so the user can
input any string they want. To restrict the input, you can set the ``query_type``
to ``enum`` and only allow a set of search terms to protect
yourself. Alternatively, make the engine private, so no one malevolent accesses
the engine.
.. code:: yaml
- name : regex search in files
engine : command
command : ['grep', '{{QUERY}}']
shortcut : gr
tokens : []
disabled : True
delimiter :
chars : ' '
keys : ['line']

View File

@ -86,3 +86,60 @@ Show errors **DE**
{% endfor %}
.. flat-table:: Additional engines (commented out in settings.yml)
:header-rows: 1
:stub-columns: 2
* - Name
- Base URL
- Host
- Port
- Paging
* - elasticsearch
- localhost:9200
-
-
- False
* - meilicsearch
- localhost:7700
-
-
- True
* - mongodb
-
- 127.0.0.1
- 21017
- True
* - mysql_server
-
- 127.0.0.1
- 3306
- True
* - postgresql
-
- 127.0.0.1
- 5432
- True
* - redis_server
-
- 127.0.0.1
- 6379
- False
* - solr
- localhost:8983
-
-
- True
* - sqlite
-
-
-
- True

View File

@ -19,5 +19,9 @@ Administrator documentation
filtron
morty
engines
private-engines
command-engine
indexer-engines
no-sql-engines
plugins
buildhosts

View File

@ -0,0 +1,89 @@
==================
Search in indexers
==================
Searx supports three popular indexer search engines:
* Elasticsearch
* Meilisearch
* Solr
Elasticsearch
=============
Make sure that the Elasticsearch user has access to the index you are querying.
If you are not using TLS during your connection, set ``enable_http`` to ``True``.
.. code:: yaml
- name : elasticsearch
shortcut : es
engine : elasticsearch
base_url : http://localhost:9200
username : elastic
password : changeme
index : my-index
query_type : match
enable_http : True
Available settings
------------------
* ``base_url``: URL of Elasticsearch instance. By default it is set to ``http://localhost:9200``.
* ``index``: Name of the index to query. Required.
* ``query_type``: Elasticsearch query method to use. Available: ``match``,
``simple_query_string``, ``term``, ``terms``, ``custom``.
* ``custom_query_json``: If you selected ``custom`` for ``query_type``, you must
provide the JSON payload in this option.
* ``username``: Username in Elasticsearch
* ``password``: Password for the Elasticsearch user
Meilisearch
===========
If you are not using TLS during connection, set ``enable_http`` to ``True``.
.. code:: yaml
- name : meilisearch
engine : meilisearch
shortcut: mes
base_url : http://localhost:7700
index : my-index
enable_http: True
Available settings
------------------
* ``base_url``: URL of the Meilisearch instance. By default it is set to http://localhost:7700
* ``index``: Name of the index to query. Required.
* ``auth_key``: Key required for authentication.
* ``facet_filters``: List of facets to search in.
Solr
====
If you are not using TLS during connection, set ``enable_http`` to ``True``.
.. code:: yaml
- name : solr
engine : solr
shortcut : slr
base_url : http://localhost:8983
collection : my-collection
sort : asc
enable_http : True
Available settings
------------------
* ``base_url``: URL of the Meilisearch instance. By default it is set to http://localhost:8983
* ``collection``: Name of the collection to query. Required.
* ``sort``: Sorting of the results. Available: ``asc``, ``desc``.
* ``rows``: Maximum number of results from a query. Default value: 10.
* ``field_list``: List of fields returned from the query.
* ``default_fields``: Default fields to query.
* ``query_fields``: List of fields with a boost factor. The bigger the boost
factor of a field, the more important the field is in the query. Example:
``qf="field1^2.3 field2"``

View File

@ -0,0 +1,170 @@
===========================
Query SQL and NoSQL servers
===========================
SQL
===
SQL servers are traditional databases with predefined data schema. Furthermore,
modern versions also support BLOB data.
You can search in the following servers:
* `PostgreSQL`_
* `MySQL`_
* `SQLite`_
The configuration of the new database engines are similar. You must put a valid
SELECT SQL query in ``query_str``. At the moment you can only bind at most
one parameter in your query.
Do not include LIMIT or OFFSET in your SQL query as the engines
rely on these keywords during paging.
PostgreSQL
----------
Required PyPi package: ``psychopg2``
You can find an example configuration below:
.. code:: yaml
- name : postgresql
engine : postgresql
database : my_database
username : searx
password : password
query_str : 'SELECT * from my_table WHERE my_column = %(query)s'
shortcut : psql
Available options
~~~~~~~~~~~~~~~~~
* ``host``: IP address of the host running PostgreSQL. By default it is ``127.0.0.1``.
* ``port``: Port number PostgreSQL is listening on. By default it is ``5432``.
* ``database``: Name of the database you are connecting to.
* ``username``: Name of the user connecting to the database.
* ``password``: Password of the database user.
* ``query_str``: Query string to run. Keywords like ``LIMIT`` and ``OFFSET`` are not allowed. Required.
* ``limit``: Number of returned results per page. By default it is 10.
MySQL
-----
Required PyPi package: ``mysql-connector-python``
This is an example configuration for quering a MySQL server:
.. code:: yaml
- name : mysql
engine : mysql_server
database : my_database
username : searx
password : password
limit : 5
query_str : 'SELECT * from my_table WHERE my_column=%(query)s'
shortcut : mysql
Available options
~~~~~~~~~~~~~~~~~
* ``host``: IP address of the host running MySQL. By default it is ``127.0.0.1``.
* ``port``: Port number MySQL is listening on. By default it is ``3306``.
* ``database``: Name of the database you are connecting to.
* ``auth_plugin``: Authentication plugin to use. By default it is ``caching_sha2_password``.
* ``username``: Name of the user connecting to the database.
* ``password``: Password of the database user.
* ``query_str``: Query string to run. Keywords like ``LIMIT`` and ``OFFSET`` are not allowed. Required.
* ``limit``: Number of returned results per page. By default it is 10.
SQLite
------
You can read from your database ``my_database`` using this example configuration:
.. code:: yaml
- name : sqlite
engine : sqlite
shortcut: sq
database : my_database
query_str : 'SELECT * FROM my_table WHERE my_column=:query'
Available options
~~~~~~~~~~~~~~~~~
* ``database``: Name of the database you are connecting to.
* ``query_str``: Query string to run. Keywords like ``LIMIT`` and ``OFFSET`` are not allowed. Required.
* ``limit``: Number of returned results per page. By default it is 10.
NoSQL
=====
NoSQL data stores are used for storing arbitrary data without first defining their
structure. To query the supported servers, you must install their drivers using PyPi.
You can search in the following servers:
* `Redis`_
* `MongoDB`_
Redis
-----
Reqired PyPi package: ``redis``
Example configuration:
.. code:: yaml
- name : mystore
engine : redis_server
exact_match_only : True
host : 127.0.0.1
port : 6379
password : secret-password
db : 0
shortcut : rds
enable_http : True
Available options
~~~~~~~~~~~~~~~~~
* ``host``: IP address of the host running Redis. By default it is ``127.0.0.1``.
* ``port``: Port number Redis is listening on. By default it is ``6379``.
* ``password``: Password if required by Redis.
* ``db``: Number of the database you are connecting to.
* ``exact_match_only``: Enable if you need exact matching. By default it is ``True``.
MongoDB
-------
Required PyPi package: ``pymongo``
Below is an example configuration for using a MongoDB collection:
.. code:: yaml
- name : mymongo
engine : mongodb
shortcut : icm
host : '127.0.0.1'
port : 27017
database : personal
collection : income
key : month
enable_http: True
Available options
~~~~~~~~~~~~~~~~~
* ``host``: IP address of the host running MongoDB. By default it is ``127.0.0.1``.
* ``port``: Port number MongoDB is listening on. By default it is ``27017``.
* ``password``: Password if required by Redis.
* ``database``: Name of the database you are connecting to.
* ``collection``: Name of the collection you want to search in.
* ``exact_match_only``: Enable if you need exact matching. By default it is ``True``.

View File

@ -0,0 +1,44 @@
=============================
How to create private engines
=============================
If you are running your public searx instance, you might want to restrict access
to some engines. Maybe you are afraid of bots might abusing the engine. Or the
engine might return private results you do not want to share with strangers.
Server side configuration
=========================
You can make any engine private by setting a list of tokens in your settings.yml
file. In the following example, we set two different tokens that provide access
to the engine.
.. code:: yaml
- name: my-private-google
engine: google
shortcut: pgo
tokens: ['my-secret-token-1', 'my-secret-token-2']
To access the private engine, you must distribute the tokens to your searx
users. It is up to you how you let them know what the access token is you
created.
Client side configuration
=========================
As a searx instance user, you can add any number of access tokens on the
Preferences page. You have to set a comma separated lists of strings in "Engine
tokens" input, then save your new preferences.
.. image:: prefernces-private.png
:width: 600px
:align: center
:alt: location of token textarea
Once the Preferences page is loaded again, you can see the information of the
private engines you got access to. If you cannot see the expected engines in the
engines list, double check your token. If there is no issue with the token,
contact your instance administrator.

225
admin/command-engine.html Normal file
View File

@ -0,0 +1,225 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Run shell commands from your instance &#8212; Searx Documentation (Searx-1.1.0.tex)</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="../_static/searx.css" />
<link rel="stylesheet" type="text/css" href="../_static/tabs.css" />
<script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="../_static/doctools.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Search in indexers" href="indexer-engines.html" />
<link rel="prev" title="How to create private engines" href="private-engines.html" />
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="indexer-engines.html" title="Search in indexers"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="private-engines.html" title="How to create private engines"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Searx Documentation (Searx-1.1.0.tex)</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="index.html" accesskey="U">Administrator documentation</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Run shell commands from your instance</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="run-shell-commands-from-your-instance">
<h1>Run shell commands from your instance<a class="headerlink" href="#run-shell-commands-from-your-instance" title="Permalink to this heading"></a></h1>
<p>Command line engines are custom engines that run commands in the shell of the
host. In this article you can learn how to create a command engine and how to
customize the result display.</p>
<section id="the-command">
<h2>The command<a class="headerlink" href="#the-command" title="Permalink to this heading"></a></h2>
<p>When specifyng commands, you must make sure the commands are available on the
searx host. Searx will not install anything for you. Also, make sure that the
<code class="docutils literal notranslate"><span class="pre">searx</span></code> user on your host is allowed to run the selected command and has
access to the required files.</p>
</section>
<section id="access-control">
<h2>Access control<a class="headerlink" href="#access-control" title="Permalink to this heading"></a></h2>
<p>Be careful when creating command engines if you are running a public
instance. Do not expose any sensitive information. You can restrict access by
configuring a list of access tokens under tokens in your <code class="docutils literal notranslate"><span class="pre">settings.yml</span></code>.</p>
</section>
<section id="available-settings">
<h2>Available settings<a class="headerlink" href="#available-settings" title="Permalink to this heading"></a></h2>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">command</span></code>: A comma separated list of the elements of the command. A special
token <code class="docutils literal notranslate"><span class="pre">{{QUERY}}</span></code> tells searx where to put the search terms of the
user. Example: <code class="docutils literal notranslate"><span class="pre">['ls',</span> <span class="pre">'-l',</span> <span class="pre">'-h',</span> <span class="pre">'{{QUERY}}']</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">query_type</span></code>: The expected type of user search terms. Possible values:
<code class="docutils literal notranslate"><span class="pre">path</span></code> and <code class="docutils literal notranslate"><span class="pre">enum</span></code>. <code class="docutils literal notranslate"><span class="pre">path</span></code> checks if the uesr provided path is inside the
working directory. If not the query is not executed. <code class="docutils literal notranslate"><span class="pre">enum</span></code> is a list of
allowed search terms. If the user submits something which is not included in
the list, the query returns an error.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">delimiter</span></code>: A dict containing a delimiter char and the “titles” of each
element in keys.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">parse_regex</span></code>: A dict containing the regular expressions for each result
key.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">query_enum</span></code>: A list containing allowed search terms if <code class="docutils literal notranslate"><span class="pre">query_type</span></code> is
set to <code class="docutils literal notranslate"><span class="pre">enum</span></code>.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">working_dir</span></code>: The directory where the command has to be executed. Default:
<code class="docutils literal notranslate"><span class="pre">.</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">result_separator</span></code>: The character that separates results. Default: <code class="docutils literal notranslate"><span class="pre">\n</span></code></p></li>
</ul>
</section>
<section id="customize-the-result-template">
<h2>Customize the result template<a class="headerlink" href="#customize-the-result-template" title="Permalink to this heading"></a></h2>
<p>There is a default result template for displaying key-value pairs coming from
command engines. If you want something more tailored to your result types, you
can design your own template.</p>
<p>Searx relies on <a class="reference external" href="https://jinja.palletsprojects.com/">Jinja2</a> for
templating. If you are familiar with Jinja, you will not have any issues
creating templates. You can access the result attributes with <code class="docutils literal notranslate"><span class="pre">{{</span>
<span class="pre">result.attribute_name</span> <span class="pre">}}</span></code>.</p>
<p>In the example below the result has two attributes: <code class="docutils literal notranslate"><span class="pre">header</span></code> and <code class="docutils literal notranslate"><span class="pre">content</span></code>.
To customize their diplay, you need the following template (you must define
these classes yourself):</p>
<div class="highlight-html notranslate"><div class="highlight"><pre><span></span><span class="p">&lt;</span><span class="nt">div</span> <span class="na">class</span><span class="o">=</span><span class="s">&quot;result&quot;</span><span class="p">&gt;</span>
<span class="p">&lt;</span><span class="nt">div</span> <span class="na">class</span><span class="o">=</span><span class="s">&quot;result-header&quot;</span><span class="p">&gt;</span>
{{ result.header }}
<span class="p">&lt;/</span><span class="nt">div</span><span class="p">&gt;</span>
<span class="p">&lt;</span><span class="nt">div</span> <span class="na">class</span><span class="o">=</span><span class="s">&quot;result-content&quot;</span><span class="p">&gt;</span>
{{ result.content }}
<span class="p">&lt;/</span><span class="nt">div</span><span class="p">&gt;</span>
<span class="p">&lt;/</span><span class="nt">div</span><span class="p">&gt;</span>
</pre></div>
</div>
<p>Then put your template under <code class="docutils literal notranslate"><span class="pre">searx/templates/{theme-name}/result_templates</span></code>
named <code class="docutils literal notranslate"><span class="pre">your-template-name.html</span></code>. You can select your custom template with the
option <code class="docutils literal notranslate"><span class="pre">result_template</span></code>.</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">your engine name</span><span class="w"></span>
<span class="w"> </span><span class="nt">engine</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">command</span><span class="w"></span>
<span class="w"> </span><span class="nt">result_template</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">your-template-name.html</span><span class="w"></span>
</pre></div>
</div>
</section>
<section id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this heading"></a></h2>
<section id="find-files-by-name">
<h3>Find files by name<a class="headerlink" href="#find-files-by-name" title="Permalink to this heading"></a></h3>
<p>The first example is to find files on your searx host. It uses the command
<cite>find</cite> available on most Linux distributions. It expects a path type query. The
path in the search request must be inside the <code class="docutils literal notranslate"><span class="pre">working_dir</span></code>.</p>
<p>The results are displayed with the default <cite>key-value.html</cite> template. A result
is displayed in a single row table with the key “line”.</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">find</span><span class="w"></span>
<span class="w"> </span><span class="nt">engine </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">command</span><span class="w"></span>
<span class="w"> </span><span class="nt">command </span><span class="p">:</span><span class="w"> </span><span class="p p-Indicator">[</span><span class="s">&#39;find&#39;</span><span class="p p-Indicator">,</span><span class="w"> </span><span class="s">&#39;.&#39;</span><span class="p p-Indicator">,</span><span class="w"> </span><span class="s">&#39;-name&#39;</span><span class="p p-Indicator">,</span><span class="w"> </span><span class="s">&#39;{{QUERY}}&#39;</span><span class="p p-Indicator">]</span><span class="w"></span>
<span class="w"> </span><span class="nt">query_type </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">path</span><span class="w"></span>
<span class="w"> </span><span class="nt">shortcut </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">fnd</span><span class="w"></span>
<span class="w"> </span><span class="nt">tokens </span><span class="p">:</span><span class="w"> </span><span class="p p-Indicator">[]</span><span class="w"></span>
<span class="w"> </span><span class="nt">disabled </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">True</span><span class="w"></span>
<span class="w"> </span><span class="nt">delimiter </span><span class="p">:</span><span class="w"></span>
<span class="w"> </span><span class="nt">chars </span><span class="p">:</span><span class="w"> </span><span class="s">&#39;</span><span class="nv"> </span><span class="s">&#39;</span><span class="w"></span>
<span class="w"> </span><span class="nt">keys </span><span class="p">:</span><span class="w"> </span><span class="p p-Indicator">[</span><span class="s">&#39;line&#39;</span><span class="p p-Indicator">]</span><span class="w"></span>
</pre></div>
</div>
</section>
<section id="find-files-by-contents">
<h3>Find files by contents<a class="headerlink" href="#find-files-by-contents" title="Permalink to this heading"></a></h3>
<p>In the second example, we define an engine that searches in the contents of the
files under the <code class="docutils literal notranslate"><span class="pre">working_dir</span></code>. The search type is not defined, so the user can
input any string they want. To restrict the input, you can set the <code class="docutils literal notranslate"><span class="pre">query_type</span></code>
to <code class="docutils literal notranslate"><span class="pre">enum</span></code> and only allow a set of search terms to protect
yourself. Alternatively, make the engine private, so no one malevolent accesses
the engine.</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">regex search in files</span><span class="w"></span>
<span class="w"> </span><span class="nt">engine </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">command</span><span class="w"></span>
<span class="w"> </span><span class="nt">command </span><span class="p">:</span><span class="w"> </span><span class="p p-Indicator">[</span><span class="s">&#39;grep&#39;</span><span class="p p-Indicator">,</span><span class="w"> </span><span class="s">&#39;{{QUERY}}&#39;</span><span class="p p-Indicator">]</span><span class="w"></span>
<span class="w"> </span><span class="nt">shortcut </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">gr</span><span class="w"></span>
<span class="w"> </span><span class="nt">tokens </span><span class="p">:</span><span class="w"> </span><span class="p p-Indicator">[]</span><span class="w"></span>
<span class="w"> </span><span class="nt">disabled </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">True</span><span class="w"></span>
<span class="w"> </span><span class="nt">delimiter </span><span class="p">:</span><span class="w"></span>
<span class="w"> </span><span class="nt">chars </span><span class="p">:</span><span class="w"> </span><span class="s">&#39;</span><span class="nv"> </span><span class="s">&#39;</span><span class="w"></span>
<span class="w"> </span><span class="nt">keys </span><span class="p">:</span><span class="w"> </span><span class="p p-Indicator">[</span><span class="s">&#39;line&#39;</span><span class="p p-Indicator">]</span><span class="w"></span>
</pre></div>
</div>
</section>
</section>
</section>
<div class="clearer"></div>
</div>
</div>
</div>
<span id="sidebar-top"></span>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="../index.html">
<img class="logo" src="../_static/searx_logo_small.png" alt="Logo"/>
</a></p>
<h3>Project Links</h3>
<ul>
<li><a href="https://searx.github.io/searx/blog/index.html">Blog</a>
<li><a href="https://github.com/searx/searx">Source</a>
<li><a href="https://github.com/searx/searx/wiki">Wiki</a>
<li><a href="https://twitter.com/Searx_engine">Twitter</a>
<li><a href="https://github.com/searx/searx/issues">Issue Tracker</a>
</ul><h3>Navigation</h3>
<ul>
<li><a href="../index.html">Overview</a>
<ul>
<li><a href="index.html">Administrator documentation</a>
<ul>
<li>Previous: <a href="private-engines.html" title="previous chapter">How to create private engines</a>
<li>Next: <a href="indexer-engines.html" title="next chapter">Search in indexers</a></ul>
</li>
</ul>
</li>
</ul>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>document.getElementById('searchbox').style.display = "block"</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2015-2022, Adam Tauber, Noémi Ványi.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 5.1.1.
</div>
<script src="../_static/version_warning_offset.js"></script>
</body>
</html>

View File

@ -2114,6 +2114,67 @@
</tr>
</tbody>
</table>
<table class="docutils align-default" id="id2">
<caption><span class="caption-number">Table 2 </span><span class="caption-text">Additional engines (commented out in settings.yml)</span><a class="headerlink" href="#id2" title="Permalink to this table"></a></caption>
<thead>
<tr class="row-odd"><th class="head stub"><p>Name</p></th>
<th class="head stub"><p>Base URL</p></th>
<th class="head"><p>Host</p></th>
<th class="head"><p>Port</p></th>
<th class="head"><p>Paging</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><th class="stub"><p>elasticsearch</p></th>
<th class="stub"><p>localhost:9200</p></th>
<td></td>
<td></td>
<td><p>False</p></td>
</tr>
<tr class="row-odd"><th class="stub"><p>meilicsearch</p></th>
<th class="stub"><p>localhost:7700</p></th>
<td></td>
<td></td>
<td><p>True</p></td>
</tr>
<tr class="row-even"><th class="stub"><p>mongodb</p></th>
<th class="stub"></th>
<td><p>127.0.0.1</p></td>
<td><p>21017</p></td>
<td><p>True</p></td>
</tr>
<tr class="row-odd"><th class="stub"><p>mysql_server</p></th>
<th class="stub"></th>
<td><p>127.0.0.1</p></td>
<td><p>3306</p></td>
<td><p>True</p></td>
</tr>
<tr class="row-even"><th class="stub"><p>postgresql</p></th>
<th class="stub"></th>
<td><p>127.0.0.1</p></td>
<td><p>5432</p></td>
<td><p>True</p></td>
</tr>
<tr class="row-odd"><th class="stub"><p>redis_server</p></th>
<th class="stub"></th>
<td><p>127.0.0.1</p></td>
<td><p>6379</p></td>
<td><p>False</p></td>
</tr>
<tr class="row-even"><th class="stub"><p>solr</p></th>
<th class="stub"><p>localhost:8983</p></th>
<td></td>
<td></td>
<td><p>True</p></td>
</tr>
<tr class="row-odd"><th class="stub"><p>sqlite</p></th>
<th class="stub"></th>
<td></td>
<td></td>
<td><p>True</p></td>
</tr>
</tbody>
</table>
</section>
</section>

View File

@ -17,7 +17,7 @@
<script src="../../_static/doctools.js"></script>
<link rel="index" title="Index" href="../../genindex.html" />
<link rel="search" title="Search" href="../../search.html" />
<link rel="next" title="Plugins builtin" href="../plugins.html" />
<link rel="next" title="How to create private engines" href="../private-engines.html" />
<link rel="prev" title="Engines" href="../engines.html" />
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
@ -30,7 +30,7 @@
<a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="../plugins.html" title="Plugins builtin"
<a href="../private-engines.html" title="How to create private engines"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="../engines.html" title="Engines"
@ -125,7 +125,7 @@ searched.</p>
<li><a href="../engines.html">Engines</a>
<ul>
<li>Previous: <a href="../engines.html" title="previous chapter">Engines</a>
<li>Next: <a href="../plugins.html" title="next chapter">Plugins builtin</a></ul>
<li>Next: <a href="../private-engines.html" title="next chapter">How to create private engines</a></ul>
</li></ul>
</li>
</ul>

View File

@ -115,6 +115,30 @@
<li class="toctree-l2"><a class="reference internal" href="engines.html#general-engine-settings">General Engine Settings</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="private-engines.html">How to create private engines</a><ul>
<li class="toctree-l2"><a class="reference internal" href="private-engines.html#server-side-configuration">Server side configuration</a></li>
<li class="toctree-l2"><a class="reference internal" href="private-engines.html#client-side-configuration">Client side configuration</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="command-engine.html">Run shell commands from your instance</a><ul>
<li class="toctree-l2"><a class="reference internal" href="command-engine.html#the-command">The command</a></li>
<li class="toctree-l2"><a class="reference internal" href="command-engine.html#access-control">Access control</a></li>
<li class="toctree-l2"><a class="reference internal" href="command-engine.html#available-settings">Available settings</a></li>
<li class="toctree-l2"><a class="reference internal" href="command-engine.html#customize-the-result-template">Customize the result template</a></li>
<li class="toctree-l2"><a class="reference internal" href="command-engine.html#examples">Examples</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="indexer-engines.html">Search in indexers</a><ul>
<li class="toctree-l2"><a class="reference internal" href="indexer-engines.html#elasticsearch">Elasticsearch</a></li>
<li class="toctree-l2"><a class="reference internal" href="indexer-engines.html#meilisearch">Meilisearch</a></li>
<li class="toctree-l2"><a class="reference internal" href="indexer-engines.html#solr">Solr</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="no-sql-engines.html">Query SQL and NoSQL servers</a><ul>
<li class="toctree-l2"><a class="reference internal" href="no-sql-engines.html#sql">SQL</a></li>
<li class="toctree-l2"><a class="reference internal" href="no-sql-engines.html#nosql">NoSQL</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="plugins.html">Plugins builtin</a></li>
<li class="toctree-l1"><a class="reference internal" href="buildhosts.html">Buildhosts</a><ul>
<li class="toctree-l2"><a class="reference internal" href="buildhosts.html#build-docs">Build docs</a></li>

196
admin/indexer-engines.html Normal file
View File

@ -0,0 +1,196 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Search in indexers &#8212; Searx Documentation (Searx-1.1.0.tex)</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="../_static/searx.css" />
<link rel="stylesheet" type="text/css" href="../_static/tabs.css" />
<script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="../_static/doctools.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Query SQL and NoSQL servers" href="no-sql-engines.html" />
<link rel="prev" title="Run shell commands from your instance" href="command-engine.html" />
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="no-sql-engines.html" title="Query SQL and NoSQL servers"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="command-engine.html" title="Run shell commands from your instance"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Searx Documentation (Searx-1.1.0.tex)</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="index.html" accesskey="U">Administrator documentation</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Search in indexers</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="search-in-indexers">
<h1>Search in indexers<a class="headerlink" href="#search-in-indexers" title="Permalink to this heading"></a></h1>
<p>Searx supports three popular indexer search engines:</p>
<ul class="simple">
<li><p>Elasticsearch</p></li>
<li><p>Meilisearch</p></li>
<li><p>Solr</p></li>
</ul>
<section id="elasticsearch">
<h2>Elasticsearch<a class="headerlink" href="#elasticsearch" title="Permalink to this heading"></a></h2>
<p>Make sure that the Elasticsearch user has access to the index you are querying.
If you are not using TLS during your connection, set <code class="docutils literal notranslate"><span class="pre">enable_http</span></code> to <code class="docutils literal notranslate"><span class="pre">True</span></code>.</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">elasticsearch</span><span class="w"></span>
<span class="w"> </span><span class="nt">shortcut </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">es</span><span class="w"></span>
<span class="w"> </span><span class="nt">engine </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">elasticsearch</span><span class="w"></span>
<span class="w"> </span><span class="nt">base_url </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">http://localhost:9200</span><span class="w"></span>
<span class="w"> </span><span class="nt">username </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">elastic</span><span class="w"></span>
<span class="w"> </span><span class="nt">password </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">changeme</span><span class="w"></span>
<span class="w"> </span><span class="nt">index </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">my-index</span><span class="w"></span>
<span class="w"> </span><span class="nt">query_type </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">match</span><span class="w"></span>
<span class="w"> </span><span class="nt">enable_http </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">True</span><span class="w"></span>
</pre></div>
</div>
<section id="available-settings">
<h3>Available settings<a class="headerlink" href="#available-settings" title="Permalink to this heading"></a></h3>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">base_url</span></code>: URL of Elasticsearch instance. By default it is set to <code class="docutils literal notranslate"><span class="pre">http://localhost:9200</span></code>.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">index</span></code>: Name of the index to query. Required.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">query_type</span></code>: Elasticsearch query method to use. Available: <code class="docutils literal notranslate"><span class="pre">match</span></code>,
<code class="docutils literal notranslate"><span class="pre">simple_query_string</span></code>, <code class="docutils literal notranslate"><span class="pre">term</span></code>, <code class="docutils literal notranslate"><span class="pre">terms</span></code>, <code class="docutils literal notranslate"><span class="pre">custom</span></code>.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">custom_query_json</span></code>: If you selected <code class="docutils literal notranslate"><span class="pre">custom</span></code> for <code class="docutils literal notranslate"><span class="pre">query_type</span></code>, you must
provide the JSON payload in this option.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">username</span></code>: Username in Elasticsearch</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">password</span></code>: Password for the Elasticsearch user</p></li>
</ul>
</section>
</section>
<section id="meilisearch">
<h2>Meilisearch<a class="headerlink" href="#meilisearch" title="Permalink to this heading"></a></h2>
<p>If you are not using TLS during connection, set <code class="docutils literal notranslate"><span class="pre">enable_http</span></code> to <code class="docutils literal notranslate"><span class="pre">True</span></code>.</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">meilisearch</span><span class="w"></span>
<span class="w"> </span><span class="nt">engine </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">meilisearch</span><span class="w"></span>
<span class="w"> </span><span class="nt">shortcut</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">mes</span><span class="w"></span>
<span class="w"> </span><span class="nt">base_url </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">http://localhost:7700</span><span class="w"></span>
<span class="w"> </span><span class="nt">index </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">my-index</span><span class="w"></span>
<span class="w"> </span><span class="nt">enable_http</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">True</span><span class="w"></span>
</pre></div>
</div>
<section id="id1">
<h3>Available settings<a class="headerlink" href="#id1" title="Permalink to this heading"></a></h3>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">base_url</span></code>: URL of the Meilisearch instance. By default it is set to <a class="reference external" href="http://localhost:7700">http://localhost:7700</a></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">index</span></code>: Name of the index to query. Required.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">auth_key</span></code>: Key required for authentication.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">facet_filters</span></code>: List of facets to search in.</p></li>
</ul>
</section>
</section>
<section id="solr">
<h2>Solr<a class="headerlink" href="#solr" title="Permalink to this heading"></a></h2>
<p>If you are not using TLS during connection, set <code class="docutils literal notranslate"><span class="pre">enable_http</span></code> to <code class="docutils literal notranslate"><span class="pre">True</span></code>.</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">solr</span><span class="w"></span>
<span class="w"> </span><span class="nt">engine </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">solr</span><span class="w"></span>
<span class="w"> </span><span class="nt">shortcut </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">slr</span><span class="w"></span>
<span class="w"> </span><span class="nt">base_url </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">http://localhost:8983</span><span class="w"></span>
<span class="w"> </span><span class="nt">collection </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">my-collection</span><span class="w"></span>
<span class="w"> </span><span class="nt">sort </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">asc</span><span class="w"></span>
<span class="w"> </span><span class="nt">enable_http </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">True</span><span class="w"></span>
</pre></div>
</div>
<section id="id2">
<h3>Available settings<a class="headerlink" href="#id2" title="Permalink to this heading"></a></h3>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">base_url</span></code>: URL of the Meilisearch instance. By default it is set to <a class="reference external" href="http://localhost:8983">http://localhost:8983</a></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">collection</span></code>: Name of the collection to query. Required.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">sort</span></code>: Sorting of the results. Available: <code class="docutils literal notranslate"><span class="pre">asc</span></code>, <code class="docutils literal notranslate"><span class="pre">desc</span></code>.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">rows</span></code>: Maximum number of results from a query. Default value: 10.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">field_list</span></code>: List of fields returned from the query.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">default_fields</span></code>: Default fields to query.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">query_fields</span></code>: List of fields with a boost factor. The bigger the boost
factor of a field, the more important the field is in the query. Example:
<code class="docutils literal notranslate"><span class="pre">qf=&quot;field1^2.3</span> <span class="pre">field2&quot;</span></code></p></li>
</ul>
</section>
</section>
</section>
<div class="clearer"></div>
</div>
</div>
</div>
<span id="sidebar-top"></span>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="../index.html">
<img class="logo" src="../_static/searx_logo_small.png" alt="Logo"/>
</a></p>
<h3>Project Links</h3>
<ul>
<li><a href="https://searx.github.io/searx/blog/index.html">Blog</a>
<li><a href="https://github.com/searx/searx">Source</a>
<li><a href="https://github.com/searx/searx/wiki">Wiki</a>
<li><a href="https://twitter.com/Searx_engine">Twitter</a>
<li><a href="https://github.com/searx/searx/issues">Issue Tracker</a>
</ul><h3>Navigation</h3>
<ul>
<li><a href="../index.html">Overview</a>
<ul>
<li><a href="index.html">Administrator documentation</a>
<ul>
<li>Previous: <a href="command-engine.html" title="previous chapter">Run shell commands from your instance</a>
<li>Next: <a href="no-sql-engines.html" title="next chapter">Query SQL and NoSQL servers</a></ul>
</li>
</ul>
</li>
</ul>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>document.getElementById('searchbox').style.display = "block"</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2015-2022, Adam Tauber, Noémi Ványi.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 5.1.1.
</div>
<script src="../_static/version_warning_offset.js"></script>
</body>
</html>

265
admin/no-sql-engines.html Normal file
View File

@ -0,0 +1,265 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Query SQL and NoSQL servers &#8212; Searx Documentation (Searx-1.1.0.tex)</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="../_static/searx.css" />
<link rel="stylesheet" type="text/css" href="../_static/tabs.css" />
<script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="../_static/doctools.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Plugins builtin" href="plugins.html" />
<link rel="prev" title="Search in indexers" href="indexer-engines.html" />
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="plugins.html" title="Plugins builtin"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="indexer-engines.html" title="Search in indexers"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Searx Documentation (Searx-1.1.0.tex)</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="index.html" accesskey="U">Administrator documentation</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Query SQL and NoSQL servers</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="query-sql-and-nosql-servers">
<h1>Query SQL and NoSQL servers<a class="headerlink" href="#query-sql-and-nosql-servers" title="Permalink to this heading"></a></h1>
<section id="sql">
<h2>SQL<a class="headerlink" href="#sql" title="Permalink to this heading"></a></h2>
<p>SQL servers are traditional databases with predefined data schema. Furthermore,
modern versions also support BLOB data.</p>
<p>You can search in the following servers:</p>
<ul class="simple">
<li><p><a class="reference internal" href="#postgresql">PostgreSQL</a></p></li>
<li><p><a class="reference internal" href="#mysql">MySQL</a></p></li>
<li><p><a class="reference internal" href="#sqlite">SQLite</a></p></li>
</ul>
<p>The configuration of the new database engines are similar. You must put a valid
SELECT SQL query in <code class="docutils literal notranslate"><span class="pre">query_str</span></code>. At the moment you can only bind at most
one parameter in your query.</p>
<p>Do not include LIMIT or OFFSET in your SQL query as the engines
rely on these keywords during paging.</p>
<section id="postgresql">
<h3>PostgreSQL<a class="headerlink" href="#postgresql" title="Permalink to this heading"></a></h3>
<p>Required PyPi package: <code class="docutils literal notranslate"><span class="pre">psychopg2</span></code></p>
<p>You can find an example configuration below:</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">postgresql</span><span class="w"></span>
<span class="w"> </span><span class="nt">engine </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">postgresql</span><span class="w"></span>
<span class="w"> </span><span class="nt">database </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">my_database</span><span class="w"></span>
<span class="w"> </span><span class="nt">username </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">searx</span><span class="w"></span>
<span class="w"> </span><span class="nt">password </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">password</span><span class="w"></span>
<span class="w"> </span><span class="nt">query_str </span><span class="p">:</span><span class="w"> </span><span class="s">&#39;SELECT</span><span class="nv"> </span><span class="s">*</span><span class="nv"> </span><span class="s">from</span><span class="nv"> </span><span class="s">my_table</span><span class="nv"> </span><span class="s">WHERE</span><span class="nv"> </span><span class="s">my_column</span><span class="nv"> </span><span class="s">=</span><span class="nv"> </span><span class="s">%(query)s&#39;</span><span class="w"></span>
<span class="w"> </span><span class="nt">shortcut </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">psql</span><span class="w"></span>
</pre></div>
</div>
<section id="available-options">
<h4>Available options<a class="headerlink" href="#available-options" title="Permalink to this heading"></a></h4>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">host</span></code>: IP address of the host running PostgreSQL. By default it is <code class="docutils literal notranslate"><span class="pre">127.0.0.1</span></code>.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">port</span></code>: Port number PostgreSQL is listening on. By default it is <code class="docutils literal notranslate"><span class="pre">5432</span></code>.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">database</span></code>: Name of the database you are connecting to.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">username</span></code>: Name of the user connecting to the database.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">password</span></code>: Password of the database user.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">query_str</span></code>: Query string to run. Keywords like <code class="docutils literal notranslate"><span class="pre">LIMIT</span></code> and <code class="docutils literal notranslate"><span class="pre">OFFSET</span></code> are not allowed. Required.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">limit</span></code>: Number of returned results per page. By default it is 10.</p></li>
</ul>
</section>
</section>
<section id="mysql">
<h3>MySQL<a class="headerlink" href="#mysql" title="Permalink to this heading"></a></h3>
<p>Required PyPi package: <code class="docutils literal notranslate"><span class="pre">mysql-connector-python</span></code></p>
<p>This is an example configuration for quering a MySQL server:</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">mysql</span><span class="w"></span>
<span class="w"> </span><span class="nt">engine </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">mysql_server</span><span class="w"></span>
<span class="w"> </span><span class="nt">database </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">my_database</span><span class="w"></span>
<span class="w"> </span><span class="nt">username </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">searx</span><span class="w"></span>
<span class="w"> </span><span class="nt">password </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">password</span><span class="w"></span>
<span class="w"> </span><span class="nt">limit </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">5</span><span class="w"></span>
<span class="w"> </span><span class="nt">query_str </span><span class="p">:</span><span class="w"> </span><span class="s">&#39;SELECT</span><span class="nv"> </span><span class="s">*</span><span class="nv"> </span><span class="s">from</span><span class="nv"> </span><span class="s">my_table</span><span class="nv"> </span><span class="s">WHERE</span><span class="nv"> </span><span class="s">my_column=%(query)s&#39;</span><span class="w"></span>
<span class="w"> </span><span class="nt">shortcut </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">mysql</span><span class="w"></span>
</pre></div>
</div>
<section id="id1">
<h4>Available options<a class="headerlink" href="#id1" title="Permalink to this heading"></a></h4>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">host</span></code>: IP address of the host running MySQL. By default it is <code class="docutils literal notranslate"><span class="pre">127.0.0.1</span></code>.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">port</span></code>: Port number MySQL is listening on. By default it is <code class="docutils literal notranslate"><span class="pre">3306</span></code>.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">database</span></code>: Name of the database you are connecting to.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">auth_plugin</span></code>: Authentication plugin to use. By default it is <code class="docutils literal notranslate"><span class="pre">caching_sha2_password</span></code>.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">username</span></code>: Name of the user connecting to the database.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">password</span></code>: Password of the database user.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">query_str</span></code>: Query string to run. Keywords like <code class="docutils literal notranslate"><span class="pre">LIMIT</span></code> and <code class="docutils literal notranslate"><span class="pre">OFFSET</span></code> are not allowed. Required.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">limit</span></code>: Number of returned results per page. By default it is 10.</p></li>
</ul>
</section>
</section>
<section id="sqlite">
<h3>SQLite<a class="headerlink" href="#sqlite" title="Permalink to this heading"></a></h3>
<p>You can read from your database <code class="docutils literal notranslate"><span class="pre">my_database</span></code> using this example configuration:</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">sqlite</span><span class="w"></span>
<span class="w"> </span><span class="nt">engine </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">sqlite</span><span class="w"></span>
<span class="w"> </span><span class="nt">shortcut</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">sq</span><span class="w"></span>
<span class="w"> </span><span class="nt">database </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">my_database</span><span class="w"></span>
<span class="w"> </span><span class="nt">query_str </span><span class="p">:</span><span class="w"> </span><span class="s">&#39;SELECT</span><span class="nv"> </span><span class="s">*</span><span class="nv"> </span><span class="s">FROM</span><span class="nv"> </span><span class="s">my_table</span><span class="nv"> </span><span class="s">WHERE</span><span class="nv"> </span><span class="s">my_column=:query&#39;</span><span class="w"></span>
</pre></div>
</div>
<section id="id2">
<h4>Available options<a class="headerlink" href="#id2" title="Permalink to this heading"></a></h4>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">database</span></code>: Name of the database you are connecting to.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">query_str</span></code>: Query string to run. Keywords like <code class="docutils literal notranslate"><span class="pre">LIMIT</span></code> and <code class="docutils literal notranslate"><span class="pre">OFFSET</span></code> are not allowed. Required.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">limit</span></code>: Number of returned results per page. By default it is 10.</p></li>
</ul>
</section>
</section>
</section>
<section id="nosql">
<h2>NoSQL<a class="headerlink" href="#nosql" title="Permalink to this heading"></a></h2>
<p>NoSQL data stores are used for storing arbitrary data without first defining their
structure. To query the supported servers, you must install their drivers using PyPi.</p>
<p>You can search in the following servers:</p>
<ul class="simple">
<li><p><a class="reference internal" href="#redis">Redis</a></p></li>
<li><p><a class="reference internal" href="#mongodb">MongoDB</a></p></li>
</ul>
<section id="redis">
<h3>Redis<a class="headerlink" href="#redis" title="Permalink to this heading"></a></h3>
<p>Reqired PyPi package: <code class="docutils literal notranslate"><span class="pre">redis</span></code></p>
<p>Example configuration:</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">mystore</span><span class="w"></span>
<span class="w"> </span><span class="nt">engine </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">redis_server</span><span class="w"></span>
<span class="w"> </span><span class="nt">exact_match_only </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">True</span><span class="w"></span>
<span class="w"> </span><span class="nt">host </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">127.0.0.1</span><span class="w"></span>
<span class="w"> </span><span class="nt">port </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">6379</span><span class="w"></span>
<span class="w"> </span><span class="nt">password </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">secret-password</span><span class="w"></span>
<span class="w"> </span><span class="nt">db </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">0</span><span class="w"></span>
<span class="w"> </span><span class="nt">shortcut </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">rds</span><span class="w"></span>
<span class="w"> </span><span class="nt">enable_http </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">True</span><span class="w"></span>
</pre></div>
</div>
<section id="id3">
<h4>Available options<a class="headerlink" href="#id3" title="Permalink to this heading"></a></h4>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">host</span></code>: IP address of the host running Redis. By default it is <code class="docutils literal notranslate"><span class="pre">127.0.0.1</span></code>.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">port</span></code>: Port number Redis is listening on. By default it is <code class="docutils literal notranslate"><span class="pre">6379</span></code>.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">password</span></code>: Password if required by Redis.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">db</span></code>: Number of the database you are connecting to.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">exact_match_only</span></code>: Enable if you need exact matching. By default it is <code class="docutils literal notranslate"><span class="pre">True</span></code>.</p></li>
</ul>
</section>
</section>
<section id="mongodb">
<h3>MongoDB<a class="headerlink" href="#mongodb" title="Permalink to this heading"></a></h3>
<p>Required PyPi package: <code class="docutils literal notranslate"><span class="pre">pymongo</span></code></p>
<p>Below is an example configuration for using a MongoDB collection:</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">mymongo</span><span class="w"></span>
<span class="w"> </span><span class="nt">engine </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">mongodb</span><span class="w"></span>
<span class="w"> </span><span class="nt">shortcut </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">icm</span><span class="w"></span>
<span class="w"> </span><span class="nt">host </span><span class="p">:</span><span class="w"> </span><span class="s">&#39;127.0.0.1&#39;</span><span class="w"></span>
<span class="w"> </span><span class="nt">port </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">27017</span><span class="w"></span>
<span class="w"> </span><span class="nt">database </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">personal</span><span class="w"></span>
<span class="w"> </span><span class="nt">collection </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">income</span><span class="w"></span>
<span class="w"> </span><span class="nt">key </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">month</span><span class="w"></span>
<span class="w"> </span><span class="nt">enable_http</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">True</span><span class="w"></span>
</pre></div>
</div>
<section id="id4">
<h4>Available options<a class="headerlink" href="#id4" title="Permalink to this heading"></a></h4>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">host</span></code>: IP address of the host running MongoDB. By default it is <code class="docutils literal notranslate"><span class="pre">127.0.0.1</span></code>.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">port</span></code>: Port number MongoDB is listening on. By default it is <code class="docutils literal notranslate"><span class="pre">27017</span></code>.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">password</span></code>: Password if required by Redis.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">database</span></code>: Name of the database you are connecting to.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">collection</span></code>: Name of the collection you want to search in.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">exact_match_only</span></code>: Enable if you need exact matching. By default it is <code class="docutils literal notranslate"><span class="pre">True</span></code>.</p></li>
</ul>
</section>
</section>
</section>
</section>
<div class="clearer"></div>
</div>
</div>
</div>
<span id="sidebar-top"></span>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="../index.html">
<img class="logo" src="../_static/searx_logo_small.png" alt="Logo"/>
</a></p>
<h3>Project Links</h3>
<ul>
<li><a href="https://searx.github.io/searx/blog/index.html">Blog</a>
<li><a href="https://github.com/searx/searx">Source</a>
<li><a href="https://github.com/searx/searx/wiki">Wiki</a>
<li><a href="https://twitter.com/Searx_engine">Twitter</a>
<li><a href="https://github.com/searx/searx/issues">Issue Tracker</a>
</ul><h3>Navigation</h3>
<ul>
<li><a href="../index.html">Overview</a>
<ul>
<li><a href="index.html">Administrator documentation</a>
<ul>
<li>Previous: <a href="indexer-engines.html" title="previous chapter">Search in indexers</a>
<li>Next: <a href="plugins.html" title="next chapter">Plugins builtin</a></ul>
</li>
</ul>
</li>
</ul>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>document.getElementById('searchbox').style.display = "block"</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2015-2022, Adam Tauber, Noémi Ványi.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 5.1.1.
</div>
<script src="../_static/version_warning_offset.js"></script>
</body>
</html>

View File

@ -18,7 +18,7 @@
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Buildhosts" href="buildhosts.html" />
<link rel="prev" title="Recoll" href="engines/recoll.html" />
<link rel="prev" title="Query SQL and NoSQL servers" href="no-sql-engines.html" />
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
@ -33,7 +33,7 @@
<a href="buildhosts.html" title="Buildhosts"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="engines/recoll.html" title="Recoll"
<a href="no-sql-engines.html" title="Query SQL and NoSQL servers"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Searx Documentation (Searx-1.1.0.tex)</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="index.html" accesskey="U">Administrator documentation</a> &#187;</li>
@ -61,7 +61,7 @@
</dd>
</dl>
<span id="configured-plugins"></span><table class="docutils align-default" id="id1">
<caption><span class="caption-number">Table 2 </span><span class="caption-text">Plugins configured at built time (defaults)</span><a class="headerlink" href="#id1" title="Permalink to this table"></a></caption>
<caption><span class="caption-number">Table 3 </span><span class="caption-text">Plugins configured at built time (defaults)</span><a class="headerlink" href="#id1" title="Permalink to this table"></a></caption>
<thead>
<tr class="row-odd"><th class="head stub"><p>Name</p></th>
<th class="head"><p>DO</p></th>
@ -170,7 +170,7 @@
<ul>
<li><a href="index.html">Administrator documentation</a>
<ul>
<li>Previous: <a href="engines/recoll.html" title="previous chapter">Recoll</a>
<li>Previous: <a href="no-sql-engines.html" title="previous chapter">Query SQL and NoSQL servers</a>
<li>Next: <a href="buildhosts.html" title="next chapter">Buildhosts</a></ul>
</li>
</ul>

142
admin/private-engines.html Normal file
View File

@ -0,0 +1,142 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>How to create private engines &#8212; Searx Documentation (Searx-1.1.0.tex)</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="../_static/searx.css" />
<link rel="stylesheet" type="text/css" href="../_static/tabs.css" />
<script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="../_static/doctools.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Run shell commands from your instance" href="command-engine.html" />
<link rel="prev" title="Recoll" href="engines/recoll.html" />
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="command-engine.html" title="Run shell commands from your instance"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="engines/recoll.html" title="Recoll"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Searx Documentation (Searx-1.1.0.tex)</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="index.html" accesskey="U">Administrator documentation</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">How to create private engines</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="how-to-create-private-engines">
<h1>How to create private engines<a class="headerlink" href="#how-to-create-private-engines" title="Permalink to this heading"></a></h1>
<p>If you are running your public searx instance, you might want to restrict access
to some engines. Maybe you are afraid of bots might abusing the engine. Or the
engine might return private results you do not want to share with strangers.</p>
<section id="server-side-configuration">
<h2>Server side configuration<a class="headerlink" href="#server-side-configuration" title="Permalink to this heading"></a></h2>
<p>You can make any engine private by setting a list of tokens in your settings.yml
file. In the following example, we set two different tokens that provide access
to the engine.</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">my-private-google</span><span class="w"></span>
<span class="w"> </span><span class="nt">engine</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">google</span><span class="w"></span>
<span class="w"> </span><span class="nt">shortcut</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">pgo</span><span class="w"></span>
<span class="w"> </span><span class="nt">tokens</span><span class="p">:</span><span class="w"> </span><span class="p p-Indicator">[</span><span class="s">&#39;my-secret-token-1&#39;</span><span class="p p-Indicator">,</span><span class="w"> </span><span class="s">&#39;my-secret-token-2&#39;</span><span class="p p-Indicator">]</span><span class="w"></span>
</pre></div>
</div>
<p>To access the private engine, you must distribute the tokens to your searx
users. It is up to you how you let them know what the access token is you
created.</p>
</section>
<section id="client-side-configuration">
<h2>Client side configuration<a class="headerlink" href="#client-side-configuration" title="Permalink to this heading"></a></h2>
<p>As a searx instance user, you can add any number of access tokens on the
Preferences page. You have to set a comma separated lists of strings in “Engine
tokens” input, then save your new preferences.</p>
<a class="reference internal image-reference" href="../_images/prefernces-private.png"><img alt="location of token textarea" class="align-center" src="../_images/prefernces-private.png" style="width: 600px;" /></a>
<p>Once the Preferences page is loaded again, you can see the information of the
private engines you got access to. If you cannot see the expected engines in the
engines list, double check your token. If there is no issue with the token,
contact your instance administrator.</p>
</section>
</section>
<div class="clearer"></div>
</div>
</div>
</div>
<span id="sidebar-top"></span>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="../index.html">
<img class="logo" src="../_static/searx_logo_small.png" alt="Logo"/>
</a></p>
<h3>Project Links</h3>
<ul>
<li><a href="https://searx.github.io/searx/blog/index.html">Blog</a>
<li><a href="https://github.com/searx/searx">Source</a>
<li><a href="https://github.com/searx/searx/wiki">Wiki</a>
<li><a href="https://twitter.com/Searx_engine">Twitter</a>
<li><a href="https://github.com/searx/searx/issues">Issue Tracker</a>
</ul><h3>Navigation</h3>
<ul>
<li><a href="../index.html">Overview</a>
<ul>
<li><a href="index.html">Administrator documentation</a>
<ul>
<li>Previous: <a href="engines/recoll.html" title="previous chapter">Recoll</a>
<li>Next: <a href="command-engine.html" title="next chapter">Run shell commands from your instance</a></ul>
</li>
</ul>
</li>
</ul>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>document.getElementById('searchbox').style.display = "block"</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2015-2022, Adam Tauber, Noémi Ványi.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 5.1.1.
</div>
<script src="../_static/version_warning_offset.js"></script>
</body>
</html>

View File

@ -193,7 +193,7 @@ conditions</em> and all the side effects a external developer will not know.</p>
backquotes appear in running text and could be confused with inline markup
delimiters, they have to be escaped with a backslash (<code class="docutils literal notranslate"><span class="pre">\*pointer</span></code>).</p>
<table class="docutils align-default" id="id4">
<caption><span class="caption-number">Table 3 </span><span class="caption-text">basic inline markup</span><a class="headerlink" href="#id4" title="Permalink to this table"></a></caption>
<caption><span class="caption-number">Table 4 </span><span class="caption-text">basic inline markup</span><a class="headerlink" href="#id4" title="Permalink to this table"></a></caption>
<colgroup>
<col style="width: 29%" />
<col style="width: 21%" />
@ -356,7 +356,7 @@ Lists</a>.</p>
<p>With the power of <a class="reference external" href="https://www.sphinx-doc.org/en/master/usage/extensions/extlinks.html">sphinx.ext.extlinks</a> and <a class="reference external" href="https://www.sphinx-doc.org/en/stable/ext/intersphinx.html">intersphinx</a> referencing external
content becomes smart.</p>
<table class="docutils align-default" id="id5">
<caption><span class="caption-number">Table 4 </span><span class="caption-text">smart refs with <a class="reference external" href="https://www.sphinx-doc.org/en/master/usage/extensions/extlinks.html">sphinx.ext.extlinks</a> and <a class="reference external" href="https://www.sphinx-doc.org/en/stable/ext/intersphinx.html">intersphinx</a></span><a class="headerlink" href="#id5" title="Permalink to this table"></a></caption>
<caption><span class="caption-number">Table 5 </span><span class="caption-text">smart refs with <a class="reference external" href="https://www.sphinx-doc.org/en/master/usage/extensions/extlinks.html">sphinx.ext.extlinks</a> and <a class="reference external" href="https://www.sphinx-doc.org/en/stable/ext/intersphinx.html">intersphinx</a></span><a class="headerlink" href="#id5" title="Permalink to this table"></a></caption>
<colgroup>
<col style="width: 29%" />
<col style="width: 21%" />
@ -563,7 +563,7 @@ in a specific way.</p>
</pre></div>
</div>
<table class="docutils align-default" id="id6">
<caption><span class="caption-number">Table 5 </span><span class="caption-text">smart refs with <a class="reference external" href="https://www.sphinx-doc.org/en/master/usage/extensions/extlinks.html">sphinx.ext.extlinks</a> and <a class="reference external" href="https://www.sphinx-doc.org/en/stable/ext/intersphinx.html">intersphinx</a></span><a class="headerlink" href="#id6" title="Permalink to this table"></a></caption>
<caption><span class="caption-number">Table 6 </span><span class="caption-text">smart refs with <a class="reference external" href="https://www.sphinx-doc.org/en/master/usage/extensions/extlinks.html">sphinx.ext.extlinks</a> and <a class="reference external" href="https://www.sphinx-doc.org/en/stable/ext/intersphinx.html">intersphinx</a></span><a class="headerlink" href="#id6" title="Permalink to this table"></a></caption>
<colgroup>
<col style="width: 29%" />
<col style="width: 21%" />
@ -1110,7 +1110,7 @@ your table need some metadata (e.g. a title) you need to add the <code class="do
<div class="rst-example admonition">
<p class="admonition-title">Simple ASCII table</p>
<table class="docutils align-left" id="id11">
<caption><span class="caption-number">Table 6 </span><span class="caption-text">foo gate truth table</span><a class="headerlink" href="#id11" title="Permalink to this table"></a></caption>
<caption><span class="caption-number">Table 7 </span><span class="caption-text">foo gate truth table</span><a class="headerlink" href="#id11" title="Permalink to this table"></a></caption>
<colgroup>
<col style="width: 33%" />
<col style="width: 33%" />
@ -1165,7 +1165,7 @@ your table need some metadata (e.g. a title) you need to add the <code class="do
<div class="rst-example admonition">
<p class="admonition-title">ASCII grid table</p>
<table class="docutils align-default" id="id12">
<caption><span class="caption-number">Table 7 </span><span class="caption-text">grid table example</span><a class="headerlink" href="#id12" title="Permalink to this table"></a></caption>
<caption><span class="caption-number">Table 8 </span><span class="caption-text">grid table example</span><a class="headerlink" href="#id12" title="Permalink to this table"></a></caption>
<colgroup>
<col style="width: 14%" />
<col style="width: 14%" />
@ -1296,7 +1296,7 @@ and <em>targets</em> (e.g. a ref to <a class="reference internal" href="#row-bod
<div class="rst-example admonition">
<p class="admonition-title">List table</p>
<table class="docutils align-default" id="id13">
<caption><span class="caption-number">Table 8 </span><span class="caption-text"><code class="docutils literal notranslate"><span class="pre">flat-table</span></code> example</span><a class="headerlink" href="#id13" title="Permalink to this table"></a></caption>
<caption><span class="caption-number">Table 9 </span><span class="caption-text"><code class="docutils literal notranslate"><span class="pre">flat-table</span></code> example</span><a class="headerlink" href="#id13" title="Permalink to this table"></a></caption>
<thead>
<tr class="row-odd"><th class="head stub" rowspan="2"><p> head / stub</p></th>
<th class="head" colspan="4"><p> head 1.1-4</p></th>
@ -1369,7 +1369,7 @@ stub col row 1, column, column
<div class="rst-example admonition">
<p class="admonition-title">CSV table</p>
<table class="docutils align-default" id="id14">
<caption><span class="caption-number">Table 9 </span><span class="caption-text">CSV table example</span><a class="headerlink" href="#id14" title="Permalink to this table"></a></caption>
<caption><span class="caption-number">Table 10 </span><span class="caption-text">CSV table example</span><a class="headerlink" href="#id14" title="Permalink to this table"></a></caption>
<colgroup>
<col style="width: 23%" />
<col style="width: 38%" />
@ -1451,6 +1451,64 @@ time. The <a class="reference external" href="https://github.com/tardyp/sphinx-
<span class="m">-</span> {{(mod.display_error_messages and &quot;y&quot;) or &quot;&quot;}}
{% endfor %}
<span class="p"> ..</span> <span class="ow">flat-table</span><span class="p">::</span> Additional engines (commented out in settings.yml)
<span class="nc">:header-rows:</span> 1
<span class="nc">:stub-columns:</span> 2
<span class="m">*</span> - Name
<span class="m">-</span> Base URL
<span class="m">-</span> Host
<span class="m">-</span> Port
<span class="m">-</span> Paging
<span class="m">*</span> - elasticsearch
<span class="m">-</span> localhost:9200
-
-
<span class="m">-</span> False
<span class="m">*</span> - meilicsearch
<span class="m">-</span> localhost:7700
-
-
<span class="m">-</span> True
<span class="m">*</span> - mongodb
-
<span class="m">-</span> 127.0.0.1
<span class="m">-</span> 21017
<span class="m">-</span> True
<span class="m">*</span> - mysql_server
-
<span class="m">-</span> 127.0.0.1
<span class="m">-</span> 3306
<span class="m">-</span> True
<span class="m">*</span> - postgresql
-
<span class="m">-</span> 127.0.0.1
<span class="m">-</span> 5432
<span class="m">-</span> True
<span class="m">*</span> - redis_server
-
<span class="m">-</span> 127.0.0.1
<span class="m">-</span> 6379
<span class="m">-</span> False
<span class="m">*</span> - solr
<span class="m">-</span> localhost:8983
-
-
<span class="m">-</span> True
<span class="m">*</span> - sqlite
-
-
-
<span class="m">-</span> True
</pre></div>
</div>
<p>The context for the template is selected in the line <code class="docutils literal notranslate"><span class="pre">..</span> <span class="pre">jinja::</span> <span class="pre">searx</span></code>. In

View File

@ -86,6 +86,10 @@ digital rights</p></li>
<li class="toctree-l2"><a class="reference internal" href="admin/filtron.html">How to protect an instance</a></li>
<li class="toctree-l2"><a class="reference internal" href="admin/morty.html">How to setup result proxy</a></li>
<li class="toctree-l2"><a class="reference internal" href="admin/engines.html">Engines</a></li>
<li class="toctree-l2"><a class="reference internal" href="admin/private-engines.html">How to create private engines</a></li>
<li class="toctree-l2"><a class="reference internal" href="admin/command-engine.html">Run shell commands from your instance</a></li>
<li class="toctree-l2"><a class="reference internal" href="admin/indexer-engines.html">Search in indexers</a></li>
<li class="toctree-l2"><a class="reference internal" href="admin/no-sql-engines.html">Query SQL and NoSQL servers</a></li>
<li class="toctree-l2"><a class="reference internal" href="admin/plugins.html">Plugins builtin</a></li>
<li class="toctree-l2"><a class="reference internal" href="admin/buildhosts.html">Buildhosts</a></li>
</ul>

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@ -183,18 +183,18 @@ inspect service
show service status and log
option
set one of the available options
apache (http://fv-az246-52/searx)
apache (http://fv-az504-71/searx)
:install: apache site with a reverse proxy (ProxyPass)
:remove: apache site searx.conf
nginx (http://fv-az246-52/searx)
nginx (http://fv-az504-71/searx)
:install: nginx site with a reverse proxy (ProxyPass)
:remove: nginx site searx.conf
filtron rules: /etc/filtron/rules.json
If needed, set PUBLIC_URL of your WEB service in the &#39;.config.sh&#39; file::
PUBLIC_URL : http://fv-az246-52/searx
PUBLIC_HOST : fv-az246-52
PUBLIC_URL : http://fv-az504-71/searx
PUBLIC_HOST : fv-az504-71
SERVICE_USER : filtron
FILTRON_TARGET : 127.0.0.1:8888
FILTRON_API : 127.0.0.1:4005

View File

@ -193,7 +193,7 @@ install
:base: prepare LXC; install basic packages
:suite: install LXC searx suite into all (or &lt;name&gt;) containers
LXC suite: searx --&gt; http://fv-az246-52/searx
LXC suite: searx --&gt; http://fv-az504-71/searx
suite includes searx, morty &amp; filtron
suite images:
ubu1804 ubu2004 ubu2010 fedora33 archlinux centos7

View File

@ -185,22 +185,22 @@ inspect service
option
set one of the available options
:new-key: set new morty key
apache : http://fv-az246-52/morty/
apache : http://fv-az504-71/morty/
:install: apache site with a reverse proxy (ProxyPass)
:remove: apache site morty.conf
nginx (http://fv-az246-52/morty/)
nginx (http://fv-az504-71/morty/)
:install: nginx site with a reverse proxy (ProxyPass)
:remove: nginx site morty.conf
If needed, set the environment variables in the &#39;.config.sh&#39; file::
PUBLIC_URL_MORTY: http://fv-az246-52/morty/
PUBLIC_URL_MORTY: http://fv-az504-71/morty/
MORTY_LISTEN: 127.0.0.1:3000
SERVICE_USER: morty
To activate result and image proxy in searx, edit settings.yml (read:
https://searx.github.io/searx/admin/morty.html)::
result_proxy:
url : http://fv-az246-52/morty/
url : http://fv-az504-71/morty/
server:
image_proxy : True
</pre></div>

View File

@ -112,8 +112,8 @@ apache
searx settings: /etc/searx/settings.yml
If needed, set PUBLIC_URL of your WEB service in the &#39;.config.sh&#39; file::
PUBLIC_URL : http://fv-az246-52/searx
SEARX_INSTANCE_NAME : searx@fv-az246-52
PUBLIC_URL : http://fv-az504-71/searx
SEARX_INSTANCE_NAME : searx@fv-az504-71
SERVICE_USER : searx
SEARX_INTERNAL_HTTP : http://127.0.0.1:8888
</pre></div>