build from commit 905ce2a6f6

This commit is contained in:
return42 2023-08-11 10:34:02 +00:00
commit 5849f6a4b3
277 changed files with 61654 additions and 0 deletions

View file

@ -0,0 +1,166 @@
<!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>Demo Offline Engine &#8212; SearXNG Documentation (2023.8.11+905ce2a6f)</title>
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=4f649999" />
<link rel="stylesheet" type="text/css" href="../../../_static/searxng.css?v=52e4ff28" />
<link rel="stylesheet" type="text/css" href="../../../_static/tabs.css?v=a5c4661c" />
<script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js?v=3c88bde0"></script>
<script src="../../../_static/doctools.js?v=888ff710"></script>
<script src="../../../_static/sphinx_highlight.js?v=4825356b"></script>
<link rel="index" title="Index" href="../../../genindex.html" />
<link rel="search" title="Search" href="../../../search.html" />
<link rel="next" title="Command Line Engines" href="../offline/command-line-engines.html" />
<link rel="prev" title="Offline Concept" href="../offline_concept.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="../offline/command-line-engines.html" title="Command Line Engines"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="../offline_concept.html" title="Offline Concept"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">SearXNG Documentation (2023.8.11+905ce2a6f)</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../index.html" >Developer documentation</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="../index.html" accesskey="U">Engine Implementations</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Demo Offline Engine</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="demo-offline-engine">
<span id="id1"></span><h1>Demo Offline Engine<a class="headerlink" href="#demo-offline-engine" title="Permalink to this heading"></a></h1>
<span class="target" id="module-searx.engines.demo_offline"></span><p>Within this module we implement a <em>demo offline engine</em>. Do not look to
close to the implementation, its just a simple example. To get in use of this
<em>demo</em> engine add the following entry to your engines list in <code class="docutils literal notranslate"><span class="pre">settings.yml</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">my offline engine</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">demo_offline</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">demo</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">false</span>
</pre></div>
</div>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.demo_offline.init">
<span class="sig-prename descclassname"><span class="pre">searx.engines.demo_offline.</span></span><span class="sig-name descname"><span class="pre">init</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">engine_settings</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/demo_offline.html#init"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.demo_offline.init" title="Permalink to this definition"></a></dt>
<dd><p>Initialization of the (offline) engine. The origin of this demo engine is a
simple json string which is loaded in this example while the engine is
initialized.</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.demo_offline.search">
<span class="sig-prename descclassname"><span class="pre">searx.engines.demo_offline.</span></span><span class="sig-name descname"><span class="pre">search</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">query</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">request_params</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/demo_offline.html#search"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.demo_offline.search" title="Permalink to this definition"></a></dt>
<dd><p>Query (offline) engine and return results. Assemble the list of results from
your local engine. In this demo engine we ignore the query term, usual
you would pass the query term to your local engine to filter out the
results.</p>
</dd></dl>
</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/searxng-wordmark.svg" alt="Logo"/>
</a></p>
<h3><a href="../../../index.html">Table of Contents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../user/index.html">User information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../own-instance.html">Why use a private instance?</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../admin/index.html">Administrator documentation</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../index.html">Developer documentation</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../quickstart.html">Development Quickstart</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../contribution_guide.html">How to contribute</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../index.html">Engine Implementations</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../search_api.html">Search API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../plugins.html">Plugins</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../translation.html">Translation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../lxcdev.html">Developing in Linux Containers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../makefile.html">Makefile &amp; <code class="docutils literal notranslate"><span class="pre">./manage</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../reST.html">reST primer</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../searxng_extra/index.html">Tooling box <code class="docutils literal notranslate"><span class="pre">searxng_extra</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../utils/index.html">DevOps tooling box</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../src/index.html">Source-Code</a></li>
</ul>
<h3>Project Links</h3>
<ul>
<li><a href="https://github.com/searxng/searxng/tree/master">Source</a>
<li><a href="https://github.com/searxng/searxng/wiki">Wiki</a>
<li><a href="https://searx.space">Public instances</a>
<li><a href="https://github.com/searxng/searxng/issues">Issue Tracker</a>
</ul><h3>Navigation</h3>
<ul>
<li><a href="../../../index.html">Overview</a>
<ul>
<li><a href="../../index.html">Developer documentation</a>
<ul>
<li><a href="../index.html">Engine Implementations</a>
<ul>
<li>Previous: <a href="../offline_concept.html" title="previous chapter">Offline Concept</a>
<li>Next: <a href="../offline/command-line-engines.html" title="next chapter">Command Line Engines</a></ul>
</li></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 role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../../_sources/dev/engines/demo/demo_offline.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright SearXNG team.
</div>
<script src="../../../_static/version_warning_offset.js"></script>
</body>
</html>

View file

@ -0,0 +1,173 @@
<!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>Demo Online Engine &#8212; SearXNG Documentation (2023.8.11+905ce2a6f)</title>
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=4f649999" />
<link rel="stylesheet" type="text/css" href="../../../_static/searxng.css?v=52e4ff28" />
<link rel="stylesheet" type="text/css" href="../../../_static/tabs.css?v=a5c4661c" />
<script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js?v=3c88bde0"></script>
<script src="../../../_static/doctools.js?v=888ff710"></script>
<script src="../../../_static/sphinx_highlight.js?v=4825356b"></script>
<link rel="index" title="Index" href="../../../genindex.html" />
<link rel="search" title="Search" href="../../../search.html" />
<link rel="next" title="XPath Engine" href="../xpath.html" />
<link rel="prev" title="Engine Overview" href="../engine_overview.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="../xpath.html" title="XPath Engine"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="../engine_overview.html" title="Engine Overview"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">SearXNG Documentation (2023.8.11+905ce2a6f)</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../index.html" >Developer documentation</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="../index.html" accesskey="U">Engine Implementations</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Demo Online Engine</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="demo-online-engine">
<span id="id1"></span><h1>Demo Online Engine<a class="headerlink" href="#demo-online-engine" title="Permalink to this heading"></a></h1>
<span class="target" id="module-searx.engines.demo_online"></span><p>Within this module we implement a <em>demo online engine</em>. Do not look to
close to the implementation, its just a simple example which queries <a class="reference external" href="https://www.artic.edu">The Art
Institute of Chicago</a></p>
<p>To get in use of this <em>demo</em> engine add the following entry to your engines
list in <code class="docutils literal notranslate"><span class="pre">settings.yml</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">my online engine</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">demo_online</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">demo</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">false</span>
</pre></div>
</div>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.demo_online.init">
<span class="sig-prename descclassname"><span class="pre">searx.engines.demo_online.</span></span><span class="sig-name descname"><span class="pre">init</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">engine_settings</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/demo_online.html#init"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.demo_online.init" title="Permalink to this definition"></a></dt>
<dd><p>Initialization of the (online) engine. If no initialization is needed, drop
this init function.</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.demo_online.request">
<span class="sig-prename descclassname"><span class="pre">searx.engines.demo_online.</span></span><span class="sig-name descname"><span class="pre">request</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">query</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">params</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/demo_online.html#request"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.demo_online.request" title="Permalink to this definition"></a></dt>
<dd><p>Build up the <code class="docutils literal notranslate"><span class="pre">params</span></code> for the online request. In this example we build a
URL to fetch images from <a class="reference external" href="https://artic.edu">artic.edu</a></p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.demo_online.response">
<span class="sig-prename descclassname"><span class="pre">searx.engines.demo_online.</span></span><span class="sig-name descname"><span class="pre">response</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">resp</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/demo_online.html#response"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.demo_online.response" title="Permalink to this definition"></a></dt>
<dd><p>Parse out the result items from the response. In this example we parse the
response from <a class="reference external" href="https://artic.edu">api.artic.edu</a> and filter out all
images.</p>
</dd></dl>
</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/searxng-wordmark.svg" alt="Logo"/>
</a></p>
<h3><a href="../../../index.html">Table of Contents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../user/index.html">User information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../own-instance.html">Why use a private instance?</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../admin/index.html">Administrator documentation</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../index.html">Developer documentation</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../quickstart.html">Development Quickstart</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../contribution_guide.html">How to contribute</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../index.html">Engine Implementations</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../search_api.html">Search API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../plugins.html">Plugins</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../translation.html">Translation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../lxcdev.html">Developing in Linux Containers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../makefile.html">Makefile &amp; <code class="docutils literal notranslate"><span class="pre">./manage</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../reST.html">reST primer</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../searxng_extra/index.html">Tooling box <code class="docutils literal notranslate"><span class="pre">searxng_extra</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../utils/index.html">DevOps tooling box</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../src/index.html">Source-Code</a></li>
</ul>
<h3>Project Links</h3>
<ul>
<li><a href="https://github.com/searxng/searxng/tree/master">Source</a>
<li><a href="https://github.com/searxng/searxng/wiki">Wiki</a>
<li><a href="https://searx.space">Public instances</a>
<li><a href="https://github.com/searxng/searxng/issues">Issue Tracker</a>
</ul><h3>Navigation</h3>
<ul>
<li><a href="../../../index.html">Overview</a>
<ul>
<li><a href="../../index.html">Developer documentation</a>
<ul>
<li><a href="../index.html">Engine Implementations</a>
<ul>
<li>Previous: <a href="../engine_overview.html" title="previous chapter">Engine Overview</a>
<li>Next: <a href="../xpath.html" title="next chapter">XPath Engine</a></ul>
</li></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 role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../../_sources/dev/engines/demo/demo_online.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright SearXNG team.
</div>
<script src="../../../_static/version_warning_offset.js"></script>
</body>
</html>

View file

@ -0,0 +1,822 @@
<!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>Engine Overview &#8212; SearXNG Documentation (2023.8.11+905ce2a6f)</title>
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=4f649999" />
<link rel="stylesheet" type="text/css" href="../../_static/searxng.css?v=52e4ff28" />
<link rel="stylesheet" type="text/css" href="../../_static/tabs.css?v=a5c4661c" />
<script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js?v=3c88bde0"></script>
<script src="../../_static/doctools.js?v=888ff710"></script>
<script src="../../_static/sphinx_highlight.js?v=4825356b"></script>
<link rel="index" title="Index" href="../../genindex.html" />
<link rel="search" title="Search" href="../../search.html" />
<link rel="next" title="Demo Online Engine" href="demo/demo_online.html" />
<link rel="prev" title="SearXNGs engines loader" href="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="demo/demo_online.html" title="Demo Online Engine"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="engines.html" title="SearXNGs engines loader"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../../index.html">SearXNG Documentation (2023.8.11+905ce2a6f)</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../index.html" >Developer documentation</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="index.html" accesskey="U">Engine Implementations</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Engine Overview</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="engine-overview">
<span id="engines-dev"></span><h1>Engine Overview<a class="headerlink" href="#engine-overview" title="Permalink to this heading"></a></h1>
<nav class="contents local" id="contents">
<ul class="simple">
<li><p><a class="reference internal" href="#general-engine-configuration" id="id16">General Engine Configuration</a></p>
<ul>
<li><p><a class="reference internal" href="#engine-file" id="id17">Engine File</a></p></li>
<li><p><a class="reference internal" href="#engine-settings-yml" id="id18">Engine <code class="docutils literal notranslate"><span class="pre">settings.yml</span></code></a></p></li>
<li><p><a class="reference internal" href="#overrides" id="id19">Overrides</a></p></li>
</ul>
</li>
<li><p><a class="reference internal" href="#making-a-request" id="id20">Making a Request</a></p>
<ul>
<li><p><a class="reference internal" href="#passed-arguments-request" id="id21">Passed Arguments (request)</a></p></li>
<li><p><a class="reference internal" href="#specify-request" id="id22">Specify Request</a></p></li>
</ul>
</li>
<li><p><a class="reference internal" href="#result-types-template" id="id23">Result Types (<code class="docutils literal notranslate"><span class="pre">template</span></code>)</a></p>
<ul>
<li><p><a class="reference internal" href="#default" id="id24"><code class="docutils literal notranslate"><span class="pre">default</span></code></a></p></li>
<li><p><a class="reference internal" href="#images" id="id25"><code class="docutils literal notranslate"><span class="pre">images</span></code></a></p></li>
<li><p><a class="reference internal" href="#videos" id="id26"><code class="docutils literal notranslate"><span class="pre">videos</span></code></a></p></li>
<li><p><a class="reference internal" href="#torrent" id="id27"><code class="docutils literal notranslate"><span class="pre">torrent</span></code></a></p></li>
<li><p><a class="reference internal" href="#map" id="id28"><code class="docutils literal notranslate"><span class="pre">map</span></code></a></p></li>
<li><p><a class="reference internal" href="#paper" id="id29"><code class="docutils literal notranslate"><span class="pre">paper</span></code></a></p></li>
</ul>
</li>
</ul>
</nav>
<aside class="sidebar">
<p class="sidebar-title">Further reading ..</p>
<ul class="simple">
<li><p><a class="reference internal" href="../../user/configured_engines.html#configured-engines"><span class="std std-ref">Configured Engines</span></a></p></li>
<li><p><a class="reference internal" href="../../admin/settings/settings_engine.html#settings-engine"><span class="std std-ref">engine:</span></a></p></li>
</ul>
</aside>
<p>SearXNG is a <a class="reference external" href="https://en.wikipedia.org/wiki/Metasearch_engine">metasearch-engine</a>, so it uses different search engines to provide
better results.</p>
<p>Because there is no general search API which could be used for every search
engine, an adapter has to be built between SearXNG and the external search
engines. Adapters are stored under the folder <a class="reference external" href="https://github.com/searxng/searxng/blob/master/searx/engines">git://searx/engines</a>.</p>
<section id="general-engine-configuration">
<span id="id1"></span><h2><a class="toc-backref" href="#id16" role="doc-backlink">General Engine Configuration</a><a class="headerlink" href="#general-engine-configuration" title="Permalink to this heading"></a></h2>
<p>It is required to tell SearXNG the type of results the engine provides. The
arguments can be set in the engine file or in the settings file (normally
<code class="docutils literal notranslate"><span class="pre">settings.yml</span></code>). The arguments in the settings file override the ones in the
engine file.</p>
<p>It does not matter if an option is stored in the engine file or in the settings.
However, the standard way is the following:</p>
<section id="engine-file">
<span id="id2"></span><h3><a class="toc-backref" href="#id17" role="doc-backlink">Engine File</a><a class="headerlink" href="#engine-file" title="Permalink to this heading"></a></h3>
<table class="docutils align-default" id="id3" style="width: 100%">
<caption><span class="caption-number">Table 2 </span><span class="caption-text">Common options in the engine module</span><a class="headerlink" href="#id3" title="Permalink to this table"></a></caption>
<thead>
<tr class="row-odd"><th class="head"><p>argument</p></th>
<th class="head"><p>type</p></th>
<th class="head"><p>information</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>categories</p></td>
<td><p>list</p></td>
<td><p>categories, in which the engine is working</p></td>
</tr>
<tr class="row-odd"><td><p>paging</p></td>
<td><p>boolean</p></td>
<td><p>support multiple pages</p></td>
</tr>
<tr class="row-even"><td><p>time_range_support</p></td>
<td><p>boolean</p></td>
<td><p>support search time range</p></td>
</tr>
<tr class="row-odd"><td><p>engine_type</p></td>
<td><p>str</p></td>
<td><ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">online</span></code> <a class="reference internal" href="index.html#online-engines"><span class="std std-ref">[ref]</span></a> by
default, other possibles values are:</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">offline</span></code> <a class="reference internal" href="index.html#offline-engines"><span class="std std-ref">[ref]</span></a></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">online_dictionary</span></code> <a class="reference internal" href="index.html#online-dictionary"><span class="std std-ref">[ref]</span></a></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">online_currency</span></code> <a class="reference internal" href="index.html#online-currency"><span class="std std-ref">[ref]</span></a></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">online_url_search</span></code> <a class="reference internal" href="index.html#online-url-search"><span class="std std-ref">[ref]</span></a></p></li>
</ul>
</td>
</tr>
</tbody>
</table>
</section>
<section id="engine-settings-yml">
<span id="engine-settings"></span><h3><a class="toc-backref" href="#id18" role="doc-backlink">Engine <code class="docutils literal notranslate"><span class="pre">settings.yml</span></code></a><a class="headerlink" href="#engine-settings-yml" title="Permalink to this heading"></a></h3>
<p>For a more detailed description, see <a class="reference internal" href="../../admin/settings/settings_engine.html#settings-engine"><span class="std std-ref">engine:</span></a> in the <a class="reference internal" href="../../admin/settings/settings.html#settings-yml"><span class="std std-ref">settings.yml</span></a>.</p>
<table class="docutils align-default" id="id4" style="width: 100%">
<caption><span class="caption-number">Table 3 </span><span class="caption-text">Common options in the engine setup (<code class="docutils literal notranslate"><span class="pre">settings.yml</span></code>)</span><a class="headerlink" href="#id4" title="Permalink to this table"></a></caption>
<thead>
<tr class="row-odd"><th class="head"><p>argument</p></th>
<th class="head"><p>type</p></th>
<th class="head"><p>information</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>name</p></td>
<td><p>string</p></td>
<td><p>name of search-engine</p></td>
</tr>
<tr class="row-odd"><td><p>engine</p></td>
<td><p>string</p></td>
<td><p>name of searxng-engine (file name without <code class="docutils literal notranslate"><span class="pre">.py</span></code>)</p></td>
</tr>
<tr class="row-even"><td><p>enable_http</p></td>
<td><p>bool</p></td>
<td><p>enable HTTP (by default only HTTPS is enabled).</p></td>
</tr>
<tr class="row-odd"><td><p>shortcut</p></td>
<td><p>string</p></td>
<td><p>shortcut of search-engine</p></td>
</tr>
<tr class="row-even"><td><p>timeout</p></td>
<td><p>string</p></td>
<td><p>specific timeout for search-engine</p></td>
</tr>
<tr class="row-odd"><td><p>display_error_messages</p></td>
<td><p>boolean</p></td>
<td><p>display error messages on the web UI</p></td>
</tr>
<tr class="row-even"><td><p>proxies</p></td>
<td><p>dict</p></td>
<td><p>set proxies for a specific engine
(e.g. <code class="docutils literal notranslate"><span class="pre">proxies</span> <span class="pre">:</span> <span class="pre">{http:</span> <span class="pre">socks5://proxy:port,</span>
<span class="pre">https:</span> <span class="pre">socks5://proxy:port}</span></code>)</p></td>
</tr>
</tbody>
</table>
</section>
<section id="overrides">
<span id="engine-overrides"></span><h3><a class="toc-backref" href="#id19" role="doc-backlink">Overrides</a><a class="headerlink" href="#overrides" title="Permalink to this heading"></a></h3>
<p>A few of the options have default values in the namespace of engines python
modul, but are often overwritten by the settings. If <code class="docutils literal notranslate"><span class="pre">None</span></code> is assigned to an
option in the engine file, it has to be redefined in the settings, otherwise
SearXNG will not start with that engine (global names with a leading underline can
be <code class="docutils literal notranslate"><span class="pre">None</span></code>).</p>
<p>Here is an very simple example of the global names in the namespace of engines
module:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1"># engine dependent config</span>
<span class="n">categories</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;general&#39;</span><span class="p">]</span>
<span class="n">paging</span> <span class="o">=</span> <span class="kc">True</span>
<span class="n">_non_overwritten_global</span> <span class="o">=</span> <span class="s1">&#39;foo&#39;</span>
</pre></div>
</div>
<table class="docutils align-default" id="id5" style="width: 100%">
<caption><span class="caption-number">Table 4 </span><span class="caption-text">The naming of overrides is arbitrary / recommended overrides are:</span><a class="headerlink" href="#id5" title="Permalink to this table"></a></caption>
<thead>
<tr class="row-odd"><th class="head"><p>argument</p></th>
<th class="head"><p>type</p></th>
<th class="head"><p>information</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>base_url</p></td>
<td><p>string</p></td>
<td><p>base-url, can be overwritten to use same
engine on other URL</p></td>
</tr>
<tr class="row-odd"><td><p>number_of_results</p></td>
<td><p>int</p></td>
<td><p>maximum number of results per request</p></td>
</tr>
<tr class="row-even"><td><p>language</p></td>
<td><p>string</p></td>
<td><p>ISO code of language and country like en_US</p></td>
</tr>
<tr class="row-odd"><td><p>api_key</p></td>
<td><p>string</p></td>
<td><p>api-key if required by engine</p></td>
</tr>
</tbody>
</table>
</section>
</section>
<section id="making-a-request">
<span id="engine-request"></span><h2><a class="toc-backref" href="#id20" role="doc-backlink">Making a Request</a><a class="headerlink" href="#making-a-request" title="Permalink to this heading"></a></h2>
<p>To perform a search an URL have to be specified. In addition to specifying an
URL, arguments can be passed to the query.</p>
<section id="passed-arguments-request">
<span id="engine-request-arguments"></span><h3><a class="toc-backref" href="#id21" role="doc-backlink">Passed Arguments (request)</a><a class="headerlink" href="#passed-arguments-request" title="Permalink to this heading"></a></h3>
<p>These arguments can be used to construct the search query. Furthermore,
parameters with default value can be redefined for special purposes.</p>
<span id="engine-request-online"></span><table class="docutils align-default" id="id6" style="width: 100%">
<caption><span class="caption-number">Table 5 </span><span class="caption-text">If the <code class="docutils literal notranslate"><span class="pre">engine_type</span></code> is <a class="reference internal" href="../../src/searx.search.processors.html#searx.search.processors.online.OnlineProcessor.get_params" title="searx.search.processors.online.OnlineProcessor.get_params"><code class="xref py py-obj docutils literal notranslate"><span class="pre">online</span></code></a></span><a class="headerlink" href="#id6" title="Permalink to this table"></a></caption>
<thead>
<tr class="row-odd"><th class="head"><p>argument</p></th>
<th class="head"><p>type</p></th>
<th class="head"><p>default-value, information</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>url</p></td>
<td><p>str</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">''</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>method</p></td>
<td><p>str</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">'GET'</span></code></p></td>
</tr>
<tr class="row-even"><td><p>headers</p></td>
<td><p>set</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">{}</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>data</p></td>
<td><p>set</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">{}</span></code></p></td>
</tr>
<tr class="row-even"><td><p>cookies</p></td>
<td><p>set</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">{}</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>verify</p></td>
<td><p>bool</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">True</span></code></p></td>
</tr>
<tr class="row-even"><td><p>headers.User-Agent</p></td>
<td><p>str</p></td>
<td><p>a random User-Agent</p></td>
</tr>
<tr class="row-odd"><td><p>category</p></td>
<td><p>str</p></td>
<td><p>current category, like <code class="docutils literal notranslate"><span class="pre">'general'</span></code></p></td>
</tr>
<tr class="row-even"><td><p>safesearch</p></td>
<td><p>int</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">0</span></code>, between <code class="docutils literal notranslate"><span class="pre">0</span></code> and <code class="docutils literal notranslate"><span class="pre">2</span></code> (normal, moderate, strict)</p></td>
</tr>
<tr class="row-odd"><td><p>time_range</p></td>
<td><p>Optional[str]</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">None</span></code>, can be <code class="docutils literal notranslate"><span class="pre">day</span></code>, <code class="docutils literal notranslate"><span class="pre">week</span></code>, <code class="docutils literal notranslate"><span class="pre">month</span></code>, <code class="docutils literal notranslate"><span class="pre">year</span></code></p></td>
</tr>
<tr class="row-even"><td><p>pageno</p></td>
<td><p>int</p></td>
<td><p>current pagenumber</p></td>
</tr>
<tr class="row-odd"><td><p>searxng_locale</p></td>
<td><p>str</p></td>
<td><p>SearXNGs locale selected by user. Specific language code like
<code class="docutils literal notranslate"><span class="pre">'en'</span></code>, <code class="docutils literal notranslate"><span class="pre">'en-US'</span></code>, or <code class="docutils literal notranslate"><span class="pre">'all'</span></code> if unspecified.</p></td>
</tr>
</tbody>
</table>
<span id="engine-request-online-dictionary"></span><table class="docutils align-default" id="id7" style="width: 100%">
<caption><span class="caption-number">Table 6 </span><span class="caption-text">If the <code class="docutils literal notranslate"><span class="pre">engine_type</span></code> is <a class="reference internal" href="../../src/searx.search.processors.html#searx.search.processors.online_dictionary.OnlineDictionaryProcessor.get_params" title="searx.search.processors.online_dictionary.OnlineDictionaryProcessor.get_params"><code class="xref py py-obj docutils literal notranslate"><span class="pre">online_dictionary</span></code></a>,
in addition to the <a class="reference internal" href="#engine-request-online"><span class="std std-ref">online</span></a> arguments:</span><a class="headerlink" href="#id7" title="Permalink to this table"></a></caption>
<thead>
<tr class="row-odd"><th class="head"><p>argument</p></th>
<th class="head"><p>type</p></th>
<th class="head"><p>default-value, information</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>from_lang</p></td>
<td><p>str</p></td>
<td><p>specific language code like <code class="docutils literal notranslate"><span class="pre">'en_US'</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>to_lang</p></td>
<td><p>str</p></td>
<td><p>specific language code like <code class="docutils literal notranslate"><span class="pre">'en_US'</span></code></p></td>
</tr>
<tr class="row-even"><td><p>query</p></td>
<td><p>str</p></td>
<td><p>the text query without the languages</p></td>
</tr>
</tbody>
</table>
<span id="engine-request-online-currency"></span><table class="docutils align-default" id="id8" style="width: 100%">
<caption><span class="caption-number">Table 7 </span><span class="caption-text">If the <code class="docutils literal notranslate"><span class="pre">engine_type</span></code> is <a class="reference internal" href="../../src/searx.search.processors.html#searx.search.processors.online_currency.OnlineCurrencyProcessor.get_params" title="searx.search.processors.online_currency.OnlineCurrencyProcessor.get_params"><code class="xref py py-obj docutils literal notranslate"><span class="pre">online_currency</span></code></a>,
in addition to the <a class="reference internal" href="#engine-request-online"><span class="std std-ref">online</span></a> arguments:</span><a class="headerlink" href="#id8" title="Permalink to this table"></a></caption>
<thead>
<tr class="row-odd"><th class="head"><p>argument</p></th>
<th class="head"><p>type</p></th>
<th class="head"><p>default-value, information</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>amount</p></td>
<td><p>float</p></td>
<td><p>the amount to convert</p></td>
</tr>
<tr class="row-odd"><td><p>from</p></td>
<td><p>str</p></td>
<td><p>ISO 4217 code</p></td>
</tr>
<tr class="row-even"><td><p>to</p></td>
<td><p>str</p></td>
<td><p>ISO 4217 code</p></td>
</tr>
<tr class="row-odd"><td><p>from_name</p></td>
<td><p>str</p></td>
<td><p>currency name</p></td>
</tr>
<tr class="row-even"><td><p>to_name</p></td>
<td><p>str</p></td>
<td><p>currency name</p></td>
</tr>
</tbody>
</table>
<span id="engine-request-online-url-search"></span><table class="docutils align-default" id="id9" style="width: 100%">
<caption><span class="caption-number">Table 8 </span><span class="caption-text">If the <code class="docutils literal notranslate"><span class="pre">engine_type</span></code> is <a class="reference internal" href="../../src/searx.search.processors.html#searx.search.processors.online_url_search.OnlineUrlSearchProcessor.get_params" title="searx.search.processors.online_url_search.OnlineUrlSearchProcessor.get_params"><code class="xref py py-obj docutils literal notranslate"><span class="pre">online_url_search</span></code></a>,
in addition to the <a class="reference internal" href="#engine-request-online"><span class="std std-ref">online</span></a> arguments:</span><a class="headerlink" href="#id9" title="Permalink to this table"></a></caption>
<thead>
<tr class="row-odd"><th class="head"><p>argument</p></th>
<th class="head"><p>type</p></th>
<th class="head"><p>default-value, information</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>search_url</p></td>
<td><p>dict</p></td>
<td><p>URLs from the search query:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="s1">&#39;http&#39;</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span>
<span class="s1">&#39;ftp&#39;</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span>
<span class="s1">&#39;data:image&#39;</span><span class="p">:</span> <span class="nb">str</span>
<span class="p">}</span>
</pre></div>
</div>
</td>
</tr>
</tbody>
</table>
</section>
<section id="specify-request">
<h3><a class="toc-backref" href="#id22" role="doc-backlink">Specify Request</a><a class="headerlink" href="#specify-request" title="Permalink to this heading"></a></h3>
<p>The function <a class="reference internal" href="demo/demo_online.html#searx.engines.demo_online.request" title="searx.engines.demo_online.request"><code class="xref py py-func docutils literal notranslate"><span class="pre">def</span> <span class="pre">request(query,</span> <span class="pre">params):</span></code></a> always returns the <code class="docutils literal notranslate"><span class="pre">params</span></code> variable, the
following parameters can be used to specify a search request:</p>
<table class="docutils align-default" style="width: 100%">
<thead>
<tr class="row-odd"><th class="head"><p>argument</p></th>
<th class="head"><p>type</p></th>
<th class="head"><p>information</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>url</p></td>
<td><p>str</p></td>
<td><p>requested url</p></td>
</tr>
<tr class="row-odd"><td><p>method</p></td>
<td><p>str</p></td>
<td><p>HTTP request method</p></td>
</tr>
<tr class="row-even"><td><p>headers</p></td>
<td><p>set</p></td>
<td><p>HTTP header information</p></td>
</tr>
<tr class="row-odd"><td><p>data</p></td>
<td><p>set</p></td>
<td><p>HTTP data information</p></td>
</tr>
<tr class="row-even"><td><p>cookies</p></td>
<td><p>set</p></td>
<td><p>HTTP cookies</p></td>
</tr>
<tr class="row-odd"><td><p>verify</p></td>
<td><p>bool</p></td>
<td><p>Performing SSL-Validity check</p></td>
</tr>
<tr class="row-even"><td><p>allow_redirects</p></td>
<td><p>bool</p></td>
<td><p>Follow redirects</p></td>
</tr>
<tr class="row-odd"><td><p>max_redirects</p></td>
<td><p>int</p></td>
<td><p>maximum redirects, hard limit</p></td>
</tr>
<tr class="row-even"><td><p>soft_max_redirects</p></td>
<td><p>int</p></td>
<td><p>maximum redirects, soft limit. Record an error but dont stop the engine</p></td>
</tr>
<tr class="row-odd"><td><p>raise_for_httperror</p></td>
<td><p>bool</p></td>
<td><p>True by default: raise an exception if the HTTP code of response is &gt;= 300</p></td>
</tr>
</tbody>
</table>
</section>
</section>
<section id="result-types-template">
<span id="engine-media-types"></span><span id="engine-results"></span><h2><a class="toc-backref" href="#id23" role="doc-backlink">Result Types (<code class="docutils literal notranslate"><span class="pre">template</span></code>)</a><a class="headerlink" href="#result-types-template" title="Permalink to this heading"></a></h2>
<p>Each result item of an engine can be of different media-types. Currently the
following media-types are supported. To set another media-type as
<a class="reference internal" href="#template-default"><span class="std std-ref">default</span></a>, the parameter <code class="docutils literal notranslate"><span class="pre">template</span></code> must be set to the desired
type.</p>
<section id="default">
<span id="template-default"></span><h3><a class="toc-backref" href="#id24" role="doc-backlink"><code class="docutils literal notranslate"><span class="pre">default</span></code></a><a class="headerlink" href="#default" title="Permalink to this heading"></a></h3>
<table class="docutils align-default" id="id10" style="width: 100%">
<caption><span class="caption-number">Table 9 </span><span class="caption-text">Parameter of the <strong>default</strong> media type:</span><a class="headerlink" href="#id10" title="Permalink to this table"></a></caption>
<thead>
<tr class="row-odd"><th class="head"><p>result-parameter</p></th>
<th class="head"><p>information</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>url</p></td>
<td><p>string, url of the result</p></td>
</tr>
<tr class="row-odd"><td><p>title</p></td>
<td><p>string, title of the result</p></td>
</tr>
<tr class="row-even"><td><p>content</p></td>
<td><p>string, general result-text</p></td>
</tr>
<tr class="row-odd"><td><p>publishedDate</p></td>
<td><p><a class="reference external" href="https://docs.python.org/3/library/datetime.html#datetime.datetime" title="(in Python v3.11)"><code class="xref py py-class docutils literal notranslate"><span class="pre">datetime.datetime</span></code></a>, time of publish</p></td>
</tr>
</tbody>
</table>
</section>
<section id="images">
<span id="template-images"></span><h3><a class="toc-backref" href="#id25" role="doc-backlink"><code class="docutils literal notranslate"><span class="pre">images</span></code></a><a class="headerlink" href="#images" title="Permalink to this heading"></a></h3>
<table class="docutils align-default" id="id11" style="width: 100%">
<caption><span class="caption-number">Table 10 </span><span class="caption-text">Parameter of the <strong>images</strong> media type:</span><a class="headerlink" href="#id11" title="Permalink to this table"></a></caption>
<thead>
<tr class="row-odd"><th class="head"><p>result-parameter</p></th>
<th class="head"><p>information</p></th>
</tr>
<tr class="row-even"><th class="head"><p>template</p></th>
<th class="head"><p>is set to <code class="docutils literal notranslate"><span class="pre">images.html</span></code></p></th>
</tr>
</thead>
<tbody>
<tr class="row-odd"><td><p>url</p></td>
<td><p>string, url to the result site</p></td>
</tr>
<tr class="row-even"><td><p>title</p></td>
<td><p>string, title of the result <em>(partly implemented)</em></p></td>
</tr>
<tr class="row-odd"><td><p>content</p></td>
<td><p><em>(partly implemented)</em></p></td>
</tr>
<tr class="row-even"><td><p>publishedDate</p></td>
<td><p><a class="reference external" href="https://docs.python.org/3/library/datetime.html#datetime.datetime" title="(in Python v3.11)"><code class="xref py py-class docutils literal notranslate"><span class="pre">datetime.datetime</span></code></a>,
time of publish <em>(partly implemented)</em></p></td>
</tr>
<tr class="row-odd"><td><p>img_src</p></td>
<td><p>string, url to the result image</p></td>
</tr>
<tr class="row-even"><td><p>thumbnail_src</p></td>
<td><p>string, url to a small-preview image</p></td>
</tr>
</tbody>
</table>
</section>
<section id="videos">
<span id="template-videos"></span><h3><a class="toc-backref" href="#id26" role="doc-backlink"><code class="docutils literal notranslate"><span class="pre">videos</span></code></a><a class="headerlink" href="#videos" title="Permalink to this heading"></a></h3>
<table class="docutils align-default" id="id12" style="width: 100%">
<caption><span class="caption-number">Table 11 </span><span class="caption-text">Parameter of the <strong>videos</strong> media type:</span><a class="headerlink" href="#id12" title="Permalink to this table"></a></caption>
<thead>
<tr class="row-odd"><th class="head"><p>result-parameter</p></th>
<th class="head"><p>information</p></th>
</tr>
<tr class="row-even"><th class="head"><p>template</p></th>
<th class="head"><p>is set to <code class="docutils literal notranslate"><span class="pre">videos.html</span></code></p></th>
</tr>
</thead>
<tbody>
<tr class="row-odd"><td><p>url</p></td>
<td><p>string, url of the result</p></td>
</tr>
<tr class="row-even"><td><p>title</p></td>
<td><p>string, title of the result</p></td>
</tr>
<tr class="row-odd"><td><p>content</p></td>
<td><p><em>(not implemented yet)</em></p></td>
</tr>
<tr class="row-even"><td><p>publishedDate</p></td>
<td><p><a class="reference external" href="https://docs.python.org/3/library/datetime.html#datetime.datetime" title="(in Python v3.11)"><code class="xref py py-class docutils literal notranslate"><span class="pre">datetime.datetime</span></code></a>, time of publish</p></td>
</tr>
<tr class="row-odd"><td><p>thumbnail</p></td>
<td><p>string, url to a small-preview image</p></td>
</tr>
</tbody>
</table>
</section>
<section id="torrent">
<span id="template-torrent"></span><h3><a class="toc-backref" href="#id27" role="doc-backlink"><code class="docutils literal notranslate"><span class="pre">torrent</span></code></a><a class="headerlink" href="#torrent" title="Permalink to this heading"></a></h3>
<table class="docutils align-default" id="id13" style="width: 100%">
<caption><span class="caption-number">Table 12 </span><span class="caption-text">Parameter of the <strong>torrent</strong> media type:</span><a class="headerlink" href="#id13" title="Permalink to this table"></a></caption>
<thead>
<tr class="row-odd"><th class="head"><p>result-parameter</p></th>
<th class="head"><p>information</p></th>
</tr>
<tr class="row-even"><th class="head"><p>template</p></th>
<th class="head"><p>is set to <code class="docutils literal notranslate"><span class="pre">torrent.html</span></code></p></th>
</tr>
</thead>
<tbody>
<tr class="row-odd"><td><p>url</p></td>
<td><p>string, url of the result</p></td>
</tr>
<tr class="row-even"><td><p>title</p></td>
<td><p>string, title of the result</p></td>
</tr>
<tr class="row-odd"><td><p>content</p></td>
<td><p>string, general result-text</p></td>
</tr>
<tr class="row-even"><td><p>publishedDate</p></td>
<td><p><a class="reference external" href="https://docs.python.org/3/library/datetime.html#datetime.datetime" title="(in Python v3.11)"><code class="xref py py-class docutils literal notranslate"><span class="pre">datetime.datetime</span></code></a>,
time of publish <em>(not implemented yet)</em></p></td>
</tr>
<tr class="row-odd"><td><p>seed</p></td>
<td><p>int, number of seeder</p></td>
</tr>
<tr class="row-even"><td><p>leech</p></td>
<td><p>int, number of leecher</p></td>
</tr>
<tr class="row-odd"><td><p>filesize</p></td>
<td><p>int, size of file in bytes</p></td>
</tr>
<tr class="row-even"><td><p>files</p></td>
<td><p>int, number of files</p></td>
</tr>
<tr class="row-odd"><td><p>magnetlink</p></td>
<td><p>string, <a class="reference external" href="https://en.wikipedia.org/wiki/Magnet_URI_scheme">magnetlink</a> of the result</p></td>
</tr>
<tr class="row-even"><td><p>torrentfile</p></td>
<td><p>string, torrentfile of the result</p></td>
</tr>
</tbody>
</table>
</section>
<section id="map">
<span id="template-map"></span><h3><a class="toc-backref" href="#id28" role="doc-backlink"><code class="docutils literal notranslate"><span class="pre">map</span></code></a><a class="headerlink" href="#map" title="Permalink to this heading"></a></h3>
<table class="docutils align-default" id="id14" style="width: 100%">
<caption><span class="caption-number">Table 13 </span><span class="caption-text">Parameter of the <strong>map</strong> media type:</span><a class="headerlink" href="#id14" title="Permalink to this table"></a></caption>
<thead>
<tr class="row-odd"><th class="head"><p>result-parameter</p></th>
<th class="head"><p>information</p></th>
</tr>
<tr class="row-even"><th class="head"><p>template</p></th>
<th class="head"><p>is set to <code class="docutils literal notranslate"><span class="pre">map.html</span></code></p></th>
</tr>
</thead>
<tbody>
<tr class="row-odd"><td><p>url</p></td>
<td><p>string, url of the result</p></td>
</tr>
<tr class="row-even"><td><p>title</p></td>
<td><p>string, title of the result</p></td>
</tr>
<tr class="row-odd"><td><p>content</p></td>
<td><p>string, general result-text</p></td>
</tr>
<tr class="row-even"><td><p>publishedDate</p></td>
<td><p><a class="reference external" href="https://docs.python.org/3/library/datetime.html#datetime.datetime" title="(in Python v3.11)"><code class="xref py py-class docutils literal notranslate"><span class="pre">datetime.datetime</span></code></a>, time of publish</p></td>
</tr>
<tr class="row-odd"><td><p>latitude</p></td>
<td><p>latitude of result (in decimal format)</p></td>
</tr>
<tr class="row-even"><td><p>longitude</p></td>
<td><p>longitude of result (in decimal format)</p></td>
</tr>
<tr class="row-odd"><td><p>boundingbox</p></td>
<td><p>boundingbox of result (array of 4. values
<code class="docutils literal notranslate"><span class="pre">[lat-min,</span> <span class="pre">lat-max,</span> <span class="pre">lon-min,</span> <span class="pre">lon-max]</span></code>)</p></td>
</tr>
<tr class="row-even"><td><p>geojson</p></td>
<td><p>geojson of result (<a class="reference external" href="https://geojson.org/">https://geojson.org/</a>)</p></td>
</tr>
<tr class="row-odd"><td><p>osm.type</p></td>
<td><p>type of osm-object (if OSM-Result)</p></td>
</tr>
<tr class="row-even"><td><p>osm.id</p></td>
<td><p>id of osm-object (if OSM-Result)</p></td>
</tr>
<tr class="row-odd"><td><p>address.name</p></td>
<td><p>name of object</p></td>
</tr>
<tr class="row-even"><td><p>address.road</p></td>
<td><p>street name of object</p></td>
</tr>
<tr class="row-odd"><td><p>address.house_number</p></td>
<td><p>house number of object</p></td>
</tr>
<tr class="row-even"><td><p>address.locality</p></td>
<td><p>city, place of object</p></td>
</tr>
<tr class="row-odd"><td><p>address.postcode</p></td>
<td><p>postcode of object</p></td>
</tr>
<tr class="row-even"><td><p>address.country</p></td>
<td><p>country of object</p></td>
</tr>
</tbody>
</table>
</section>
<section id="paper">
<span id="template-paper"></span><h3><a class="toc-backref" href="#id29" role="doc-backlink"><code class="docutils literal notranslate"><span class="pre">paper</span></code></a><a class="headerlink" href="#paper" title="Permalink to this heading"></a></h3>
<table class="docutils align-default" id="id15" style="width: 100%">
<caption><span class="caption-number">Table 14 </span><span class="caption-text">Parameter of the <strong>paper</strong> media type /
see <a class="reference external" href="https://en.wikipedia.org/wiki/BibTeX#Field_types">BibTeX field types</a> and <a class="reference external" href="https://www.bibtex.com/g/bibtex-format/">BibTeX format</a></span><a class="headerlink" href="#id15" title="Permalink to this table"></a></caption>
<thead>
<tr class="row-odd"><th class="head"><p>result-parameter</p></th>
<th class="head"><p>Python type</p></th>
<th class="head"><p>information</p></th>
</tr>
<tr class="row-even"><th class="head"><p>template</p></th>
<th class="head"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code></a></p></th>
<th class="head"><p>is set to <code class="docutils literal notranslate"><span class="pre">paper.html</span></code></p></th>
</tr>
</thead>
<tbody>
<tr class="row-odd"><td><p>title</p></td>
<td><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code></a></p></td>
<td><p>title of the result</p></td>
</tr>
<tr class="row-even"><td><p>content</p></td>
<td><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code></a></p></td>
<td><p>abstract</p></td>
</tr>
<tr class="row-odd"><td><p>comments</p></td>
<td><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code></a></p></td>
<td><p>free text display in italic below the content</p></td>
</tr>
<tr class="row-even"><td><p>tags</p></td>
<td><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.11)"><code class="xref py py-class docutils literal notranslate"><span class="pre">List</span></code></a>[<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code></a>]</p></td>
<td><p>free tag list</p></td>
</tr>
<tr class="row-odd"><td><p>publishedDate</p></td>
<td><p><a class="reference external" href="https://docs.python.org/3/library/datetime.html#datetime.datetime" title="(in Python v3.11)"><code class="xref py py-class docutils literal notranslate"><span class="pre">datetime</span></code></a></p></td>
<td><p>last publication date</p></td>
</tr>
<tr class="row-even"><td><p>type</p></td>
<td><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code></a></p></td>
<td><p>short description of medium type, e.g. <em>book</em>, <em>pdf</em> or <em>html</em></p></td>
</tr>
<tr class="row-odd"><td><p>authors</p></td>
<td><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.11)"><code class="xref py py-class docutils literal notranslate"><span class="pre">List</span></code></a>[<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code></a>]</p></td>
<td><p>list of authors of the work (authors with a “s”)</p></td>
</tr>
<tr class="row-even"><td><p>editor</p></td>
<td><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code></a></p></td>
<td><p>list of editors of a book</p></td>
</tr>
<tr class="row-odd"><td><p>publisher</p></td>
<td><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code></a></p></td>
<td><p>name of the publisher</p></td>
</tr>
<tr class="row-even"><td><p>journal</p></td>
<td><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code></a></p></td>
<td><p>name of the journal or magazine the article was
published in</p></td>
</tr>
<tr class="row-odd"><td><p>volume</p></td>
<td><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code></a></p></td>
<td><p>volume number</p></td>
</tr>
<tr class="row-even"><td><p>pages</p></td>
<td><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code></a></p></td>
<td><p>page range where the article is</p></td>
</tr>
<tr class="row-odd"><td><p>number</p></td>
<td><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code></a></p></td>
<td><p>number of the report or the issue number for a journal article</p></td>
</tr>
<tr class="row-even"><td><p>doi</p></td>
<td><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code></a></p></td>
<td><p>DOI number (like <code class="docutils literal notranslate"><span class="pre">10.1038/d41586-018-07848-2</span></code>)</p></td>
</tr>
<tr class="row-odd"><td><p>issn</p></td>
<td><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.11)"><code class="xref py py-class docutils literal notranslate"><span class="pre">List</span></code></a>[<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code></a>]</p></td>
<td><p>ISSN number like <code class="docutils literal notranslate"><span class="pre">1476-4687</span></code></p></td>
</tr>
<tr class="row-even"><td><p>isbn</p></td>
<td><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.11)"><code class="xref py py-class docutils literal notranslate"><span class="pre">List</span></code></a>[<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code></a>]</p></td>
<td><p>ISBN number like <code class="docutils literal notranslate"><span class="pre">9780201896831</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>pdf_url</p></td>
<td><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code></a></p></td>
<td><p>URL to the full article, the PDF version</p></td>
</tr>
<tr class="row-even"><td><p>html_url</p></td>
<td><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code></a></p></td>
<td><p>URL to full article, HTML version</p></td>
</tr>
</tbody>
</table>
</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/searxng-wordmark.svg" alt="Logo"/>
</a></p>
<h3><a href="../../index.html">Table of Contents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../user/index.html">User information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../own-instance.html">Why use a private instance?</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../admin/index.html">Administrator documentation</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../index.html">Developer documentation</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../quickstart.html">Development Quickstart</a></li>
<li class="toctree-l2"><a class="reference internal" href="../contribution_guide.html">How to contribute</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="index.html">Engine Implementations</a></li>
<li class="toctree-l2"><a class="reference internal" href="../search_api.html">Search API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../plugins.html">Plugins</a></li>
<li class="toctree-l2"><a class="reference internal" href="../translation.html">Translation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../lxcdev.html">Developing in Linux Containers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../makefile.html">Makefile &amp; <code class="docutils literal notranslate"><span class="pre">./manage</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../reST.html">reST primer</a></li>
<li class="toctree-l2"><a class="reference internal" href="../searxng_extra/index.html">Tooling box <code class="docutils literal notranslate"><span class="pre">searxng_extra</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../utils/index.html">DevOps tooling box</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../src/index.html">Source-Code</a></li>
</ul>
<h3>Project Links</h3>
<ul>
<li><a href="https://github.com/searxng/searxng/tree/master">Source</a>
<li><a href="https://github.com/searxng/searxng/wiki">Wiki</a>
<li><a href="https://searx.space">Public instances</a>
<li><a href="https://github.com/searxng/searxng/issues">Issue Tracker</a>
</ul><h3>Navigation</h3>
<ul>
<li><a href="../../index.html">Overview</a>
<ul>
<li><a href="../index.html">Developer documentation</a>
<ul>
<li><a href="index.html">Engine Implementations</a>
<ul>
<li>Previous: <a href="engines.html" title="previous chapter">SearXNGs engines loader</a>
<li>Next: <a href="demo/demo_online.html" title="next chapter">Demo Online Engine</a></ul>
</li></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 role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../_sources/dev/engines/engine_overview.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright SearXNG team.
</div>
<script src="../../_static/version_warning_offset.js"></script>
</body>
</html>

530
dev/engines/enginelib.html Normal file
View file

@ -0,0 +1,530 @@
<!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>Engine Library &#8212; SearXNG Documentation (2023.8.11+905ce2a6f)</title>
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=4f649999" />
<link rel="stylesheet" type="text/css" href="../../_static/searxng.css?v=52e4ff28" />
<link rel="stylesheet" type="text/css" href="../../_static/tabs.css?v=a5c4661c" />
<script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js?v=3c88bde0"></script>
<script src="../../_static/doctools.js?v=888ff710"></script>
<script src="../../_static/sphinx_highlight.js?v=4825356b"></script>
<link rel="index" title="Index" href="../../genindex.html" />
<link rel="search" title="Search" href="../../search.html" />
<link rel="next" title="SearXNGs engines loader" href="engines.html" />
<link rel="prev" title="Engine Implementations" href="index.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="engines.html" title="SearXNGs engines loader"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="index.html" title="Engine Implementations"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../../index.html">SearXNG Documentation (2023.8.11+905ce2a6f)</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../index.html" >Developer documentation</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="index.html" accesskey="U">Engine Implementations</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Engine Library</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="engine-library">
<span id="searx-enginelib"></span><h1>Engine Library<a class="headerlink" href="#engine-library" title="Permalink to this heading"></a></h1>
<nav class="contents local" id="contents">
<ul class="simple">
<li><p><a class="reference internal" href="#module-searx.enginelib.traits" id="id1">Engine traits</a></p></li>
</ul>
</nav>
<span class="target" id="module-searx.enginelib"></span><p>Implementations of the framework for the SearXNG engines.</p>
<div class="admonition hint">
<p class="admonition-title">Hint</p>
<p>The long term goal is to modularize all implementations of the engine
framework here in this Python package. ToDo:</p>
<ul class="simple">
<li><p>move implementations of the <a class="reference internal" href="engines.html#searx-engines-loader"><span class="std std-ref">SearXNGs engines loader</span></a> to a new module in
the <a class="reference internal" href="#module-searx.enginelib" title="searx.enginelib"><code class="xref py py-obj docutils literal notranslate"><span class="pre">searx.enginelib</span></code></a> namespace.</p></li>
</ul>
</div>
<dl class="py class">
<dt class="sig sig-object py" id="searx.enginelib.Engine">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">searx.enginelib.</span></span><span class="sig-name descname"><span class="pre">Engine</span></span><a class="reference internal" href="../../_modules/searx/enginelib.html#Engine"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.enginelib.Engine" title="Permalink to this definition"></a></dt>
<dd><p>Class of engine instances build from YAML settings.</p>
<p>Further documentation see <a class="reference internal" href="engine_overview.html#general-engine-configuration"><span class="std std-ref">General Engine Configuration</span></a>.</p>
<div class="admonition hint">
<p class="admonition-title">Hint</p>
<p>This class is currently never initialized and only used for type hinting.</p>
</div>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.Engine.about">
<span class="sig-name descname"><span class="pre">about</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.11)"><span class="pre">dict</span></a></em><a class="headerlink" href="#searx.enginelib.Engine.about" title="Permalink to this definition"></a></dt>
<dd><p>Additional fileds describing the engine.</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="nt">about</span><span class="p">:</span>
<span class="w"> </span><span class="nt">website</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https://example.com</span>
<span class="w"> </span><span class="nt">wikidata_id</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Q306656</span>
<span class="w"> </span><span class="nt">official_api_documentation</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https://example.com/api-doc</span>
<span class="w"> </span><span class="nt">use_official_api</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="nt">require_api_key</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="nt">results</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">HTML</span>
</pre></div>
</div>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.Engine.categories">
<span class="sig-name descname"><span class="pre">categories</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/typing.html#typing.List" title="(in Python v3.11)"><span class="pre">List</span></a><span class="p"><span class="pre">[</span></span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><span class="pre">str</span></a><span class="p"><span class="pre">]</span></span></em><a class="headerlink" href="#searx.enginelib.Engine.categories" title="Permalink to this definition"></a></dt>
<dd><p>Specifies to which <a class="reference internal" href="../../admin/settings/settings_engine.html#engine-categories"><span class="std std-ref">categories</span></a> the engine should be added.</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.Engine.disabled">
<span class="sig-name descname"><span class="pre">disabled</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.11)"><span class="pre">bool</span></a></em><a class="headerlink" href="#searx.enginelib.Engine.disabled" title="Permalink to this definition"></a></dt>
<dd><p>To disable by default the engine, but not deleting it. It will allow the
user to manually activate it in the settings.</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.Engine.display_error_messages">
<span class="sig-name descname"><span class="pre">display_error_messages</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.11)"><span class="pre">bool</span></a></em><a class="headerlink" href="#searx.enginelib.Engine.display_error_messages" title="Permalink to this definition"></a></dt>
<dd><p>Display error messages on the web UI.</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.Engine.enable_http">
<span class="sig-name descname"><span class="pre">enable_http</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.11)"><span class="pre">bool</span></a></em><a class="headerlink" href="#searx.enginelib.Engine.enable_http" title="Permalink to this definition"></a></dt>
<dd><p>Enable HTTP (by default only HTTPS is enabled).</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.Engine.engine">
<span class="sig-name descname"><span class="pre">engine</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><span class="pre">str</span></a></em><a class="headerlink" href="#searx.enginelib.Engine.engine" title="Permalink to this definition"></a></dt>
<dd><p>Name of the python file used to handle requests and responses to and from
this search engine (file name from <a class="reference external" href="https://github.com/searxng/searxng/blob/master/searx/engines">git://searx/engines</a> without
<code class="docutils literal notranslate"><span class="pre">.py</span></code>).</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.Engine.engine_type">
<span class="sig-name descname"><span class="pre">engine_type</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><span class="pre">str</span></a></em><a class="headerlink" href="#searx.enginelib.Engine.engine_type" title="Permalink to this definition"></a></dt>
<dd><p>Type of the engine (<a class="reference internal" href="../../src/searx.search.processors.html#searx-search-processors"><span class="std std-ref">Search processors</span></a>)</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.Engine.fetch_traits">
<span class="sig-name descname"><span class="pre">fetch_traits</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/typing.html#typing.Callable" title="(in Python v3.11)"><span class="pre">Callable</span></a></em><a class="headerlink" href="#searx.enginelib.Engine.fetch_traits" title="Permalink to this definition"></a></dt>
<dd><p>Function to to fetch engines traits from origin.</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.Engine.inactive">
<span class="sig-name descname"><span class="pre">inactive</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.11)"><span class="pre">bool</span></a></em><a class="headerlink" href="#searx.enginelib.Engine.inactive" title="Permalink to this definition"></a></dt>
<dd><p>Remove the engine from the settings (<em>disabled &amp; removed</em>).</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.Engine.language">
<span class="sig-name descname"><span class="pre">language</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><span class="pre">str</span></a></em><a class="headerlink" href="#searx.enginelib.Engine.language" title="Permalink to this definition"></a></dt>
<dd><p>For an engine, when there is <code class="docutils literal notranslate"><span class="pre">language:</span> <span class="pre">...</span></code> in the YAML settings the engine
does support only this one language:</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">google french</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="nt">language</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">fr</span>
</pre></div>
</div>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.Engine.language_support">
<span class="sig-name descname"><span class="pre">language_support</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.11)"><span class="pre">bool</span></a></em><a class="headerlink" href="#searx.enginelib.Engine.language_support" title="Permalink to this definition"></a></dt>
<dd><p>Engine supports languages (locales) search.</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.Engine.name">
<span class="sig-name descname"><span class="pre">name</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><span class="pre">str</span></a></em><a class="headerlink" href="#searx.enginelib.Engine.name" title="Permalink to this definition"></a></dt>
<dd><p>Name that will be used across SearXNG to define this engine. In settings, on
the result page ..</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.Engine.paging">
<span class="sig-name descname"><span class="pre">paging</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.11)"><span class="pre">bool</span></a></em><a class="headerlink" href="#searx.enginelib.Engine.paging" title="Permalink to this definition"></a></dt>
<dd><p>Engine supports multiple pages.</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.Engine.proxies">
<span class="sig-name descname"><span class="pre">proxies</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.11)"><span class="pre">dict</span></a></em><a class="headerlink" href="#searx.enginelib.Engine.proxies" title="Permalink to this definition"></a></dt>
<dd><p>Set proxies for a specific engine (YAML):</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="nt">proxies </span><span class="p">:</span>
<span class="w"> </span><span class="nt">http</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">socks5://proxy:port</span>
<span class="w"> </span><span class="nt">https</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">socks5://proxy:port</span>
</pre></div>
</div>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.Engine.region">
<span class="sig-name descname"><span class="pre">region</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><span class="pre">str</span></a></em><a class="headerlink" href="#searx.enginelib.Engine.region" title="Permalink to this definition"></a></dt>
<dd><p>For an engine, when there is <code class="docutils literal notranslate"><span class="pre">region:</span> <span class="pre">...</span></code> in the YAML settings the engine
does support only this one region:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">..</span> <span class="n">code</span><span class="p">::</span> <span class="n">yaml</span>
</pre></div>
</div>
<blockquote>
<div><ul class="simple">
<li><p>name: google belgium
engine: google
region: fr-BE</p></li>
</ul>
</div></blockquote>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.Engine.safesearch">
<span class="sig-name descname"><span class="pre">safesearch</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.11)"><span class="pre">bool</span></a></em><a class="headerlink" href="#searx.enginelib.Engine.safesearch" title="Permalink to this definition"></a></dt>
<dd><p>Engine supports SafeSearch</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.Engine.send_accept_language_header">
<span class="sig-name descname"><span class="pre">send_accept_language_header</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.11)"><span class="pre">bool</span></a></em><a class="headerlink" href="#searx.enginelib.Engine.send_accept_language_header" title="Permalink to this definition"></a></dt>
<dd><p>When this option is activated, the language (locale) that is selected by
the user is used to build and send a <code class="docutils literal notranslate"><span class="pre">Accept-Language</span></code> header in the
request to the origin search engine.</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.Engine.shortcut">
<span class="sig-name descname"><span class="pre">shortcut</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><span class="pre">str</span></a></em><a class="headerlink" href="#searx.enginelib.Engine.shortcut" title="Permalink to this definition"></a></dt>
<dd><p>Code used to execute bang requests (<code class="docutils literal notranslate"><span class="pre">!foo</span></code>)</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.Engine.time_range_support">
<span class="sig-name descname"><span class="pre">time_range_support</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.11)"><span class="pre">bool</span></a></em><a class="headerlink" href="#searx.enginelib.Engine.time_range_support" title="Permalink to this definition"></a></dt>
<dd><p>Engine supports search time range.</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.Engine.timeout">
<span class="sig-name descname"><span class="pre">timeout</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.11)"><span class="pre">float</span></a></em><a class="headerlink" href="#searx.enginelib.Engine.timeout" title="Permalink to this definition"></a></dt>
<dd><p>Specific timeout for search-engine.</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.Engine.tokens">
<span class="sig-name descname"><span class="pre">tokens</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/typing.html#typing.List" title="(in Python v3.11)"><span class="pre">List</span></a><span class="p"><span class="pre">[</span></span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><span class="pre">str</span></a><span class="p"><span class="pre">]</span></span></em><a class="headerlink" href="#searx.enginelib.Engine.tokens" title="Permalink to this definition"></a></dt>
<dd><p>A list of secret tokens to make this engine <em>private</em>, more details see
<a class="reference internal" href="../../admin/settings/settings_engine.html#private-engines"><span class="std std-ref">Private Engines (tokens)</span></a>.</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.Engine.traits">
<span class="sig-name descname"><span class="pre">traits</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference internal" href="#searx.enginelib.traits.EngineTraits" title="searx.enginelib.traits.EngineTraits"><span class="pre">EngineTraits</span></a></em><a class="headerlink" href="#searx.enginelib.Engine.traits" title="Permalink to this definition"></a></dt>
<dd><p>Traits of the engine.</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.Engine.using_tor_proxy">
<span class="sig-name descname"><span class="pre">using_tor_proxy</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.11)"><span class="pre">bool</span></a></em><a class="headerlink" href="#searx.enginelib.Engine.using_tor_proxy" title="Permalink to this definition"></a></dt>
<dd><p>Using tor proxy (<code class="docutils literal notranslate"><span class="pre">true</span></code>) or not (<code class="docutils literal notranslate"><span class="pre">false</span></code>) for this engine.</p>
</dd></dl>
</dd></dl>
<section id="module-searx.enginelib.traits">
<span id="engine-traits"></span><span id="searx-enginelib-traits"></span><h2><a class="toc-backref" href="#id1" role="doc-backlink">Engine traits</a><a class="headerlink" href="#module-searx.enginelib.traits" title="Permalink to this heading"></a></h2>
<p>Engines traits are fetched from the origin engines and stored in a JSON file
in the <em>data folder</em>. Most often traits are languages and region codes and
their mapping from SearXNGs representation to the representation in the origin
search engine. For new traits new properties can be added to the class
<a class="reference internal" href="#searx.enginelib.traits.EngineTraits" title="searx.enginelib.traits.EngineTraits"><code class="xref py py-class docutils literal notranslate"><span class="pre">EngineTraits</span></code></a>.</p>
<p>To load traits from the persistence <a class="reference internal" href="#searx.enginelib.traits.EngineTraitsMap.from_data" title="searx.enginelib.traits.EngineTraitsMap.from_data"><code class="xref py py-obj docutils literal notranslate"><span class="pre">EngineTraitsMap.from_data</span></code></a> can be
used.</p>
<dl class="py class">
<dt class="sig sig-object py" id="searx.enginelib.traits.EngineTraits">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">searx.enginelib.traits.</span></span><span class="sig-name descname"><span class="pre">EngineTraits</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">regions:</span> <span class="pre">~typing.Dict[str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">str]</span> <span class="pre">=</span> <span class="pre">&lt;factory&gt;</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">languages:</span> <span class="pre">~typing.Dict[str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">str]</span> <span class="pre">=</span> <span class="pre">&lt;factory&gt;</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">all_locale:</span> <span class="pre">str</span> <span class="pre">|</span> <span class="pre">None</span> <span class="pre">=</span> <span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">data_type:</span> <span class="pre">typing_extensions.Literal[traits_v1]</span> <span class="pre">=</span> <span class="pre">'traits_v1'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">custom:</span> <span class="pre">~typing.Dict[str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">~typing.Dict[str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">~typing.Dict]</span> <span class="pre">|</span> <span class="pre">~typing.Iterable[str]]</span> <span class="pre">=</span> <span class="pre">&lt;factory&gt;</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../_modules/searx/enginelib/traits.html#EngineTraits"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.enginelib.traits.EngineTraits" title="Permalink to this definition"></a></dt>
<dd><p>The class is intended to be instantiated for each engine.</p>
<dl class="py method">
<dt class="sig sig-object py" id="searx.enginelib.traits.EngineTraits.copy">
<span class="sig-name descname"><span class="pre">copy</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../../_modules/searx/enginelib/traits.html#EngineTraits.copy"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.enginelib.traits.EngineTraits.copy" title="Permalink to this definition"></a></dt>
<dd><p>Create a copy of the dataclass object.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="searx.enginelib.traits.EngineTraits.fetch_traits">
<em class="property"><span class="pre">classmethod</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">fetch_traits</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">engine</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="#searx.enginelib.Engine" title="searx.enginelib.Engine"><span class="pre">Engine</span></a></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">Self</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.11)"><span class="pre">None</span></a></span></span><a class="reference internal" href="../../_modules/searx/enginelib/traits.html#EngineTraits.fetch_traits"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.enginelib.traits.EngineTraits.fetch_traits" title="Permalink to this definition"></a></dt>
<dd><p>Call a function <code class="docutils literal notranslate"><span class="pre">fetch_traits(engine_traits)</span></code> from engines namespace to fetch
and set properties from the origin engine in the object <code class="docutils literal notranslate"><span class="pre">engine_traits</span></code>. If
function does not exists, <code class="docutils literal notranslate"><span class="pre">None</span></code> is returned.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="searx.enginelib.traits.EngineTraits.get_language">
<span class="sig-name descname"><span class="pre">get_language</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">searxng_locale</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><span class="pre">str</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">default</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../_modules/searx/enginelib/traits.html#EngineTraits.get_language"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.enginelib.traits.EngineTraits.get_language" title="Permalink to this definition"></a></dt>
<dd><p>Return engines language string that <em>best fits</em> to SearXNGs locale.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>searxng_locale</strong> SearXNGs internal representation of locale
selected by the user.</p></li>
<li><p><strong>default</strong> engines default language</p></li>
</ul>
</dd>
</dl>
<p>The <em>best fits</em> rules are implemented in
<a class="reference internal" href="../../src/searx.locales.html#searx.locales.get_engine_locale" title="searx.locales.get_engine_locale"><code class="xref py py-obj docutils literal notranslate"><span class="pre">searx.locales.get_engine_locale</span></code></a>. Except for the special value <code class="docutils literal notranslate"><span class="pre">all</span></code>
which is determined from <a class="reference internal" href="#searx.enginelib.traits.EngineTraits.all_locale" title="searx.enginelib.traits.EngineTraits.all_locale"><code class="xref py py-obj docutils literal notranslate"><span class="pre">EngineTraits.all_locale</span></code></a>.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="searx.enginelib.traits.EngineTraits.get_region">
<span class="sig-name descname"><span class="pre">get_region</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">searxng_locale</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><span class="pre">str</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">default</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../_modules/searx/enginelib/traits.html#EngineTraits.get_region"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.enginelib.traits.EngineTraits.get_region" title="Permalink to this definition"></a></dt>
<dd><p>Return engines region string that best fits to SearXNGs locale.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>searxng_locale</strong> SearXNGs internal representation of locale
selected by the user.</p></li>
<li><p><strong>default</strong> engines default region</p></li>
</ul>
</dd>
</dl>
<p>The <em>best fits</em> rules are implemented in
<a class="reference internal" href="../../src/searx.locales.html#searx.locales.get_engine_locale" title="searx.locales.get_engine_locale"><code class="xref py py-obj docutils literal notranslate"><span class="pre">searx.locales.get_engine_locale</span></code></a>. Except for the special value <code class="docutils literal notranslate"><span class="pre">all</span></code>
which is determined from <a class="reference internal" href="#searx.enginelib.traits.EngineTraits.all_locale" title="searx.enginelib.traits.EngineTraits.all_locale"><code class="xref py py-obj docutils literal notranslate"><span class="pre">EngineTraits.all_locale</span></code></a>.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="searx.enginelib.traits.EngineTraits.is_locale_supported">
<span class="sig-name descname"><span class="pre">is_locale_supported</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">searxng_locale</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><span class="pre">str</span></a></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.11)"><span class="pre">bool</span></a></span></span><a class="reference internal" href="../../_modules/searx/enginelib/traits.html#EngineTraits.is_locale_supported"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.enginelib.traits.EngineTraits.is_locale_supported" title="Permalink to this definition"></a></dt>
<dd><p>A <em>locale</em> (SearXNGs internal representation) is considered to be
supported by the engine if the <em>region</em> or the <em>language</em> is supported
by the engine.</p>
<p>For verification the functions <a class="reference internal" href="#searx.enginelib.traits.EngineTraits.get_region" title="searx.enginelib.traits.EngineTraits.get_region"><code class="xref py py-func docutils literal notranslate"><span class="pre">EngineTraits.get_region()</span></code></a> and
<a class="reference internal" href="#searx.enginelib.traits.EngineTraits.get_language" title="searx.enginelib.traits.EngineTraits.get_language"><code class="xref py py-func docutils literal notranslate"><span class="pre">EngineTraits.get_language()</span></code></a> are used.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="searx.enginelib.traits.EngineTraits.set_traits">
<span class="sig-name descname"><span class="pre">set_traits</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">engine</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="#searx.enginelib.Engine" title="searx.enginelib.Engine"><span class="pre">Engine</span></a></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../_modules/searx/enginelib/traits.html#EngineTraits.set_traits"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.enginelib.traits.EngineTraits.set_traits" title="Permalink to this definition"></a></dt>
<dd><p>Set traits from self object in a <a class="reference internal" href="#searx.enginelib.Engine" title="searx.enginelib.Engine"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Engine</span></code></a> namespace.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>engine</strong> engine instance build by <a class="reference internal" href="engines.html#searx.engines.load_engine" title="searx.engines.load_engine"><code class="xref py py-func docutils literal notranslate"><span class="pre">searx.engines.load_engine()</span></code></a></p>
</dd>
</dl>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.traits.EngineTraits.all_locale">
<span class="sig-name descname"><span class="pre">all_locale</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><span class="pre">str</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.11)"><span class="pre">None</span></a></em><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">None</span></em><a class="headerlink" href="#searx.enginelib.traits.EngineTraits.all_locale" title="Permalink to this definition"></a></dt>
<dd><p>To which locale value SearXNGs <code class="docutils literal notranslate"><span class="pre">all</span></code> language is mapped (shown a “Default
language”).</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.traits.EngineTraits.custom">
<span class="sig-name descname"><span class="pre">custom</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/typing.html#typing.Dict" title="(in Python v3.11)"><span class="pre">Dict</span></a><span class="p"><span class="pre">[</span></span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><span class="pre">str</span></a><span class="p"><span class="pre">,</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/typing.html#typing.Dict" title="(in Python v3.11)"><span class="pre">Dict</span></a><span class="p"><span class="pre">[</span></span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><span class="pre">str</span></a><span class="p"><span class="pre">,</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/typing.html#typing.Dict" title="(in Python v3.11)"><span class="pre">Dict</span></a><span class="p"><span class="pre">]</span></span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/typing.html#typing.Iterable" title="(in Python v3.11)"><span class="pre">Iterable</span></a><span class="p"><span class="pre">[</span></span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><span class="pre">str</span></a><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span></em><a class="headerlink" href="#searx.enginelib.traits.EngineTraits.custom" title="Permalink to this definition"></a></dt>
<dd><p>A place to store engines custom traits, not related to the SearXNG core.</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.traits.EngineTraits.data_type">
<span class="sig-name descname"><span class="pre">data_type</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="pre">typing_extensions.Literal</span><span class="p"><span class="pre">[</span></span><span class="pre">traits_v1</span><span class="p"><span class="pre">]</span></span></em><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'traits_v1'</span></em><a class="headerlink" href="#searx.enginelib.traits.EngineTraits.data_type" title="Permalink to this definition"></a></dt>
<dd><p>Data type, default is traits_v1.</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.traits.EngineTraits.languages">
<span class="sig-name descname"><span class="pre">languages</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/typing.html#typing.Dict" title="(in Python v3.11)"><span class="pre">Dict</span></a><span class="p"><span class="pre">[</span></span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><span class="pre">str</span></a><span class="p"><span class="pre">,</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><span class="pre">str</span></a><span class="p"><span class="pre">]</span></span></em><a class="headerlink" href="#searx.enginelib.traits.EngineTraits.languages" title="Permalink to this definition"></a></dt>
<dd><p>Maps SearXNGs internal representation of a language to the one of the engine.</p>
<p>SearXNGs internal representation can be parsed by babel and the value is
send to the engine:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">languages</span> <span class="o">=</span> <span class="p">{</span>
<span class="s1">&#39;ca&#39;</span> <span class="p">:</span> <span class="o">&lt;</span><span class="n">engine</span><span class="s1">&#39;s language name&gt;,</span>
<span class="p">}</span>
<span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">egnine_lang</span> <span class="ow">in</span> <span class="n">languages</span><span class="o">.</span><span class="n">items</span><span class="p">():</span>
<span class="n">searxng_lang</span> <span class="o">=</span> <span class="n">babel</span><span class="o">.</span><span class="n">Locale</span><span class="o">.</span><span class="n">parse</span><span class="p">(</span><span class="n">key</span><span class="p">)</span>
<span class="o">...</span>
</pre></div>
</div>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.traits.EngineTraits.regions">
<span class="sig-name descname"><span class="pre">regions</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/typing.html#typing.Dict" title="(in Python v3.11)"><span class="pre">Dict</span></a><span class="p"><span class="pre">[</span></span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><span class="pre">str</span></a><span class="p"><span class="pre">,</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><span class="pre">str</span></a><span class="p"><span class="pre">]</span></span></em><a class="headerlink" href="#searx.enginelib.traits.EngineTraits.regions" title="Permalink to this definition"></a></dt>
<dd><p>Maps SearXNGs internal representation of a region to the one of the engine.</p>
<p>SearXNGs internal representation can be parsed by babel and the value is
send to the engine:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">regions</span> <span class="o">=</span><span class="p">{</span>
<span class="s1">&#39;fr-BE&#39;</span> <span class="p">:</span> <span class="o">&lt;</span><span class="n">engine</span><span class="s1">&#39;s region name&gt;,</span>
<span class="p">}</span>
<span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">egnine_region</span> <span class="n">regions</span><span class="o">.</span><span class="n">items</span><span class="p">():</span>
<span class="n">searxng_region</span> <span class="o">=</span> <span class="n">babel</span><span class="o">.</span><span class="n">Locale</span><span class="o">.</span><span class="n">parse</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="n">sep</span><span class="o">=</span><span class="s1">&#39;-&#39;</span><span class="p">)</span>
<span class="o">...</span>
</pre></div>
</div>
</dd></dl>
</dd></dl>
<dl class="py class">
<dt class="sig sig-object py" id="searx.enginelib.traits.EngineTraitsEncoder">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">searx.enginelib.traits.</span></span><span class="sig-name descname"><span class="pre">EngineTraitsEncoder</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">skipkeys</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ensure_ascii</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">check_circular</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">allow_nan</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sort_keys</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">indent</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">separators</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">default</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../_modules/searx/enginelib/traits.html#EngineTraitsEncoder"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.enginelib.traits.EngineTraitsEncoder" title="Permalink to this definition"></a></dt>
<dd><p>Encodes <a class="reference internal" href="#searx.enginelib.traits.EngineTraits" title="searx.enginelib.traits.EngineTraits"><code class="xref py py-class docutils literal notranslate"><span class="pre">EngineTraits</span></code></a> to a serializable object, see
<a class="reference external" href="https://docs.python.org/3/library/json.html#json.JSONEncoder" title="(in Python v3.11)"><code class="xref py py-class docutils literal notranslate"><span class="pre">json.JSONEncoder</span></code></a>.</p>
<dl class="py method">
<dt class="sig sig-object py" id="searx.enginelib.traits.EngineTraitsEncoder.default">
<span class="sig-name descname"><span class="pre">default</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">o</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../_modules/searx/enginelib/traits.html#EngineTraitsEncoder.default"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.enginelib.traits.EngineTraitsEncoder.default" title="Permalink to this definition"></a></dt>
<dd><p>Return dictionary of a <a class="reference internal" href="#searx.enginelib.traits.EngineTraits" title="searx.enginelib.traits.EngineTraits"><code class="xref py py-class docutils literal notranslate"><span class="pre">EngineTraits</span></code></a> object.</p>
</dd></dl>
</dd></dl>
<dl class="py class">
<dt class="sig sig-object py" id="searx.enginelib.traits.EngineTraitsMap">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">searx.enginelib.traits.</span></span><span class="sig-name descname"><span class="pre">EngineTraitsMap</span></span><a class="reference internal" href="../../_modules/searx/enginelib/traits.html#EngineTraitsMap"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.enginelib.traits.EngineTraitsMap" title="Permalink to this definition"></a></dt>
<dd><p>A python dictionary to map <a class="reference internal" href="#searx.enginelib.traits.EngineTraits" title="searx.enginelib.traits.EngineTraits"><code class="xref py py-class docutils literal notranslate"><span class="pre">EngineTraits</span></code></a> by engine name.</p>
<dl class="py method">
<dt class="sig sig-object py" id="searx.enginelib.traits.EngineTraitsMap.from_data">
<em class="property"><span class="pre">classmethod</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">from_data</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">Self</span></span></span><a class="reference internal" href="../../_modules/searx/enginelib/traits.html#EngineTraitsMap.from_data"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.enginelib.traits.EngineTraitsMap.from_data" title="Permalink to this definition"></a></dt>
<dd><p>Instantiate <a class="reference internal" href="#searx.enginelib.traits.EngineTraitsMap" title="searx.enginelib.traits.EngineTraitsMap"><code class="xref py py-class docutils literal notranslate"><span class="pre">EngineTraitsMap</span></code></a> object from <code class="xref py py-obj docutils literal notranslate"><span class="pre">ENGINE_TRAITS</span></code></p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="searx.enginelib.traits.EngineTraitsMap.save_data">
<span class="sig-name descname"><span class="pre">save_data</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../../_modules/searx/enginelib/traits.html#EngineTraitsMap.save_data"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.enginelib.traits.EngineTraitsMap.save_data" title="Permalink to this definition"></a></dt>
<dd><p>Store EngineTraitsMap in in file <code class="xref py py-obj docutils literal notranslate"><span class="pre">self.ENGINE_TRAITS_FILE</span></code></p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="searx.enginelib.traits.EngineTraitsMap.set_traits">
<span class="sig-name descname"><span class="pre">set_traits</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">engine</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="#searx.enginelib.Engine" title="searx.enginelib.Engine"><span class="pre">Engine</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/types.html#types.ModuleType" title="(in Python v3.11)"><span class="pre">types.ModuleType</span></a></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../_modules/searx/enginelib/traits.html#EngineTraitsMap.set_traits"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.enginelib.traits.EngineTraitsMap.set_traits" title="Permalink to this definition"></a></dt>
<dd><p>Set traits in a <code class="xref py py-obj docutils literal notranslate"><span class="pre">Engine</span></code> namespace.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>engine</strong> engine instance build by <a class="reference internal" href="engines.html#searx.engines.load_engine" title="searx.engines.load_engine"><code class="xref py py-func docutils literal notranslate"><span class="pre">searx.engines.load_engine()</span></code></a></p>
</dd>
</dl>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.traits.EngineTraitsMap.ENGINE_TRAITS_FILE">
<span class="sig-name descname"><span class="pre">ENGINE_TRAITS_FILE</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">PosixPath('/home/runner/work/searxng/searxng/searx/data/engine_traits.json')</span></em><a class="headerlink" href="#searx.enginelib.traits.EngineTraitsMap.ENGINE_TRAITS_FILE" title="Permalink to this definition"></a></dt>
<dd><p>File with persistence of the <a class="reference internal" href="#searx.enginelib.traits.EngineTraitsMap" title="searx.enginelib.traits.EngineTraitsMap"><code class="xref py py-obj docutils literal notranslate"><span class="pre">EngineTraitsMap</span></code></a>.</p>
</dd></dl>
</dd></dl>
</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/searxng-wordmark.svg" alt="Logo"/>
</a></p>
<h3><a href="../../index.html">Table of Contents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../user/index.html">User information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../own-instance.html">Why use a private instance?</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../admin/index.html">Administrator documentation</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../index.html">Developer documentation</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../quickstart.html">Development Quickstart</a></li>
<li class="toctree-l2"><a class="reference internal" href="../contribution_guide.html">How to contribute</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="index.html">Engine Implementations</a></li>
<li class="toctree-l2"><a class="reference internal" href="../search_api.html">Search API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../plugins.html">Plugins</a></li>
<li class="toctree-l2"><a class="reference internal" href="../translation.html">Translation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../lxcdev.html">Developing in Linux Containers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../makefile.html">Makefile &amp; <code class="docutils literal notranslate"><span class="pre">./manage</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../reST.html">reST primer</a></li>
<li class="toctree-l2"><a class="reference internal" href="../searxng_extra/index.html">Tooling box <code class="docutils literal notranslate"><span class="pre">searxng_extra</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../utils/index.html">DevOps tooling box</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../src/index.html">Source-Code</a></li>
</ul>
<h3>Project Links</h3>
<ul>
<li><a href="https://github.com/searxng/searxng/tree/master">Source</a>
<li><a href="https://github.com/searxng/searxng/wiki">Wiki</a>
<li><a href="https://searx.space">Public instances</a>
<li><a href="https://github.com/searxng/searxng/issues">Issue Tracker</a>
</ul><h3>Navigation</h3>
<ul>
<li><a href="../../index.html">Overview</a>
<ul>
<li><a href="../index.html">Developer documentation</a>
<ul>
<li><a href="index.html">Engine Implementations</a>
<ul>
<li>Previous: <a href="index.html" title="previous chapter">Engine Implementations</a>
<li>Next: <a href="engines.html" title="next chapter">SearXNGs engines loader</a></ul>
</li></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 role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../_sources/dev/engines/enginelib.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright SearXNG team.
</div>
<script src="../../_static/version_warning_offset.js"></script>
</body>
</html>

204
dev/engines/engines.html Normal file
View file

@ -0,0 +1,204 @@
<!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>SearXNGs engines loader &#8212; SearXNG Documentation (2023.8.11+905ce2a6f)</title>
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=4f649999" />
<link rel="stylesheet" type="text/css" href="../../_static/searxng.css?v=52e4ff28" />
<link rel="stylesheet" type="text/css" href="../../_static/tabs.css?v=a5c4661c" />
<script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js?v=3c88bde0"></script>
<script src="../../_static/doctools.js?v=888ff710"></script>
<script src="../../_static/sphinx_highlight.js?v=4825356b"></script>
<link rel="index" title="Index" href="../../genindex.html" />
<link rel="search" title="Search" href="../../search.html" />
<link rel="next" title="Engine Overview" href="engine_overview.html" />
<link rel="prev" title="Engine Library" href="enginelib.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="engine_overview.html" title="Engine Overview"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="enginelib.html" title="Engine Library"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../../index.html">SearXNG Documentation (2023.8.11+905ce2a6f)</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../index.html" >Developer documentation</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="index.html" accesskey="U">Engine Implementations</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">SearXNGs engines loader</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="module-searx.engines">
<span id="searxng-s-engines-loader"></span><span id="searx-engines-loader"></span><h1>SearXNGs engines loader<a class="headerlink" href="#module-searx.engines" title="Permalink to this heading"></a></h1>
<p>Load and initialize the <code class="docutils literal notranslate"><span class="pre">engines</span></code>, see <a class="reference internal" href="#searx.engines.load_engines" title="searx.engines.load_engines"><code class="xref py py-func docutils literal notranslate"><span class="pre">load_engines()</span></code></a> and register
<a class="reference internal" href="#searx.engines.engine_shortcuts" title="searx.engines.engine_shortcuts"><code class="xref py py-obj docutils literal notranslate"><span class="pre">engine_shortcuts</span></code></a>.</p>
<p>usage:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">load_engines</span><span class="p">(</span> <span class="n">settings</span><span class="p">[</span><span class="s1">&#39;engines&#39;</span><span class="p">]</span> <span class="p">)</span>
</pre></div>
</div>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.is_missing_required_attributes">
<span class="sig-prename descclassname"><span class="pre">searx.engines.</span></span><span class="sig-name descname"><span class="pre">is_missing_required_attributes</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">engine</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../_modules/searx/engines.html#is_missing_required_attributes"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.is_missing_required_attributes" title="Permalink to this definition"></a></dt>
<dd><p>An attribute is required when its name doesnt start with <code class="docutils literal notranslate"><span class="pre">_</span></code> (underline).
Required attributes must not be <code class="docutils literal notranslate"><span class="pre">None</span></code>.</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.load_engine">
<span class="sig-prename descclassname"><span class="pre">searx.engines.</span></span><span class="sig-name descname"><span class="pre">load_engine</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">engine_data</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.11)"><span class="pre">dict</span></a></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference internal" href="enginelib.html#searx.enginelib.Engine" title="searx.enginelib.Engine"><span class="pre">Engine</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/types.html#types.ModuleType" title="(in Python v3.11)"><span class="pre">types.ModuleType</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.11)"><span class="pre">None</span></a></span></span><a class="reference internal" href="../../_modules/searx/engines.html#load_engine"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.load_engine" title="Permalink to this definition"></a></dt>
<dd><p>Load engine from <code class="docutils literal notranslate"><span class="pre">engine_data</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>engine_data</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.11)"><em>dict</em></a>) Attributes from YAML <code class="docutils literal notranslate"><span class="pre">settings:engines/&lt;engine&gt;</span></code></p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>initialized namespace of the <code class="docutils literal notranslate"><span class="pre">&lt;engine&gt;</span></code>.</p>
</dd>
</dl>
<ol class="arabic simple">
<li><p>create a namespace and load module of the <code class="docutils literal notranslate"><span class="pre">&lt;engine&gt;</span></code></p></li>
<li><p>update namespace with the defaults from <code class="xref py py-obj docutils literal notranslate"><span class="pre">ENGINE_DEFAULT_ARGS</span></code></p></li>
<li><p>update namespace with values from <code class="docutils literal notranslate"><span class="pre">engine_data</span></code></p></li>
</ol>
<p>If engine <em>is active</em>, return namespace of the engine, otherwise return
<code class="docutils literal notranslate"><span class="pre">None</span></code>.</p>
<p>This function also returns <code class="docutils literal notranslate"><span class="pre">None</span></code> if initialization of the namespace fails
for one of the following reasons:</p>
<ul class="simple">
<li><p>engine name contains underscore</p></li>
<li><p>engine name is not lowercase</p></li>
<li><p>required attribute is not set <a class="reference internal" href="#searx.engines.is_missing_required_attributes" title="searx.engines.is_missing_required_attributes"><code class="xref py py-func docutils literal notranslate"><span class="pre">is_missing_required_attributes()</span></code></a></p></li>
</ul>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.load_engines">
<span class="sig-prename descclassname"><span class="pre">searx.engines.</span></span><span class="sig-name descname"><span class="pre">load_engines</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">engine_list</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../_modules/searx/engines.html#load_engines"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.load_engines" title="Permalink to this definition"></a></dt>
<dd><p>usage: <code class="docutils literal notranslate"><span class="pre">engine_list</span> <span class="pre">=</span> <span class="pre">settings['engines']</span></code></p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.using_tor_proxy">
<span class="sig-prename descclassname"><span class="pre">searx.engines.</span></span><span class="sig-name descname"><span class="pre">using_tor_proxy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">engine</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="enginelib.html#searx.enginelib.Engine" title="searx.enginelib.Engine"><span class="pre">Engine</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/types.html#types.ModuleType" title="(in Python v3.11)"><span class="pre">types.ModuleType</span></a></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../_modules/searx/engines.html#using_tor_proxy"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.using_tor_proxy" title="Permalink to this definition"></a></dt>
<dd><p>Return True if the engine configuration declares to use Tor.</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.engine_shortcuts">
<span class="sig-prename descclassname"><span class="pre">searx.engines.</span></span><span class="sig-name descname"><span class="pre">engine_shortcuts</span></span><a class="headerlink" href="#searx.engines.engine_shortcuts" title="Permalink to this definition"></a></dt>
<dd><p>Simple map of registered <em>shortcuts</em> to name of the engine (or <code class="docutils literal notranslate"><span class="pre">None</span></code>).</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">engine_shortcuts</span><span class="p">[</span><span class="n">engine</span><span class="o">.</span><span class="n">shortcut</span><span class="p">]</span> <span class="o">=</span> <span class="n">engine</span><span class="o">.</span><span class="n">name</span>
</pre></div>
</div>
<dl class="field-list simple">
</dl>
</dd></dl>
</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/searxng-wordmark.svg" alt="Logo"/>
</a></p>
<h3><a href="../../index.html">Table of Contents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../user/index.html">User information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../own-instance.html">Why use a private instance?</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../admin/index.html">Administrator documentation</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../index.html">Developer documentation</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../quickstart.html">Development Quickstart</a></li>
<li class="toctree-l2"><a class="reference internal" href="../contribution_guide.html">How to contribute</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="index.html">Engine Implementations</a></li>
<li class="toctree-l2"><a class="reference internal" href="../search_api.html">Search API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../plugins.html">Plugins</a></li>
<li class="toctree-l2"><a class="reference internal" href="../translation.html">Translation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../lxcdev.html">Developing in Linux Containers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../makefile.html">Makefile &amp; <code class="docutils literal notranslate"><span class="pre">./manage</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../reST.html">reST primer</a></li>
<li class="toctree-l2"><a class="reference internal" href="../searxng_extra/index.html">Tooling box <code class="docutils literal notranslate"><span class="pre">searxng_extra</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../utils/index.html">DevOps tooling box</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../src/index.html">Source-Code</a></li>
</ul>
<h3>Project Links</h3>
<ul>
<li><a href="https://github.com/searxng/searxng/tree/master">Source</a>
<li><a href="https://github.com/searxng/searxng/wiki">Wiki</a>
<li><a href="https://searx.space">Public instances</a>
<li><a href="https://github.com/searxng/searxng/issues">Issue Tracker</a>
</ul><h3>Navigation</h3>
<ul>
<li><a href="../../index.html">Overview</a>
<ul>
<li><a href="../index.html">Developer documentation</a>
<ul>
<li><a href="index.html">Engine Implementations</a>
<ul>
<li>Previous: <a href="enginelib.html" title="previous chapter">Engine Library</a>
<li>Next: <a href="engine_overview.html" title="next chapter">Engine Overview</a></ul>
</li></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 role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../_sources/dev/engines/engines.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright SearXNG team.
</div>
<script src="../../_static/version_warning_offset.js"></script>
</body>
</html>

273
dev/engines/index.html Normal file
View file

@ -0,0 +1,273 @@
<!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>Engine Implementations &#8212; SearXNG Documentation (2023.8.11+905ce2a6f)</title>
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=4f649999" />
<link rel="stylesheet" type="text/css" href="../../_static/searxng.css?v=52e4ff28" />
<link rel="stylesheet" type="text/css" href="../../_static/tabs.css?v=a5c4661c" />
<script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js?v=3c88bde0"></script>
<script src="../../_static/doctools.js?v=888ff710"></script>
<script src="../../_static/sphinx_highlight.js?v=4825356b"></script>
<link rel="index" title="Index" href="../../genindex.html" />
<link rel="search" title="Search" href="../../search.html" />
<link rel="next" title="Engine Library" href="enginelib.html" />
<link rel="prev" title="How to contribute" href="../contribution_guide.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="enginelib.html" title="Engine Library"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="../contribution_guide.html" title="How to contribute"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../../index.html">SearXNG Documentation (2023.8.11+905ce2a6f)</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../index.html" accesskey="U">Developer documentation</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Engine Implementations</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="engine-implementations">
<span id="id1"></span><h1>Engine Implementations<a class="headerlink" href="#engine-implementations" title="Permalink to this heading"></a></h1>
<nav class="contents local" id="contents">
<ul class="simple">
<li><p><a class="reference internal" href="#engine-types" id="id7">Engine Types</a></p>
<ul>
<li><p><a class="reference internal" href="#online-engines" id="id8">Online Engines</a></p></li>
<li><p><a class="reference internal" href="#offline-engines" id="id9">Offline Engines</a></p></li>
<li><p><a class="reference internal" href="#online-url-search" id="id10">Online URL Search</a></p></li>
<li><p><a class="reference internal" href="#online-currency" id="id11">Online Currency</a></p></li>
<li><p><a class="reference internal" href="#online-dictionary" id="id12">Online Dictionary</a></p></li>
</ul>
</li>
</ul>
</nav>
<div class="toctree-wrapper compound">
<p class="caption" role="heading"><span class="caption-text">Framework Components</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="enginelib.html">Engine Library</a><ul>
<li class="toctree-l2"><a class="reference internal" href="enginelib.html#searx.enginelib.Engine"><code class="docutils literal notranslate"><span class="pre">Engine</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="enginelib.html#module-searx.enginelib.traits">Engine traits</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="engines.html">SearXNGs engines loader</a><ul>
<li class="toctree-l2"><a class="reference internal" href="engines.html#searx.engines.is_missing_required_attributes"><code class="docutils literal notranslate"><span class="pre">is_missing_required_attributes()</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="engines.html#searx.engines.load_engine"><code class="docutils literal notranslate"><span class="pre">load_engine()</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="engines.html#searx.engines.load_engines"><code class="docutils literal notranslate"><span class="pre">load_engines()</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="engines.html#searx.engines.using_tor_proxy"><code class="docutils literal notranslate"><span class="pre">using_tor_proxy()</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="engines.html#searx.engines.engine_shortcuts"><code class="docutils literal notranslate"><span class="pre">engine_shortcuts</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="engine_overview.html">Engine Overview</a><ul>
<li class="toctree-l2"><a class="reference internal" href="engine_overview.html#general-engine-configuration">General Engine Configuration</a></li>
<li class="toctree-l2"><a class="reference internal" href="engine_overview.html#making-a-request">Making a Request</a></li>
<li class="toctree-l2"><a class="reference internal" href="engine_overview.html#result-types-template">Result Types (<code class="docutils literal notranslate"><span class="pre">template</span></code>)</a></li>
</ul>
</li>
</ul>
</div>
<section id="engine-types">
<h2><a class="toc-backref" href="#id7" role="doc-backlink">Engine Types</a><a class="headerlink" href="#engine-types" title="Permalink to this heading"></a></h2>
<p>The <a class="reference internal" href="enginelib.html#searx.enginelib.Engine.engine_type" title="searx.enginelib.Engine.engine_type"><code class="xref py py-obj docutils literal notranslate"><span class="pre">engine_type</span></code></a> of an engine
determines which <a class="reference internal" href="../../src/searx.search.processors.html#searx-search-processors"><span class="std std-ref">search processor</span></a> is used by
the engine.</p>
<p>In this section a list of the enignes that are documented is given, a complete
list of the engines can be found in the source under: <a class="reference external" href="https://github.com/searxng/searxng/blob/master/searx/engines">git://searx/engines</a>.</p>
<section id="online-engines">
<span id="id2"></span><h3><a class="toc-backref" href="#id8" role="doc-backlink">Online Engines</a><a class="headerlink" href="#online-engines" title="Permalink to this heading"></a></h3>
<aside class="sidebar">
<p class="sidebar-title">info</p>
<ul class="simple">
<li><p><a class="reference internal" href="../../src/searx.search.processors.html#module-searx.search.processors.online" title="searx.search.processors.online"><code class="xref py py-obj docutils literal notranslate"><span class="pre">processors.online</span></code></a></p></li>
</ul>
</aside>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="demo/demo_online.html">Demo Online Engine</a></li>
<li class="toctree-l1"><a class="reference internal" href="xpath.html">XPath Engine</a></li>
<li class="toctree-l1"><a class="reference internal" href="mediawiki.html">MediaWiki Engine</a></li>
</ul>
</div>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="online/annas_archive.html">Annas Archive</a></li>
<li class="toctree-l1"><a class="reference internal" href="online/archlinux.html">Arch Linux</a></li>
<li class="toctree-l1"><a class="reference internal" href="online/bing.html">Bing Engines</a></li>
<li class="toctree-l1"><a class="reference internal" href="online/brave.html">Brave Engines</a></li>
<li class="toctree-l1"><a class="reference internal" href="online/bt4g.html">BT4G</a></li>
<li class="toctree-l1"><a class="reference internal" href="online/dailymotion.html">Dailymotion</a></li>
<li class="toctree-l1"><a class="reference internal" href="online/duckduckgo.html">DukcDukGo Engines</a></li>
<li class="toctree-l1"><a class="reference internal" href="online/google.html">Google Engines</a></li>
<li class="toctree-l1"><a class="reference internal" href="online/lemmy.html">Lemmy</a></li>
<li class="toctree-l1"><a class="reference internal" href="online/peertube.html">Peertube Engines</a></li>
<li class="toctree-l1"><a class="reference internal" href="online/piped.html">Piped</a></li>
<li class="toctree-l1"><a class="reference internal" href="online/recoll.html">Recoll Engine</a></li>
<li class="toctree-l1"><a class="reference internal" href="online/startpage.html">Startpage Engines</a></li>
<li class="toctree-l1"><a class="reference internal" href="online/tagesschau.html">Tagesschau API</a></li>
<li class="toctree-l1"><a class="reference internal" href="online/torznab.html">Torznab WebAPI</a></li>
<li class="toctree-l1"><a class="reference internal" href="online/wikipedia.html">Wikimedia</a></li>
<li class="toctree-l1"><a class="reference internal" href="online/yacy.html">Yacy</a></li>
<li class="toctree-l1"><a class="reference internal" href="online/yahoo.html">Yahoo Engine</a></li>
<li class="toctree-l1"><a class="reference internal" href="online/zlibrary.html">Z-Library</a></li>
</ul>
</div>
</section>
<section id="offline-engines">
<span id="id3"></span><h3><a class="toc-backref" href="#id9" role="doc-backlink">Offline Engines</a><a class="headerlink" href="#offline-engines" title="Permalink to this heading"></a></h3>
<aside class="sidebar">
<p class="sidebar-title">info</p>
<ul class="simple">
<li><p><a class="reference internal" href="../../src/searx.search.processors.html#module-searx.search.processors.offline" title="searx.search.processors.offline"><code class="xref py py-obj docutils literal notranslate"><span class="pre">processors.offline</span></code></a></p></li>
</ul>
</aside>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="offline_concept.html">Offline Concept</a></li>
<li class="toctree-l1"><a class="reference internal" href="demo/demo_offline.html">Demo Offline Engine</a></li>
<li class="toctree-l1"><a class="reference internal" href="offline/command-line-engines.html">Command Line Engines</a></li>
<li class="toctree-l1"><a class="reference internal" href="offline/nosql-engines.html">NoSQL databases</a></li>
<li class="toctree-l1"><a class="reference internal" href="offline/search-indexer-engines.html">Local Search APIs</a></li>
<li class="toctree-l1"><a class="reference internal" href="offline/sql-engines.html">SQL Engines</a></li>
</ul>
</div>
</section>
<section id="online-url-search">
<span id="id4"></span><h3><a class="toc-backref" href="#id10" role="doc-backlink">Online URL Search</a><a class="headerlink" href="#online-url-search" title="Permalink to this heading"></a></h3>
<aside class="sidebar">
<p class="sidebar-title">info</p>
<ul class="simple">
<li><p><a class="reference internal" href="../../src/searx.search.processors.html#module-searx.search.processors.online_url_search" title="searx.search.processors.online_url_search"><code class="xref py py-obj docutils literal notranslate"><span class="pre">processors.online_url_search</span></code></a></p></li>
</ul>
</aside>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="online_url_search/tineye.html">Tineye</a></li>
</ul>
</div>
</section>
<section id="online-currency">
<span id="id5"></span><h3><a class="toc-backref" href="#id11" role="doc-backlink">Online Currency</a><a class="headerlink" href="#online-currency" title="Permalink to this heading"></a></h3>
<aside class="sidebar">
<p class="sidebar-title">info</p>
<ul class="simple">
<li><p><a class="reference internal" href="../../src/searx.search.processors.html#module-searx.search.processors.online_currency" title="searx.search.processors.online_currency"><code class="xref py py-obj docutils literal notranslate"><span class="pre">processors.online_currency</span></code></a></p></li>
</ul>
</aside>
<p><em>no engine of this type is documented yet / comming soon</em></p>
</section>
<section id="online-dictionary">
<span id="id6"></span><h3><a class="toc-backref" href="#id12" role="doc-backlink">Online Dictionary</a><a class="headerlink" href="#online-dictionary" title="Permalink to this heading"></a></h3>
<aside class="sidebar">
<p class="sidebar-title">info</p>
<ul class="simple">
<li><p><a class="reference internal" href="../../src/searx.search.processors.html#module-searx.search.processors.online_dictionary" title="searx.search.processors.online_dictionary"><code class="xref py py-obj docutils literal notranslate"><span class="pre">processors.online_dictionary</span></code></a></p></li>
</ul>
</aside>
<p><em>no engine of this type is documented yet / comming soon</em></p>
</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/searxng-wordmark.svg" alt="Logo"/>
</a></p>
<h3><a href="../../index.html">Table of Contents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../user/index.html">User information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../own-instance.html">Why use a private instance?</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../admin/index.html">Administrator documentation</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../index.html">Developer documentation</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../quickstart.html">Development Quickstart</a></li>
<li class="toctree-l2"><a class="reference internal" href="../contribution_guide.html">How to contribute</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">Engine Implementations</a></li>
<li class="toctree-l2"><a class="reference internal" href="../search_api.html">Search API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../plugins.html">Plugins</a></li>
<li class="toctree-l2"><a class="reference internal" href="../translation.html">Translation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../lxcdev.html">Developing in Linux Containers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../makefile.html">Makefile &amp; <code class="docutils literal notranslate"><span class="pre">./manage</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../reST.html">reST primer</a></li>
<li class="toctree-l2"><a class="reference internal" href="../searxng_extra/index.html">Tooling box <code class="docutils literal notranslate"><span class="pre">searxng_extra</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../utils/index.html">DevOps tooling box</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../src/index.html">Source-Code</a></li>
</ul>
<h3>Project Links</h3>
<ul>
<li><a href="https://github.com/searxng/searxng/tree/master">Source</a>
<li><a href="https://github.com/searxng/searxng/wiki">Wiki</a>
<li><a href="https://searx.space">Public instances</a>
<li><a href="https://github.com/searxng/searxng/issues">Issue Tracker</a>
</ul><h3>Navigation</h3>
<ul>
<li><a href="../../index.html">Overview</a>
<ul>
<li><a href="../index.html">Developer documentation</a>
<ul>
<li>Previous: <a href="../contribution_guide.html" title="previous chapter">How to contribute</a>
<li>Next: <a href="enginelib.html" title="next chapter">Engine Library</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 role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../_sources/dev/engines/index.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright SearXNG team.
</div>
<script src="../../_static/version_warning_offset.js"></script>
</body>
</html>

223
dev/engines/mediawiki.html Normal file
View file

@ -0,0 +1,223 @@
<!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>MediaWiki Engine &#8212; SearXNG Documentation (2023.8.11+905ce2a6f)</title>
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=4f649999" />
<link rel="stylesheet" type="text/css" href="../../_static/searxng.css?v=52e4ff28" />
<link rel="stylesheet" type="text/css" href="../../_static/tabs.css?v=a5c4661c" />
<script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js?v=3c88bde0"></script>
<script src="../../_static/doctools.js?v=888ff710"></script>
<script src="../../_static/sphinx_highlight.js?v=4825356b"></script>
<link rel="index" title="Index" href="../../genindex.html" />
<link rel="search" title="Search" href="../../search.html" />
<link rel="next" title="Annas Archive" href="online/annas_archive.html" />
<link rel="prev" title="XPath Engine" href="xpath.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="online/annas_archive.html" title="Annas Archive"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="xpath.html" title="XPath Engine"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../../index.html">SearXNG Documentation (2023.8.11+905ce2a6f)</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../index.html" >Developer documentation</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="index.html" accesskey="U">Engine Implementations</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">MediaWiki Engine</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="mediawiki-engine">
<span id="id1"></span><h1>MediaWiki Engine<a class="headerlink" href="#mediawiki-engine" title="Permalink to this heading"></a></h1>
<nav class="contents local" id="contents">
<ul class="simple">
<li><p><a class="reference internal" href="#configuration" id="id2">Configuration</a></p></li>
<li><p><a class="reference internal" href="#implementations" id="id3">Implementations</a></p></li>
</ul>
</nav>
<span class="target" id="module-searx.engines.mediawiki"></span><p>The MediaWiki engine is a <em>generic</em> engine to <strong>query</strong> Wikimedia wikis by
the <a class="reference external" href="https://www.mediawiki.org/wiki/API:Main_page">MediaWiki Action API</a>. For a <a class="reference external" href="https://www.mediawiki.org/w/api.php?action=help&amp;modules=query">query action</a> all Wikimedia wikis have
endpoints that follow this pattern:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>https://{base_url}/w/api.php?action=query&amp;list=search&amp;format=json
</pre></div>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>In its actual state, this engine is implemented to parse JSON result
(<a class="reference external" href="https://www.mediawiki.org/w/api.php?action=help&amp;modules=json">format=json</a>) from a search query (<a class="reference external" href="https://www.mediawiki.org/w/api.php?action=help&amp;modules=query%2Bsearch">list=search</a>). If you need other
<code class="docutils literal notranslate"><span class="pre">action</span></code> and <code class="docutils literal notranslate"><span class="pre">list</span></code> types ask SearXNG developers to extend the
implementation according to your needs.</p>
</div>
<section id="configuration">
<h2><a class="toc-backref" href="#id2" role="doc-backlink">Configuration</a><a class="headerlink" href="#configuration" title="Permalink to this heading"></a></h2>
<p>Request:</p>
<ul class="simple">
<li><p><a class="reference internal" href="#searx.engines.mediawiki.base_url" title="searx.engines.mediawiki.base_url"><code class="xref py py-obj docutils literal notranslate"><span class="pre">base_url</span></code></a></p></li>
<li><p><a class="reference internal" href="#searx.engines.mediawiki.search_type" title="searx.engines.mediawiki.search_type"><code class="xref py py-obj docutils literal notranslate"><span class="pre">search_type</span></code></a></p></li>
<li><p><a class="reference internal" href="#searx.engines.mediawiki.srenablerewrites" title="searx.engines.mediawiki.srenablerewrites"><code class="xref py py-obj docutils literal notranslate"><span class="pre">srenablerewrites</span></code></a></p></li>
<li><p><a class="reference internal" href="#searx.engines.mediawiki.srsort" title="searx.engines.mediawiki.srsort"><code class="xref py py-obj docutils literal notranslate"><span class="pre">srsort</span></code></a></p></li>
<li><p><a class="reference internal" href="#searx.engines.mediawiki.srprop" title="searx.engines.mediawiki.srprop"><code class="xref py py-obj docutils literal notranslate"><span class="pre">srprop</span></code></a></p></li>
</ul>
</section>
<section id="implementations">
<h2><a class="toc-backref" href="#id3" role="doc-backlink">Implementations</a><a class="headerlink" href="#implementations" title="Permalink to this heading"></a></h2>
</section>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.mediawiki.base_url">
<span class="sig-prename descclassname"><span class="pre">searx.engines.mediawiki.</span></span><span class="sig-name descname"><span class="pre">base_url</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><span class="pre">str</span></a></em><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'https://{language}.wikipedia.org/'</span></em><a class="headerlink" href="#searx.engines.mediawiki.base_url" title="Permalink to this definition"></a></dt>
<dd><p>Base URL of the Wikimedia wiki.</p>
<dl class="simple">
<dt><code class="docutils literal notranslate"><span class="pre">{language}</span></code>:</dt><dd><p>ISO 639-1 language code (en, de, fr ..) of the search language.</p>
</dd>
</dl>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.mediawiki.search_type">
<span class="sig-prename descclassname"><span class="pre">searx.engines.mediawiki.</span></span><span class="sig-name descname"><span class="pre">search_type</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><span class="pre">str</span></a></em><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'nearmatch'</span></em><a class="headerlink" href="#searx.engines.mediawiki.search_type" title="Permalink to this definition"></a></dt>
<dd><p>Which type of search to perform. One of the following values: <code class="docutils literal notranslate"><span class="pre">nearmatch</span></code>,
<code class="docutils literal notranslate"><span class="pre">text</span></code> or <code class="docutils literal notranslate"><span class="pre">title</span></code>.</p>
<p>See <code class="docutils literal notranslate"><span class="pre">srwhat</span></code> argument in <a class="reference external" href="https://www.mediawiki.org/w/api.php?action=help&amp;modules=query%2Bsearch">list=search</a> documentation.</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.mediawiki.srenablerewrites">
<span class="sig-prename descclassname"><span class="pre">searx.engines.mediawiki.</span></span><span class="sig-name descname"><span class="pre">srenablerewrites</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.11)"><span class="pre">bool</span></a></em><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">True</span></em><a class="headerlink" href="#searx.engines.mediawiki.srenablerewrites" title="Permalink to this definition"></a></dt>
<dd><p>Enable internal query rewriting (Type: boolean). Some search backends can
rewrite the query into another which is thought to provide better results, for
instance by correcting spelling errors.</p>
<p>See <code class="docutils literal notranslate"><span class="pre">srenablerewrites</span></code> argument in <a class="reference external" href="https://www.mediawiki.org/w/api.php?action=help&amp;modules=query%2Bsearch">list=search</a> documentation.</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.mediawiki.srprop">
<span class="sig-prename descclassname"><span class="pre">searx.engines.mediawiki.</span></span><span class="sig-name descname"><span class="pre">srprop</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><span class="pre">str</span></a></em><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'sectiontitle|snippet|timestamp|categorysnippet'</span></em><a class="headerlink" href="#searx.engines.mediawiki.srprop" title="Permalink to this definition"></a></dt>
<dd><p>Which properties to return.</p>
<p>See <code class="docutils literal notranslate"><span class="pre">srprop</span></code> argument in <a class="reference external" href="https://www.mediawiki.org/w/api.php?action=help&amp;modules=query%2Bsearch">list=search</a> documentation.</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.mediawiki.srsort">
<span class="sig-prename descclassname"><span class="pre">searx.engines.mediawiki.</span></span><span class="sig-name descname"><span class="pre">srsort</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><span class="pre">str</span></a></em><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'relevance'</span></em><a class="headerlink" href="#searx.engines.mediawiki.srsort" title="Permalink to this definition"></a></dt>
<dd><p>Set the sort order of returned results. One of the following values:
<code class="docutils literal notranslate"><span class="pre">create_timestamp_asc</span></code>, <code class="docutils literal notranslate"><span class="pre">create_timestamp_desc</span></code>, <code class="docutils literal notranslate"><span class="pre">incoming_links_asc</span></code>,
<code class="docutils literal notranslate"><span class="pre">incoming_links_desc</span></code>, <code class="docutils literal notranslate"><span class="pre">just_match</span></code>, <code class="docutils literal notranslate"><span class="pre">last_edit_asc</span></code>, <code class="docutils literal notranslate"><span class="pre">last_edit_desc</span></code>,
<code class="docutils literal notranslate"><span class="pre">none</span></code>, <code class="docutils literal notranslate"><span class="pre">random</span></code>, <code class="docutils literal notranslate"><span class="pre">relevance</span></code>, <code class="docutils literal notranslate"><span class="pre">user_random</span></code>.</p>
<p>See <code class="docutils literal notranslate"><span class="pre">srenablerewrites</span></code> argument in <a class="reference external" href="https://www.mediawiki.org/w/api.php?action=help&amp;modules=query%2Bsearch">list=search</a> documentation.</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.mediawiki.timestamp_format">
<span class="sig-prename descclassname"><span class="pre">searx.engines.mediawiki.</span></span><span class="sig-name descname"><span class="pre">timestamp_format</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'%Y-%m-%dT%H:%M:%SZ'</span></em><a class="headerlink" href="#searx.engines.mediawiki.timestamp_format" title="Permalink to this definition"></a></dt>
<dd><p>The longhand version of MediaWiki time strings.</p>
</dd></dl>
</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/searxng-wordmark.svg" alt="Logo"/>
</a></p>
<h3><a href="../../index.html">Table of Contents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../user/index.html">User information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../own-instance.html">Why use a private instance?</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../admin/index.html">Administrator documentation</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../index.html">Developer documentation</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../quickstart.html">Development Quickstart</a></li>
<li class="toctree-l2"><a class="reference internal" href="../contribution_guide.html">How to contribute</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="index.html">Engine Implementations</a></li>
<li class="toctree-l2"><a class="reference internal" href="../search_api.html">Search API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../plugins.html">Plugins</a></li>
<li class="toctree-l2"><a class="reference internal" href="../translation.html">Translation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../lxcdev.html">Developing in Linux Containers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../makefile.html">Makefile &amp; <code class="docutils literal notranslate"><span class="pre">./manage</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../reST.html">reST primer</a></li>
<li class="toctree-l2"><a class="reference internal" href="../searxng_extra/index.html">Tooling box <code class="docutils literal notranslate"><span class="pre">searxng_extra</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../utils/index.html">DevOps tooling box</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../src/index.html">Source-Code</a></li>
</ul>
<h3>Project Links</h3>
<ul>
<li><a href="https://github.com/searxng/searxng/tree/master">Source</a>
<li><a href="https://github.com/searxng/searxng/wiki">Wiki</a>
<li><a href="https://searx.space">Public instances</a>
<li><a href="https://github.com/searxng/searxng/issues">Issue Tracker</a>
</ul><h3>Navigation</h3>
<ul>
<li><a href="../../index.html">Overview</a>
<ul>
<li><a href="../index.html">Developer documentation</a>
<ul>
<li><a href="index.html">Engine Implementations</a>
<ul>
<li>Previous: <a href="xpath.html" title="previous chapter">XPath Engine</a>
<li>Next: <a href="online/annas_archive.html" title="next chapter">Annas Archive</a></ul>
</li></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 role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../_sources/dev/engines/mediawiki.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright SearXNG team.
</div>
<script src="../../_static/version_warning_offset.js"></script>
</body>
</html>

View file

@ -0,0 +1,230 @@
<!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>Command Line Engines &#8212; SearXNG Documentation (2023.8.11+905ce2a6f)</title>
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=4f649999" />
<link rel="stylesheet" type="text/css" href="../../../_static/searxng.css?v=52e4ff28" />
<link rel="stylesheet" type="text/css" href="../../../_static/tabs.css?v=a5c4661c" />
<script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js?v=3c88bde0"></script>
<script src="../../../_static/doctools.js?v=888ff710"></script>
<script src="../../../_static/sphinx_highlight.js?v=4825356b"></script>
<link rel="index" title="Index" href="../../../genindex.html" />
<link rel="search" title="Search" href="../../../search.html" />
<link rel="next" title="NoSQL databases" href="nosql-engines.html" />
<link rel="prev" title="Demo Offline Engine" href="../demo/demo_offline.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="nosql-engines.html" title="NoSQL databases"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="../demo/demo_offline.html" title="Demo Offline Engine"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">SearXNG Documentation (2023.8.11+905ce2a6f)</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../index.html" >Developer documentation</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="../index.html" accesskey="U">Engine Implementations</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Command Line Engines</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="command-line-engines">
<span id="engine-command"></span><h1>Command Line Engines<a class="headerlink" href="#command-line-engines" title="Permalink to this heading"></a></h1>
<aside class="sidebar">
<p class="sidebar-title">info</p>
<ul class="simple">
<li><p><a class="reference external" href="https://github.com/searxng/searxng/blob/master/searx/engines/command.py">command.py</a></p></li>
<li><p><a class="reference internal" href="../index.html#offline-engines"><span class="std std-ref">Offline Engines</span></a></p></li>
</ul>
</aside>
<nav class="contents local" id="contents">
<ul class="simple">
<li><p><a class="reference internal" href="#configuration" id="id1">Configuration</a></p></li>
<li><p><a class="reference internal" href="#example" id="id2">Example</a></p></li>
<li><p><a class="reference internal" href="#implementations" id="id3">Implementations</a></p></li>
</ul>
</nav>
<aside class="sidebar">
<p class="sidebar-title">info</p>
<p>Initial sponsored by <a class="reference external" href="https://nlnet.nl/discovery">Search and Discovery Fund</a> of <a class="reference external" href="https://nlnet.nl/">NLnet Foundation</a>.</p>
</aside>
<span class="target" id="module-searx.engines.command"></span><p>With <em>command engines</em> administrators can run engines to integrate arbitrary
shell commands.</p>
<div class="admonition attention">
<p class="admonition-title">Attention</p>
<p>When creating and enabling a <code class="docutils literal notranslate"><span class="pre">command</span></code> engine on a public instance, you
must be careful to avoid leaking private data.</p>
</div>
<p>The easiest solution is to limit the access by setting <code class="docutils literal notranslate"><span class="pre">tokens</span></code> as described
in section <a class="reference internal" href="../../../admin/settings/settings_engine.html#private-engines"><span class="std std-ref">Private Engines (tokens)</span></a>. The engine base is flexible. Only your
imagination can limit the power of this engine (and maybe security concerns).</p>
<section id="configuration">
<h2><a class="toc-backref" href="#id1" role="doc-backlink">Configuration</a><a class="headerlink" href="#configuration" title="Permalink to this heading"></a></h2>
<p>The following options are available:</p>
<dl>
<dt><code class="docutils literal notranslate"><span class="pre">command</span></code>:</dt><dd><p>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 where to put the search terms of the user. Example:</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="p p-Indicator">[</span><span class="s">&#39;ls&#39;</span><span class="p p-Indicator">,</span><span class="w"> </span><span class="s">&#39;-l&#39;</span><span class="p p-Indicator">,</span><span class="w"> </span><span class="s">&#39;-h&#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>
</pre></div>
</div>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">delimiter</span></code>:</dt><dd><p>A mapping containing a delimiter <code class="docutils literal notranslate"><span class="pre">char</span></code> and the <em>titles</em> of each element in
<code class="docutils literal notranslate"><span class="pre">keys</span></code>.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">parse_regex</span></code>:</dt><dd><p>A dict containing the regular expressions for each result key.</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">query_type</span></code>:</p>
<blockquote>
<div><p>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>.</p>
<dl class="simple">
<dt><code class="docutils literal notranslate"><span class="pre">path</span></code>:</dt><dd><p>Checks if the user provided path is inside the working directory. If not,
the query is not executed.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">enum</span></code>:</dt><dd><p>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>
</dd>
</dl>
</div></blockquote>
<dl class="simple">
<dt><code class="docutils literal notranslate"><span class="pre">query_enum</span></code>:</dt><dd><p>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>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">working_dir</span></code>:</dt><dd><p>The directory where the command has to be executed. Default: <code class="docutils literal notranslate"><span class="pre">./</span></code>.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">result_separator</span></code>:</dt><dd><p>The character that separates results. Default: <code class="docutils literal notranslate"><span class="pre">\n</span></code>.</p>
</dd>
</dl>
</section>
<section id="example">
<h2><a class="toc-backref" href="#id2" role="doc-backlink">Example</a><a class="headerlink" href="#example" title="Permalink to this heading"></a></h2>
<p>The example engine below can be used to find files with a specific name in the
configured working directory:</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="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="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="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="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="nt">delimiter</span><span class="p">:</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="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>
</pre></div>
</div>
</section>
<section id="implementations">
<h2><a class="toc-backref" href="#id3" role="doc-backlink">Implementations</a><a class="headerlink" href="#implementations" title="Permalink to this heading"></a></h2>
</section>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.command.check_parsing_options">
<span class="sig-prename descclassname"><span class="pre">searx.engines.command.</span></span><span class="sig-name descname"><span class="pre">check_parsing_options</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">engine_settings</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/command.html#check_parsing_options"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.command.check_parsing_options" title="Permalink to this definition"></a></dt>
<dd><p>Checks if delimiter based parsing or regex parsing is configured correctly</p>
</dd></dl>
</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/searxng-wordmark.svg" alt="Logo"/>
</a></p>
<h3><a href="../../../index.html">Table of Contents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../user/index.html">User information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../own-instance.html">Why use a private instance?</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../admin/index.html">Administrator documentation</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../index.html">Developer documentation</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../quickstart.html">Development Quickstart</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../contribution_guide.html">How to contribute</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../index.html">Engine Implementations</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../search_api.html">Search API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../plugins.html">Plugins</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../translation.html">Translation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../lxcdev.html">Developing in Linux Containers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../makefile.html">Makefile &amp; <code class="docutils literal notranslate"><span class="pre">./manage</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../reST.html">reST primer</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../searxng_extra/index.html">Tooling box <code class="docutils literal notranslate"><span class="pre">searxng_extra</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../utils/index.html">DevOps tooling box</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../src/index.html">Source-Code</a></li>
</ul>
<h3>Project Links</h3>
<ul>
<li><a href="https://github.com/searxng/searxng/tree/master">Source</a>
<li><a href="https://github.com/searxng/searxng/wiki">Wiki</a>
<li><a href="https://searx.space">Public instances</a>
<li><a href="https://github.com/searxng/searxng/issues">Issue Tracker</a>
</ul><h3>Navigation</h3>
<ul>
<li><a href="../../../index.html">Overview</a>
<ul>
<li><a href="../../index.html">Developer documentation</a>
<ul>
<li><a href="../index.html">Engine Implementations</a>
<ul>
<li>Previous: <a href="../demo/demo_offline.html" title="previous chapter">Demo Offline Engine</a>
<li>Next: <a href="nosql-engines.html" title="next chapter">NoSQL databases</a></ul>
</li></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 role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../../_sources/dev/engines/offline/command-line-engines.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright SearXNG team.
</div>
<script src="../../../_static/version_warning_offset.js"></script>
</body>
</html>

View file

@ -0,0 +1,281 @@
<!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>NoSQL databases &#8212; SearXNG Documentation (2023.8.11+905ce2a6f)</title>
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=4f649999" />
<link rel="stylesheet" type="text/css" href="../../../_static/searxng.css?v=52e4ff28" />
<link rel="stylesheet" type="text/css" href="../../../_static/tabs.css?v=a5c4661c" />
<script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js?v=3c88bde0"></script>
<script src="../../../_static/doctools.js?v=888ff710"></script>
<script src="../../../_static/sphinx_highlight.js?v=4825356b"></script>
<link rel="index" title="Index" href="../../../genindex.html" />
<link rel="search" title="Search" href="../../../search.html" />
<link rel="next" title="Local Search APIs" href="search-indexer-engines.html" />
<link rel="prev" title="Command Line Engines" href="command-line-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="search-indexer-engines.html" title="Local Search APIs"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="command-line-engines.html" title="Command Line Engines"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">SearXNG Documentation (2023.8.11+905ce2a6f)</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../index.html" >Developer documentation</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="../index.html" accesskey="U">Engine Implementations</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">NoSQL databases</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="nosql-databases">
<span id="nosql-engines"></span><h1>NoSQL databases<a class="headerlink" href="#nosql-databases" title="Permalink to this heading"></a></h1>
<aside class="sidebar">
<p class="sidebar-title">further read</p>
<ul class="simple">
<li><p><a class="reference external" href="https://en.wikipedia.org/wiki/NoSQL">NoSQL databases</a></p></li>
<li><p><a class="reference external" href="https://redis.io/">redis.io</a></p></li>
<li><p><a class="reference external" href="https://www.mongodb.com">MongoDB</a></p></li>
</ul>
</aside>
<nav class="contents local" id="contents">
<ul class="simple">
<li><p><a class="reference internal" href="#extra-dependencies" id="id6">Extra Dependencies</a></p></li>
<li><p><a class="reference internal" href="#configure-the-engines" id="id7">Configure the engines</a></p>
<ul>
<li><p><a class="reference internal" href="#redis-server" id="id8">Redis Server</a></p></li>
<li><p><a class="reference internal" href="#engine-mongodb" id="id9">MongoDB</a></p></li>
</ul>
</li>
</ul>
</nav>
<aside class="sidebar">
<p class="sidebar-title">info</p>
<p>Initial sponsored by <a class="reference external" href="https://nlnet.nl/discovery">Search and Discovery Fund</a> of <a class="reference external" href="https://nlnet.nl/">NLnet Foundation</a>.</p>
</aside>
<p>The following <a class="reference external" href="https://en.wikipedia.org/wiki/NoSQL">NoSQL databases</a> are supported:</p>
<ul class="simple">
<li><p><a class="reference internal" href="#engine-redis-server"><span class="std std-ref">Redis Server</span></a></p></li>
<li><p><a class="reference internal" href="#engine-mongodb"><span class="std std-ref">MongoDB</span></a></p></li>
</ul>
<p>All of the engines above are just commented out in the <a class="reference external" href="https://github.com/searxng/searxng/blob/master/searx/settings.yml">settings.yml</a>, as you have to set various options and install
dependencies before using them.</p>
<p>By default, the engines use the <code class="docutils literal notranslate"><span class="pre">key-value</span></code> template for displaying results /
see <a class="reference external" href="https://github.com/searxng/searxng/blob/master/searx/templates/simple/result_templates/key-value.html">simple</a>
theme. If you are not satisfied with the original result layout, you can use
your own template, set <code class="docutils literal notranslate"><span class="pre">result_template</span></code> attribute to <code class="docutils literal notranslate"><span class="pre">{template_name}</span></code> and
place the templates at:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">searx</span><span class="o">/</span><span class="n">templates</span><span class="o">/</span><span class="p">{</span><span class="n">theme_name</span><span class="p">}</span><span class="o">/</span><span class="n">result_templates</span><span class="o">/</span><span class="p">{</span><span class="n">template_name</span><span class="p">}</span>
</pre></div>
</div>
<p>Furthermore, if you do not wish to expose these engines on a public instance, you
can still add them and limit the access by setting <code class="docutils literal notranslate"><span class="pre">tokens</span></code> as described in
section <a class="reference internal" href="../../../admin/settings/settings_engine.html#private-engines"><span class="std std-ref">Private Engines (tokens)</span></a>.</p>
<section id="extra-dependencies">
<h2><a class="toc-backref" href="#id6" role="doc-backlink">Extra Dependencies</a><a class="headerlink" href="#extra-dependencies" title="Permalink to this heading"></a></h2>
<p>For using <a class="reference internal" href="#engine-redis-server"><span class="std std-ref">Redis Server</span></a> or <a class="reference internal" href="#engine-mongodb"><span class="std std-ref">MongoDB</span></a> you need to
install additional packages in Pythons Virtual Environment of your SearXNG
instance. To switch into the environment (<a class="reference internal" href="../../../admin/installation-searxng.html#searxng-src"><span class="std std-ref">Install SearXNG &amp; dependencies</span></a>) you can use
<a class="reference internal" href="../../../utils/searxng.sh.html#searxng-sh"><span class="std std-ref">utils/searxng.sh</span></a>:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ sudo utils/searxng.sh instance cmd bash
(searxng-pyenv)$ pip install ...
</pre></div>
</div>
</section>
<section id="configure-the-engines">
<h2><a class="toc-backref" href="#id7" role="doc-backlink">Configure the engines</a><a class="headerlink" href="#configure-the-engines" title="Permalink to this heading"></a></h2>
<p><a class="reference external" href="https://en.wikipedia.org/wiki/NoSQL">NoSQL databases</a> are used for storing arbitrary data without first defining
their structure.</p>
<section id="redis-server">
<span id="engine-redis-server"></span><h3><a class="toc-backref" href="#id8" role="doc-backlink">Redis Server</a><a class="headerlink" href="#redis-server" title="Permalink to this heading"></a></h3>
<aside class="sidebar">
<p class="sidebar-title">info</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">pip</span> <span class="pre">install</span></code> <a class="reference external" href="https://github.com/andymccurdy/redis-py#installation">redis</a></p></li>
<li><p><a class="reference external" href="https://redis.io/">redis.io</a></p></li>
<li><p><a class="reference external" href="https://github.com/searxng/searxng/blob/master/searx/engines/redis_server.py">redis_server.py</a></p></li>
</ul>
</aside>
<span class="target" id="module-searx.engines.redis_server"></span><p>Redis is an open source (BSD licensed), in-memory data structure (key value
based) store. Before configuring the <code class="docutils literal notranslate"><span class="pre">redis_server</span></code> engine, you must install
the dependency <a class="reference external" href="https://github.com/andymccurdy/redis-py#installation">redis</a>.</p>
<section id="configuration">
<h4>Configuration<a class="headerlink" href="#configuration" title="Permalink to this heading"></a></h4>
<p>Select a database to search in and set its index in the option <code class="docutils literal notranslate"><span class="pre">db</span></code>. You can
either look for exact matches or use partial keywords to find what you are
looking for by configuring <code class="docutils literal notranslate"><span class="pre">exact_match_only</span></code>.</p>
</section>
<section id="example">
<h4>Example<a class="headerlink" href="#example" title="Permalink to this heading"></a></h4>
<p>Below is an example configuration:</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="c1"># Required dependency: redis</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">myredis</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="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="nt">exact_match_only</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">false</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="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="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><span class="nt">password</span><span class="p">:</span><span class="w"> </span><span class="s">&#39;&#39;</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>
</pre></div>
</div>
</section>
<section id="implementations">
<h4>Implementations<a class="headerlink" href="#implementations" title="Permalink to this heading"></a></h4>
</section>
</section>
<section id="engine-mongodb">
<span id="id2"></span><h3><a class="toc-backref" href="#id9" role="doc-backlink">MongoDB</a><a class="headerlink" href="#engine-mongodb" title="Permalink to this heading"></a></h3>
<aside class="sidebar">
<p class="sidebar-title">info</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">pip</span> <span class="pre">install</span></code> <a class="reference external" href="https://github.com/mongodb/mongo-python-driver#installation">pymongo</a></p></li>
<li><p><a class="reference external" href="https://www.mongodb.com">MongoDB</a></p></li>
<li><p><a class="reference external" href="https://github.com/searxng/searxng/blob/master/searx/engines/mongodb.py">mongodb.py</a></p></li>
</ul>
</aside>
<span class="target" id="module-searx.engines.mongodb"></span><p><a class="reference external" href="https://www.mongodb.com">MongoDB</a> is a document based database program that handles JSON like data.
Before configuring the <code class="docutils literal notranslate"><span class="pre">mongodb</span></code> engine, you must install the dependency
<a class="reference external" href="https://github.com/mongodb/mongo-python-driver#installation">pymongo</a>.</p>
<section id="id3">
<h4>Configuration<a class="headerlink" href="#id3" title="Permalink to this heading"></a></h4>
<p>In order to query <a class="reference external" href="https://www.mongodb.com">MongoDB</a>, you have to select a <code class="docutils literal notranslate"><span class="pre">database</span></code> and a
<code class="docutils literal notranslate"><span class="pre">collection</span></code>. Furthermore, you have to select a <code class="docutils literal notranslate"><span class="pre">key</span></code> that is going to be
searched. <a class="reference external" href="https://www.mongodb.com">MongoDB</a> also supports the option <code class="docutils literal notranslate"><span class="pre">exact_match_only</span></code>, so configure
it as you wish.</p>
</section>
<section id="id4">
<h4>Example<a class="headerlink" href="#id4" title="Permalink to this heading"></a></h4>
<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="c1"># MongoDB engine</span>
<span class="c1"># Required dependency: pymongo</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="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="nt">shortcut</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">md</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">false</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="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="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><span class="nt">results_per_page</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">20</span>
<span class="w"> </span><span class="nt">database</span><span class="p">:</span><span class="w"> </span><span class="s">&#39;business&#39;</span>
<span class="w"> </span><span class="nt">collection</span><span class="p">:</span><span class="w"> </span><span class="s">&#39;reviews&#39;</span><span class="w"> </span><span class="c1"># name of the db collection</span>
<span class="w"> </span><span class="nt">key</span><span class="p">:</span><span class="w"> </span><span class="s">&#39;name&#39;</span><span class="w"> </span><span class="c1"># key in the collection to search for</span>
</pre></div>
</div>
</section>
<section id="id5">
<h4>Implementations<a class="headerlink" href="#id5" title="Permalink to this heading"></a></h4>
</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/searxng-wordmark.svg" alt="Logo"/>
</a></p>
<h3><a href="../../../index.html">Table of Contents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../user/index.html">User information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../own-instance.html">Why use a private instance?</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../admin/index.html">Administrator documentation</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../index.html">Developer documentation</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../quickstart.html">Development Quickstart</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../contribution_guide.html">How to contribute</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../index.html">Engine Implementations</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../search_api.html">Search API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../plugins.html">Plugins</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../translation.html">Translation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../lxcdev.html">Developing in Linux Containers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../makefile.html">Makefile &amp; <code class="docutils literal notranslate"><span class="pre">./manage</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../reST.html">reST primer</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../searxng_extra/index.html">Tooling box <code class="docutils literal notranslate"><span class="pre">searxng_extra</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../utils/index.html">DevOps tooling box</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../src/index.html">Source-Code</a></li>
</ul>
<h3>Project Links</h3>
<ul>
<li><a href="https://github.com/searxng/searxng/tree/master">Source</a>
<li><a href="https://github.com/searxng/searxng/wiki">Wiki</a>
<li><a href="https://searx.space">Public instances</a>
<li><a href="https://github.com/searxng/searxng/issues">Issue Tracker</a>
</ul><h3>Navigation</h3>
<ul>
<li><a href="../../../index.html">Overview</a>
<ul>
<li><a href="../../index.html">Developer documentation</a>
<ul>
<li><a href="../index.html">Engine Implementations</a>
<ul>
<li>Previous: <a href="command-line-engines.html" title="previous chapter">Command Line Engines</a>
<li>Next: <a href="search-indexer-engines.html" title="next chapter">Local Search APIs</a></ul>
</li></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 role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../../_sources/dev/engines/offline/nosql-engines.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright SearXNG team.
</div>
<script src="../../../_static/version_warning_offset.js"></script>
</body>
</html>

View file

@ -0,0 +1,270 @@
<!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>Local Search APIs &#8212; SearXNG Documentation (2023.8.11+905ce2a6f)</title>
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=4f649999" />
<link rel="stylesheet" type="text/css" href="../../../_static/searxng.css?v=52e4ff28" />
<link rel="stylesheet" type="text/css" href="../../../_static/tabs.css?v=a5c4661c" />
<script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js?v=3c88bde0"></script>
<script src="../../../_static/doctools.js?v=888ff710"></script>
<script src="../../../_static/sphinx_highlight.js?v=4825356b"></script>
<link rel="index" title="Index" href="../../../genindex.html" />
<link rel="search" title="Search" href="../../../search.html" />
<link rel="next" title="SQL Engines" href="sql-engines.html" />
<link rel="prev" title="NoSQL databases" href="nosql-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="sql-engines.html" title="SQL Engines"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="nosql-engines.html" title="NoSQL databases"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">SearXNG Documentation (2023.8.11+905ce2a6f)</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../index.html" >Developer documentation</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="../index.html" accesskey="U">Engine Implementations</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Local Search APIs</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="local-search-apis">
<h1>Local Search APIs<a class="headerlink" href="#local-search-apis" title="Permalink to this heading"></a></h1>
<aside class="sidebar">
<p class="sidebar-title">further read</p>
<ul class="simple">
<li><p><a class="reference external" href="https://docs.meilisearch.com/learn/what_is_meilisearch/comparison_to_alternatives.html">Comparison to alternatives</a></p></li>
</ul>
</aside>
<nav class="contents local" id="contents">
<ul class="simple">
<li><p><a class="reference internal" href="#module-searx.engines.meilisearch" id="id6">MeiliSearch</a></p></li>
<li><p><a class="reference internal" href="#module-searx.engines.elasticsearch" id="id7">Elasticsearch</a></p></li>
<li><p><a class="reference internal" href="#module-searx.engines.solr" id="id8">Solr</a></p></li>
</ul>
</nav>
<aside class="sidebar">
<p class="sidebar-title">info</p>
<p>Initial sponsored by <a class="reference external" href="https://nlnet.nl/discovery">Search and Discovery Fund</a> of <a class="reference external" href="https://nlnet.nl/">NLnet Foundation</a>.</p>
</aside>
<p>Administrators might find themselves wanting to integrate locally running search
engines. The following ones are supported for now:</p>
<ul class="simple">
<li><p><a class="reference external" href="https://www.elastic.co/elasticsearch/">Elasticsearch</a></p></li>
<li><p><a class="reference external" href="https://www.meilisearch.com">Meilisearch</a></p></li>
<li><p><a class="reference external" href="https://solr.apache.org">Solr</a></p></li>
</ul>
<p>Each search engine is powerful, capable of full-text search. All of the engines
above are added to <code class="docutils literal notranslate"><span class="pre">settings.yml</span></code> just commented out, as you have to
<code class="docutils literal notranslate"><span class="pre">base_url</span></code> for all them.</p>
<p>Please note that if you are not using HTTPS to access these engines, you have to
enable HTTP requests by setting <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>
<p>Furthermore, if you do not want to expose these engines on a public instance,
you can still add them and limit the access by setting <code class="docutils literal notranslate"><span class="pre">tokens</span></code> as described
in section <a class="reference internal" href="../../../admin/settings/settings_engine.html#private-engines"><span class="std std-ref">Private Engines (tokens)</span></a>.</p>
<section id="module-searx.engines.meilisearch">
<span id="meilisearch"></span><span id="engine-meilisearch"></span><h2><a class="toc-backref" href="#id6" role="doc-backlink">MeiliSearch</a><a class="headerlink" href="#module-searx.engines.meilisearch" title="Permalink to this heading"></a></h2>
<aside class="sidebar">
<p class="sidebar-title">info</p>
<ul class="simple">
<li><p><a class="reference external" href="https://github.com/searxng/searxng/blob/master/searx/engines/meilisearch.py">meilisearch.py</a></p></li>
<li><p><a class="reference external" href="https://www.meilisearch.com">MeiliSearch</a></p></li>
<li><p><a class="reference external" href="https://docs.meilisearch.com/">MeiliSearch Documentation</a></p></li>
<li><p><a class="reference external" href="https://docs.meilisearch.com/learn/getting_started/installation.html">Install MeiliSearch</a></p></li>
</ul>
</aside>
<p><a class="reference external" href="https://www.meilisearch.com">MeiliSearch</a> is aimed at individuals and small companies. It is designed for
small-scale (less than 10 million documents) data collections. E.g. it is great
for storing web pages you have visited and searching in the contents later.</p>
<p>The engine supports faceted search, so you can search in a subset of documents
of the collection. Furthermore, you can search in <a class="reference external" href="https://www.meilisearch.com">MeiliSearch</a> instances that
require authentication by setting <code class="docutils literal notranslate"><span class="pre">auth_token</span></code>.</p>
<section id="example">
<h3>Example<a class="headerlink" href="#example" title="Permalink to this heading"></a></h3>
<p>Here is a simple example to query a Meilisearch instance:</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="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="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="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="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="nt">enable_http</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span>
</pre></div>
</div>
</section>
</section>
<section id="module-searx.engines.elasticsearch">
<span id="elasticsearch"></span><span id="engine-elasticsearch"></span><h2><a class="toc-backref" href="#id7" role="doc-backlink">Elasticsearch</a><a class="headerlink" href="#module-searx.engines.elasticsearch" title="Permalink to this heading"></a></h2>
<aside class="sidebar">
<p class="sidebar-title">info</p>
<ul class="simple">
<li><p><a class="reference external" href="https://github.com/searxng/searxng/blob/master/searx/engines/elasticsearch.py">elasticsearch.py</a></p></li>
<li><p><a class="reference external" href="https://www.elastic.co/elasticsearch/">Elasticsearch</a></p></li>
<li><p><a class="reference external" href="https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html">Elasticsearch Guide</a></p></li>
<li><p><a class="reference external" href="https://www.elastic.co/guide/en/elasticsearch/reference/current/install-elasticsearch.html">Install Elasticsearch</a></p></li>
</ul>
</aside>
<p><a class="reference external" href="https://www.elastic.co/elasticsearch/">Elasticsearch</a> supports numerous ways to query the data it is storing. At the
moment the engine supports the most popular search methods (<code class="docutils literal notranslate"><span class="pre">query_type</span></code>):</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">match</span></code>,</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">simple_query_string</span></code>,</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">term</span></code> and</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">terms</span></code>.</p></li>
</ul>
<p>If none of the methods fit your use case, you can select <code class="docutils literal notranslate"><span class="pre">custom</span></code> query type
and provide the JSON payload to submit to Elasticsearch in
<code class="docutils literal notranslate"><span class="pre">custom_query_json</span></code>.</p>
<section id="id3">
<h3>Example<a class="headerlink" href="#id3" title="Permalink to this heading"></a></h3>
<p>The following is an example configuration for an <a class="reference external" href="https://www.elastic.co/elasticsearch/">Elasticsearch</a> instance with
authentication configured to read from <code class="docutils literal notranslate"><span class="pre">my-index</span></code> index.</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="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="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="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="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="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="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="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="c1"># custom_query_json: &#39;{ ... }&#39;</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>
</pre></div>
</div>
</section>
</section>
<section id="module-searx.engines.solr">
<span id="solr"></span><span id="engine-solr"></span><h2><a class="toc-backref" href="#id8" role="doc-backlink">Solr</a><a class="headerlink" href="#module-searx.engines.solr" title="Permalink to this heading"></a></h2>
<aside class="sidebar">
<p class="sidebar-title">info</p>
<ul class="simple">
<li><p><a class="reference external" href="https://github.com/searxng/searxng/blob/master/searx/engines/solr.py">solr.py</a></p></li>
<li><p><a class="reference external" href="https://solr.apache.org">Solr</a></p></li>
<li><p><a class="reference external" href="https://solr.apache.org/resources.html">Solr Resources</a></p></li>
<li><p><a class="reference external" href="https://solr.apache.org/guide/installing-solr.html">Install Solr</a></p></li>
</ul>
</aside>
<p><a class="reference external" href="https://solr.apache.org">Solr</a> is a popular search engine based on Lucene, just like <a class="reference external" href="https://www.elastic.co/elasticsearch/">Elasticsearch</a>. But
instead of searching in indices, you can search in collections.</p>
<section id="id5">
<h3>Example<a class="headerlink" href="#id5" title="Permalink to this heading"></a></h3>
<p>This is an example configuration for searching in the collection
<code class="docutils literal notranslate"><span class="pre">my-collection</span></code> and get the results in ascending order.</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="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="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="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="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="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="nt">enable_http</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</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/searxng-wordmark.svg" alt="Logo"/>
</a></p>
<h3><a href="../../../index.html">Table of Contents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../user/index.html">User information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../own-instance.html">Why use a private instance?</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../admin/index.html">Administrator documentation</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../index.html">Developer documentation</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../quickstart.html">Development Quickstart</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../contribution_guide.html">How to contribute</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../index.html">Engine Implementations</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../search_api.html">Search API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../plugins.html">Plugins</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../translation.html">Translation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../lxcdev.html">Developing in Linux Containers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../makefile.html">Makefile &amp; <code class="docutils literal notranslate"><span class="pre">./manage</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../reST.html">reST primer</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../searxng_extra/index.html">Tooling box <code class="docutils literal notranslate"><span class="pre">searxng_extra</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../utils/index.html">DevOps tooling box</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../src/index.html">Source-Code</a></li>
</ul>
<h3>Project Links</h3>
<ul>
<li><a href="https://github.com/searxng/searxng/tree/master">Source</a>
<li><a href="https://github.com/searxng/searxng/wiki">Wiki</a>
<li><a href="https://searx.space">Public instances</a>
<li><a href="https://github.com/searxng/searxng/issues">Issue Tracker</a>
</ul><h3>Navigation</h3>
<ul>
<li><a href="../../../index.html">Overview</a>
<ul>
<li><a href="../../index.html">Developer documentation</a>
<ul>
<li><a href="../index.html">Engine Implementations</a>
<ul>
<li>Previous: <a href="nosql-engines.html" title="previous chapter">NoSQL databases</a>
<li>Next: <a href="sql-engines.html" title="next chapter">SQL Engines</a></ul>
</li></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 role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../../_sources/dev/engines/offline/search-indexer-engines.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright SearXNG team.
</div>
<script src="../../../_static/version_warning_offset.js"></script>
</body>
</html>

View file

@ -0,0 +1,323 @@
<!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>SQL Engines &#8212; SearXNG Documentation (2023.8.11+905ce2a6f)</title>
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=4f649999" />
<link rel="stylesheet" type="text/css" href="../../../_static/searxng.css?v=52e4ff28" />
<link rel="stylesheet" type="text/css" href="../../../_static/tabs.css?v=a5c4661c" />
<script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js?v=3c88bde0"></script>
<script src="../../../_static/doctools.js?v=888ff710"></script>
<script src="../../../_static/sphinx_highlight.js?v=4825356b"></script>
<link rel="index" title="Index" href="../../../genindex.html" />
<link rel="search" title="Search" href="../../../search.html" />
<link rel="next" title="Tineye" href="../online_url_search/tineye.html" />
<link rel="prev" title="Local Search APIs" href="search-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="../online_url_search/tineye.html" title="Tineye"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="search-indexer-engines.html" title="Local Search APIs"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">SearXNG Documentation (2023.8.11+905ce2a6f)</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../index.html" >Developer documentation</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="../index.html" accesskey="U">Engine Implementations</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">SQL Engines</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="sql-engines">
<span id="id1"></span><h1>SQL Engines<a class="headerlink" href="#sql-engines" title="Permalink to this heading"></a></h1>
<aside class="sidebar">
<p class="sidebar-title">further read</p>
<ul class="simple">
<li><p><a class="reference external" href="https://www.sqlite.org/index.html">SQLite</a></p></li>
<li><p><a class="reference external" href="https://www.postgresql.org">PostgreSQL</a></p></li>
<li><p><a class="reference external" href="https://www.mysql.com">MySQL</a></p></li>
</ul>
</aside>
<nav class="contents local" id="contents">
<ul class="simple">
<li><p><a class="reference internal" href="#extra-dependencies" id="id9">Extra Dependencies</a></p></li>
<li><p><a class="reference internal" href="#configure-the-engines" id="id10">Configure the engines</a></p>
<ul>
<li><p><a class="reference internal" href="#engine-sqlite" id="id11">SQLite</a></p></li>
<li><p><a class="reference internal" href="#engine-postgresql" id="id12">PostgreSQL</a></p></li>
<li><p><a class="reference internal" href="#engine-mysql-server" id="id13">MySQL</a></p></li>
</ul>
</li>
</ul>
</nav>
<aside class="sidebar">
<p class="sidebar-title">info</p>
<p>Initial sponsored by <a class="reference external" href="https://nlnet.nl/discovery">Search and Discovery Fund</a> of <a class="reference external" href="https://nlnet.nl/">NLnet Foundation</a>.</p>
</aside>
<p>With the <em>SQL engines</em> you can bind SQL databases into SearXNG. The following
Relational Database Management System (RDBMS) are supported:</p>
<ul class="simple">
<li><p><a class="reference internal" href="#engine-sqlite"><span class="std std-ref">SQLite</span></a></p></li>
<li><p><a class="reference internal" href="#engine-postgresql"><span class="std std-ref">PostgreSQL</span></a></p></li>
<li><p><a class="reference internal" href="#engine-mysql-server"><span class="std std-ref">MySQL</span></a></p></li>
</ul>
<p>All of the engines above are just commented out in the <a class="reference external" href="https://github.com/searxng/searxng/blob/master/searx/settings.yml">settings.yml</a>, as you have to set the required attributes for the
engines, e.g. <code class="docutils literal notranslate"><span class="pre">database:</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">...</span>
<span class="w"> </span><span class="nt">engine</span><span class="p">:</span><span class="w"> </span><span class="p p-Indicator">{</span><span class="nv">sqlite|postgresql|mysql_server</span><span class="p p-Indicator">}</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">...</span>
<span class="w"> </span><span class="nt">result_template</span><span class="p">:</span><span class="w"> </span><span class="p p-Indicator">{</span><span class="nv">template_name</span><span class="p p-Indicator">}</span>
<span class="w"> </span><span class="nt">query_str</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">...</span>
</pre></div>
</div>
<p>By default, the engines use the <code class="docutils literal notranslate"><span class="pre">key-value</span></code> template for displaying results /
see <a class="reference external" href="https://github.com/searxng/searxng/blob/master/searx/templates/simple/result_templates/key-value.html">simple</a>
theme. If you are not satisfied with the original result layout, you can use
your own template, set <code class="docutils literal notranslate"><span class="pre">result_template</span></code> attribute to <code class="docutils literal notranslate"><span class="pre">{template_name}</span></code> and
place the templates at:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">searx</span><span class="o">/</span><span class="n">templates</span><span class="o">/</span><span class="p">{</span><span class="n">theme_name</span><span class="p">}</span><span class="o">/</span><span class="n">result_templates</span><span class="o">/</span><span class="p">{</span><span class="n">template_name</span><span class="p">}</span>
</pre></div>
</div>
<p>If you do not wish to expose these engines on a public instance, you can still
add them and limit the access by setting <code class="docutils literal notranslate"><span class="pre">tokens</span></code> as described in section
<a class="reference internal" href="../../../admin/settings/settings_engine.html#private-engines"><span class="std std-ref">Private Engines (tokens)</span></a>.</p>
<section id="extra-dependencies">
<h2><a class="toc-backref" href="#id9" role="doc-backlink">Extra Dependencies</a><a class="headerlink" href="#extra-dependencies" title="Permalink to this heading"></a></h2>
<p>For using <a class="reference internal" href="#engine-postgresql"><span class="std std-ref">PostgreSQL</span></a> or <a class="reference internal" href="#engine-mysql-server"><span class="std std-ref">MySQL</span></a> you need to
install additional packages in Pythons Virtual Environment of your SearXNG
instance. To switch into the environment (<a class="reference internal" href="../../../admin/installation-searxng.html#searxng-src"><span class="std std-ref">Install SearXNG &amp; dependencies</span></a>) you can use
<a class="reference internal" href="../../../utils/searxng.sh.html#searxng-sh"><span class="std std-ref">utils/searxng.sh</span></a>:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ sudo utils/searxng.sh instance cmd bash
(searxng-pyenv)$ pip install ...
</pre></div>
</div>
</section>
<section id="configure-the-engines">
<h2><a class="toc-backref" href="#id10" role="doc-backlink">Configure the engines</a><a class="headerlink" href="#configure-the-engines" title="Permalink to this heading"></a></h2>
<p>The configuration of the new database engines are similar. You must put a valid
SQL-SELECT 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. By setting the attribute <code class="docutils literal notranslate"><span class="pre">limit</span></code> you can define how
many results you want from the SQL server. Basically, it is the same as the
<code class="docutils literal notranslate"><span class="pre">LIMIT</span></code> keyword in SQL.</p>
<p>Please, do not include <code class="docutils literal notranslate"><span class="pre">LIMIT</span></code> or <code class="docutils literal notranslate"><span class="pre">OFFSET</span></code> 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 <code class="docutils literal notranslate"><span class="pre">limit</span></code>.</p>
<section id="engine-sqlite">
<span id="id2"></span><h3><a class="toc-backref" href="#id11" role="doc-backlink">SQLite</a><a class="headerlink" href="#engine-sqlite" title="Permalink to this heading"></a></h3>
<aside class="sidebar">
<p class="sidebar-title">info</p>
<ul class="simple">
<li><p><a class="reference external" href="https://github.com/searxng/searxng/blob/master/searx/engines/sqlite.py">sqlite.py</a></p></li>
</ul>
</aside>
<span class="target" id="module-searx.engines.sqlite"></span><p>SQLite is a small, fast and reliable SQL database engine. It does not require
any extra dependency.</p>
<section id="example">
<h4>Example<a class="headerlink" href="#example" title="Permalink to this heading"></a></h4>
<p>To demonstrate the power of database engines, here is a more complex example
which reads from a <a class="reference external" href="https://mediathekview.de/">MediathekView</a> (DE) movie database. For this example of the
SQlite engine download the database:</p>
<ul class="simple">
<li><p><a class="reference external" href="https://liste.mediathekview.de/filmliste-v2.db.bz2">https://liste.mediathekview.de/filmliste-v2.db.bz2</a></p></li>
</ul>
<p>and unpack into <code class="docutils literal notranslate"><span class="pre">searx/data/filmliste-v2.db</span></code>. To search the database use e.g
Query to test: <code class="docutils literal notranslate"><span class="pre">!mediathekview</span> <span class="pre">concert</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">mediathekview</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="nt">disabled</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">False</span>
<span class="w"> </span><span class="nt">categories</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">general</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">default.html</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">searx/data/filmliste-v2.db</span>
<span class="w"> </span><span class="nt">query_str</span><span class="p">:</span><span class="w"> </span><span class="p p-Indicator">&gt;-</span>
<span class="w"> </span><span class="no">SELECT title || &#39; (&#39; || time(duration, &#39;unixepoch&#39;) || &#39;)&#39; AS title,</span>
<span class="w"> </span><span class="no">COALESCE( NULLIF(url_video_hd,&#39;&#39;), NULLIF(url_video_sd,&#39;&#39;), url_video) AS url,</span>
<span class="w"> </span><span class="no">description AS content</span>
<span class="w"> </span><span class="no">FROM film</span>
<span class="w"> </span><span class="no">WHERE title LIKE :wildcard OR description LIKE :wildcard</span>
<span class="w"> </span><span class="no">ORDER BY duration DESC</span>
</pre></div>
</div>
</section>
<section id="implementations">
<h4>Implementations<a class="headerlink" href="#implementations" title="Permalink to this heading"></a></h4>
</section>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.sqlite.sqlite_cursor">
<span class="sig-prename descclassname"><span class="pre">searx.engines.sqlite.</span></span><span class="sig-name descname"><span class="pre">sqlite_cursor</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/sqlite.html#sqlite_cursor"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.sqlite.sqlite_cursor" title="Permalink to this definition"></a></dt>
<dd><p>Implements a <a class="reference external" href="https://docs.python.org/3/library/contextlib.html#contextlib.contextmanager" title="(in Python v3.11)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Context</span> <span class="pre">Manager</span></code></a> for a
<a class="reference external" href="https://docs.python.org/3/library/sqlite3.html#sqlite3.Cursor" title="(in Python v3.11)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sqlite3.Cursor</span></code></a>.</p>
<p>Open database in read only mode: if the database doesnt exist. The default
mode creates an empty file on the file system. See:</p>
<ul class="simple">
<li><p><a class="reference external" href="https://docs.python.org/3/library/sqlite3.html#sqlite3.connect">https://docs.python.org/3/library/sqlite3.html#sqlite3.connect</a></p></li>
<li><p><a class="reference external" href="https://www.sqlite.org/uri.html">https://www.sqlite.org/uri.html</a></p></li>
</ul>
</dd></dl>
</section>
<section id="engine-postgresql">
<span id="id3"></span><h3><a class="toc-backref" href="#id12" role="doc-backlink">PostgreSQL</a><a class="headerlink" href="#engine-postgresql" title="Permalink to this heading"></a></h3>
<aside class="sidebar">
<p class="sidebar-title">info</p>
<ul class="simple">
<li><p><a class="reference external" href="https://github.com/searxng/searxng/blob/master/searx/engines/postgresql.py">postgresql.py</a></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">pip</span> <span class="pre">install</span></code> <a class="reference external" href="psycopg2">psycopg2-binary</a></p></li>
</ul>
</aside>
<span class="target" id="module-searx.engines.postgresql"></span><p>PostgreSQL is a powerful and robust open source database. Before configuring
the PostgreSQL engine, you must install the dependency <code class="docutils literal notranslate"><span class="pre">psychopg2</span></code>.</p>
<section id="id4">
<h4>Example<a class="headerlink" href="#id4" title="Permalink to this heading"></a></h4>
<p>Below is an 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">my_database</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="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="nt">username</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">searxng</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="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>
</pre></div>
</div>
</section>
<section id="id5">
<h4>Implementations<a class="headerlink" href="#id5" title="Permalink to this heading"></a></h4>
</section>
</section>
<section id="engine-mysql-server">
<span id="id6"></span><h3><a class="toc-backref" href="#id13" role="doc-backlink">MySQL</a><a class="headerlink" href="#engine-mysql-server" title="Permalink to this heading"></a></h3>
<aside class="sidebar">
<p class="sidebar-title">info</p>
<ul class="simple">
<li><p><a class="reference external" href="https://github.com/searxng/searxng/blob/master/searx/engines/mysql_server.py">mysql_server.py</a></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">pip</span> <span class="pre">install</span></code> <a class="reference external" href="https://pypi.org/project/mysql-connector-python">mysql-connector-python</a></p></li>
</ul>
</aside>
<span class="target" id="module-searx.engines.mysql_server"></span><p>MySQL is said to be the most popular open source database. Before enabling
MySQL engine, you must install the package <code class="docutils literal notranslate"><span class="pre">mysql-connector-python</span></code>.</p>
<p>The authentication plugin is configurable by setting <code class="docutils literal notranslate"><span class="pre">auth_plugin</span></code> in the
attributes. By default it is set to <code class="docutils literal notranslate"><span class="pre">caching_sha2_password</span></code>.</p>
<section id="id7">
<h4>Example<a class="headerlink" href="#id7" title="Permalink to this heading"></a></h4>
<p>This is an example configuration for querying 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">my_database</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="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="nt">username</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">searxng</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="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="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>
</pre></div>
</div>
</section>
<section id="id8">
<h4>Implementations<a class="headerlink" href="#id8" title="Permalink to this heading"></a></h4>
</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/searxng-wordmark.svg" alt="Logo"/>
</a></p>
<h3><a href="../../../index.html">Table of Contents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../user/index.html">User information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../own-instance.html">Why use a private instance?</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../admin/index.html">Administrator documentation</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../index.html">Developer documentation</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../quickstart.html">Development Quickstart</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../contribution_guide.html">How to contribute</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../index.html">Engine Implementations</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../search_api.html">Search API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../plugins.html">Plugins</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../translation.html">Translation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../lxcdev.html">Developing in Linux Containers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../makefile.html">Makefile &amp; <code class="docutils literal notranslate"><span class="pre">./manage</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../reST.html">reST primer</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../searxng_extra/index.html">Tooling box <code class="docutils literal notranslate"><span class="pre">searxng_extra</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../utils/index.html">DevOps tooling box</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../src/index.html">Source-Code</a></li>
</ul>
<h3>Project Links</h3>
<ul>
<li><a href="https://github.com/searxng/searxng/tree/master">Source</a>
<li><a href="https://github.com/searxng/searxng/wiki">Wiki</a>
<li><a href="https://searx.space">Public instances</a>
<li><a href="https://github.com/searxng/searxng/issues">Issue Tracker</a>
</ul><h3>Navigation</h3>
<ul>
<li><a href="../../../index.html">Overview</a>
<ul>
<li><a href="../../index.html">Developer documentation</a>
<ul>
<li><a href="../index.html">Engine Implementations</a>
<ul>
<li>Previous: <a href="search-indexer-engines.html" title="previous chapter">Local Search APIs</a>
<li>Next: <a href="../online_url_search/tineye.html" title="next chapter">Tineye</a></ul>
</li></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 role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../../_sources/dev/engines/offline/sql-engines.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright SearXNG team.
</div>
<script src="../../../_static/version_warning_offset.js"></script>
</body>
</html>

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>Offline Concept &#8212; SearXNG Documentation (2023.8.11+905ce2a6f)</title>
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=4f649999" />
<link rel="stylesheet" type="text/css" href="../../_static/searxng.css?v=52e4ff28" />
<link rel="stylesheet" type="text/css" href="../../_static/tabs.css?v=a5c4661c" />
<script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js?v=3c88bde0"></script>
<script src="../../_static/doctools.js?v=888ff710"></script>
<script src="../../_static/sphinx_highlight.js?v=4825356b"></script>
<link rel="index" title="Index" href="../../genindex.html" />
<link rel="search" title="Search" href="../../search.html" />
<link rel="next" title="Demo Offline Engine" href="demo/demo_offline.html" />
<link rel="prev" title="Z-Library" href="online/zlibrary.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="demo/demo_offline.html" title="Demo Offline Engine"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="online/zlibrary.html" title="Z-Library"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../../index.html">SearXNG Documentation (2023.8.11+905ce2a6f)</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../index.html" >Developer documentation</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="index.html" accesskey="U">Engine Implementations</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Offline Concept</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="offline-concept">
<h1>Offline Concept<a class="headerlink" href="#offline-concept" title="Permalink to this heading"></a></h1>
<aside class="sidebar">
<p class="sidebar-title">offline engines</p>
<ul class="simple">
<li><p><a class="reference internal" href="demo/demo_offline.html#demo-offline-engine"><span class="std std-ref">Demo Offline Engine</span></a></p></li>
<li><p><a class="reference internal" href="offline/command-line-engines.html#engine-command"><span class="std std-ref">Command Line Engines</span></a></p></li>
<li><p><a class="reference internal" href="offline/sql-engines.html#sql-engines"><span class="std std-ref">SQL Engines</span></a></p></li>
<li><p><a class="reference internal" href="offline/nosql-engines.html#nosql-engines"><span class="std std-ref">NoSQL databases</span></a></p></li>
<li><p><a class="reference internal" href="../../src/searx.search.processors.html#module-searx.search.processors.offline" title="searx.search.processors.offline"><code class="xref py py-obj docutils literal notranslate"><span class="pre">searx.search.processors.offline</span></code></a></p></li>
</ul>
</aside>
<p>To extend the functionality of SearXNG, offline engines are going to be
introduced. An offline engine is an engine which does not need Internet
connection to perform a search and does not use HTTP to communicate.</p>
<p>Offline engines can be configured, by adding those to the <cite>engines</cite> list of
<a class="reference external" href="https://github.com/searxng/searxng/blob/master/searx/settings.yml">settings.yml</a>. An example skeleton for offline
engines can be found in <a class="reference internal" href="demo/demo_offline.html#demo-offline-engine"><span class="std std-ref">Demo Offline Engine</span></a> (<a class="reference external" href="https://github.com/searxng/searxng/blob/master/searx/engines/demo_offline.py">demo_offline.py</a>).</p>
<section id="programming-interface">
<h2>Programming Interface<a class="headerlink" href="#programming-interface" title="Permalink to this heading"></a></h2>
<dl>
<dt><a class="reference internal" href="demo/demo_offline.html#searx.engines.demo_offline.init" title="searx.engines.demo_offline.init"><code class="xref py py-func docutils literal notranslate"><span class="pre">init(engine_settings=None)</span></code></a></dt><dd><p>All offline engines can have their own init function to setup the engine before
accepting requests. The function gets the settings from settings.yml as a
parameter. This function can be omitted, if there is no need to setup anything
in advance.</p>
</dd>
<dt><code class="xref py py-func docutils literal notranslate"><span class="pre">search(query,</span> <span class="pre">params)</span></code></dt><dd><p>Each offline engine has a function named <code class="docutils literal notranslate"><span class="pre">search</span></code>. This function is
responsible to perform a search and return the results in a presentable
format. (Where <em>presentable</em> means presentable by the selected result
template.)</p>
<p>The return value is a list of results retrieved by the engine.</p>
</dd>
<dt>Engine representation in <code class="docutils literal notranslate"><span class="pre">/config</span></code></dt><dd><p>If an engine is offline, the attribute <code class="docutils literal notranslate"><span class="pre">offline</span></code> is set to <code class="docutils literal notranslate"><span class="pre">True</span></code>.</p>
</dd>
</dl>
</section>
<section id="extra-dependencies">
<span id="offline-requirements"></span><h2>Extra Dependencies<a class="headerlink" href="#extra-dependencies" title="Permalink to this heading"></a></h2>
<p>If an offline engine depends on an external tool, SearXNG does not install it by
default. When an administrator configures such engine and starts the instance,
the process returns an error with the list of missing dependencies. Also,
required dependencies will be added to the comment/description of the engine, so
admins can install packages in advance.</p>
<p>If there is a need to install additional packages in <em>Pythons Virtual
Environment</em> of your SearXNG instance you need to switch into the environment
(<a class="reference internal" href="../../admin/installation-searxng.html#searxng-src"><span class="std std-ref">Install SearXNG &amp; dependencies</span></a>) first, for this you can use <a class="reference internal" href="../../utils/searxng.sh.html#searxng-sh"><span class="std std-ref">utils/searxng.sh</span></a>:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ sudo utils/searxng.sh instance cmd bash
(searxng-pyenv)$ pip install ...
</pre></div>
</div>
</section>
<section id="private-engines-security">
<h2>Private engines (Security)<a class="headerlink" href="#private-engines-security" title="Permalink to this heading"></a></h2>
<p>To limit the access to offline engines, if an instance is available publicly,
administrators can set token(s) for each of the <a class="reference internal" href="../../admin/settings/settings_engine.html#private-engines"><span class="std std-ref">Private Engines (tokens)</span></a>. If a
query contains a valid token, then SearXNG performs the requested private
search. If not, requests from an offline engines return errors.</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/searxng-wordmark.svg" alt="Logo"/>
</a></p>
<h3><a href="../../index.html">Table of Contents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../user/index.html">User information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../own-instance.html">Why use a private instance?</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../admin/index.html">Administrator documentation</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../index.html">Developer documentation</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../quickstart.html">Development Quickstart</a></li>
<li class="toctree-l2"><a class="reference internal" href="../contribution_guide.html">How to contribute</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="index.html">Engine Implementations</a></li>
<li class="toctree-l2"><a class="reference internal" href="../search_api.html">Search API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../plugins.html">Plugins</a></li>
<li class="toctree-l2"><a class="reference internal" href="../translation.html">Translation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../lxcdev.html">Developing in Linux Containers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../makefile.html">Makefile &amp; <code class="docutils literal notranslate"><span class="pre">./manage</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../reST.html">reST primer</a></li>
<li class="toctree-l2"><a class="reference internal" href="../searxng_extra/index.html">Tooling box <code class="docutils literal notranslate"><span class="pre">searxng_extra</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../utils/index.html">DevOps tooling box</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../src/index.html">Source-Code</a></li>
</ul>
<h3>Project Links</h3>
<ul>
<li><a href="https://github.com/searxng/searxng/tree/master">Source</a>
<li><a href="https://github.com/searxng/searxng/wiki">Wiki</a>
<li><a href="https://searx.space">Public instances</a>
<li><a href="https://github.com/searxng/searxng/issues">Issue Tracker</a>
</ul><h3>Navigation</h3>
<ul>
<li><a href="../../index.html">Overview</a>
<ul>
<li><a href="../index.html">Developer documentation</a>
<ul>
<li><a href="index.html">Engine Implementations</a>
<ul>
<li>Previous: <a href="online/zlibrary.html" title="previous chapter">Z-Library</a>
<li>Next: <a href="demo/demo_offline.html" title="next chapter">Demo Offline Engine</a></ul>
</li></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 role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../_sources/dev/engines/offline_concept.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright SearXNG team.
</div>
<script src="../../_static/version_warning_offset.js"></script>
</body>
</html>

View file

@ -0,0 +1,217 @@
<!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>Annas Archive &#8212; SearXNG Documentation (2023.8.11+905ce2a6f)</title>
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=4f649999" />
<link rel="stylesheet" type="text/css" href="../../../_static/searxng.css?v=52e4ff28" />
<link rel="stylesheet" type="text/css" href="../../../_static/tabs.css?v=a5c4661c" />
<script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js?v=3c88bde0"></script>
<script src="../../../_static/doctools.js?v=888ff710"></script>
<script src="../../../_static/sphinx_highlight.js?v=4825356b"></script>
<link rel="index" title="Index" href="../../../genindex.html" />
<link rel="search" title="Search" href="../../../search.html" />
<link rel="next" title="Arch Linux" href="archlinux.html" />
<link rel="prev" title="MediaWiki Engine" href="../mediawiki.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="archlinux.html" title="Arch Linux"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="../mediawiki.html" title="MediaWiki Engine"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">SearXNG Documentation (2023.8.11+905ce2a6f)</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../index.html" >Developer documentation</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="../index.html" accesskey="U">Engine Implementations</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Annas Archive</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="anna-s-archive">
<span id="annas-archive-engine"></span><h1>Annas Archive<a class="headerlink" href="#anna-s-archive" title="Permalink to this heading"></a></h1>
<nav class="contents local" id="contents">
<ul class="simple">
<li><p><a class="reference internal" href="#configuration" id="id2">Configuration</a></p></li>
<li><p><a class="reference internal" href="#implementations" id="id3">Implementations</a></p></li>
</ul>
</nav>
<span class="target" id="module-searx.engines.annas_archive"></span><p><a class="reference external" href="https://annas-archive.org/">Annas Archive</a> is a free non-profit online shadow library metasearch
engine providing access to a variety of book resources (also via IPFS), created
by a team of anonymous archivists (<a class="reference external" href="https://annas-software.org/AnnaArchivist/annas-archive">AnnaArchivist</a>).</p>
<section id="configuration">
<h2><a class="toc-backref" href="#id2" role="doc-backlink">Configuration</a><a class="headerlink" href="#configuration" title="Permalink to this heading"></a></h2>
<p>The engine has the following additional settings:</p>
<ul class="simple">
<li><p><a class="reference internal" href="#searx.engines.annas_archive.aa_content" title="searx.engines.annas_archive.aa_content"><code class="xref py py-obj docutils literal notranslate"><span class="pre">aa_content</span></code></a></p></li>
<li><p><a class="reference internal" href="#searx.engines.annas_archive.aa_ext" title="searx.engines.annas_archive.aa_ext"><code class="xref py py-obj docutils literal notranslate"><span class="pre">aa_ext</span></code></a></p></li>
<li><p><a class="reference internal" href="#searx.engines.annas_archive.aa_sort" title="searx.engines.annas_archive.aa_sort"><code class="xref py py-obj docutils literal notranslate"><span class="pre">aa_sort</span></code></a></p></li>
</ul>
<p>With this options a SearXNG maintainer is able to configure <strong>additional</strong>
engines for specific searches in Annas Archive. For example a engine to search
for <em>newest</em> articles and journals (PDF) / by shortcut <code class="docutils literal notranslate"><span class="pre">!aaa</span> <span class="pre">&lt;search-term&gt;</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">annas articles</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">annas_archive</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">aaa</span>
<span class="w"> </span><span class="nt">aa_content</span><span class="p">:</span><span class="w"> </span><span class="s">&#39;journal_article&#39;</span>
<span class="w"> </span><span class="nt">aa_ext</span><span class="p">:</span><span class="w"> </span><span class="s">&#39;pdf&#39;</span>
<span class="w"> </span><span class="nt">aa_sort</span><span class="p">:</span><span class="w"> </span><span class="s">&#39;newest&#39;</span>
</pre></div>
</div>
</section>
<section id="implementations">
<h2><a class="toc-backref" href="#id3" role="doc-backlink">Implementations</a><a class="headerlink" href="#implementations" title="Permalink to this heading"></a></h2>
</section>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.annas_archive.fetch_traits">
<span class="sig-prename descclassname"><span class="pre">searx.engines.annas_archive.</span></span><span class="sig-name descname"><span class="pre">fetch_traits</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">engine_traits</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="../enginelib.html#searx.enginelib.traits.EngineTraits" title="searx.enginelib.traits.EngineTraits"><span class="pre">EngineTraits</span></a></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/annas_archive.html#fetch_traits"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.annas_archive.fetch_traits" title="Permalink to this definition"></a></dt>
<dd><p>Fetch languages and other search arguments from Annas search form.</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.annas_archive.init">
<span class="sig-prename descclassname"><span class="pre">searx.engines.annas_archive.</span></span><span class="sig-name descname"><span class="pre">init</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">engine_settings</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/annas_archive.html#init"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.annas_archive.init" title="Permalink to this definition"></a></dt>
<dd><p>Check of engines settings.</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.annas_archive.aa_content">
<span class="sig-prename descclassname"><span class="pre">searx.engines.annas_archive.</span></span><span class="sig-name descname"><span class="pre">aa_content</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><span class="pre">str</span></a></em><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">''</span></em><a class="headerlink" href="#searx.engines.annas_archive.aa_content" title="Permalink to this definition"></a></dt>
<dd><p>Anans search form field <strong>Content</strong> / possible values:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">journal_article</span><span class="p">,</span> <span class="n">book_any</span><span class="p">,</span> <span class="n">book_fiction</span><span class="p">,</span> <span class="n">book_unknown</span><span class="p">,</span> <span class="n">book_nonfiction</span><span class="p">,</span>
<span class="n">book_comic</span><span class="p">,</span> <span class="n">magazine</span><span class="p">,</span> <span class="n">standards_document</span>
</pre></div>
</div>
<p>To not filter use an empty string (default).</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.annas_archive.aa_ext">
<span class="sig-prename descclassname"><span class="pre">searx.engines.annas_archive.</span></span><span class="sig-name descname"><span class="pre">aa_ext</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><span class="pre">str</span></a></em><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">''</span></em><a class="headerlink" href="#searx.engines.annas_archive.aa_ext" title="Permalink to this definition"></a></dt>
<dd><p>Filter Annas results by a file ending. Common filters for example are
<code class="docutils literal notranslate"><span class="pre">pdf</span></code> and <code class="docutils literal notranslate"><span class="pre">epub</span></code>.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Annas Archive is a beta release: Filter results by file extension does not
really work on Annas Archive.</p>
</div>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.annas_archive.aa_sort">
<span class="sig-prename descclassname"><span class="pre">searx.engines.annas_archive.</span></span><span class="sig-name descname"><span class="pre">aa_sort</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><span class="pre">str</span></a></em><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">''</span></em><a class="headerlink" href="#searx.engines.annas_archive.aa_sort" title="Permalink to this definition"></a></dt>
<dd><p>Sort Annas results, possible values:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">newest</span><span class="p">,</span> <span class="n">oldest</span><span class="p">,</span> <span class="n">largest</span><span class="p">,</span> <span class="n">smallest</span>
</pre></div>
</div>
<p>To sort by <em>most relevant</em> use an empty string (default).</p>
</dd></dl>
</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/searxng-wordmark.svg" alt="Logo"/>
</a></p>
<h3><a href="../../../index.html">Table of Contents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../user/index.html">User information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../own-instance.html">Why use a private instance?</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../admin/index.html">Administrator documentation</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../index.html">Developer documentation</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../quickstart.html">Development Quickstart</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../contribution_guide.html">How to contribute</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../index.html">Engine Implementations</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../search_api.html">Search API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../plugins.html">Plugins</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../translation.html">Translation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../lxcdev.html">Developing in Linux Containers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../makefile.html">Makefile &amp; <code class="docutils literal notranslate"><span class="pre">./manage</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../reST.html">reST primer</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../searxng_extra/index.html">Tooling box <code class="docutils literal notranslate"><span class="pre">searxng_extra</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../utils/index.html">DevOps tooling box</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../src/index.html">Source-Code</a></li>
</ul>
<h3>Project Links</h3>
<ul>
<li><a href="https://github.com/searxng/searxng/tree/master">Source</a>
<li><a href="https://github.com/searxng/searxng/wiki">Wiki</a>
<li><a href="https://searx.space">Public instances</a>
<li><a href="https://github.com/searxng/searxng/issues">Issue Tracker</a>
</ul><h3>Navigation</h3>
<ul>
<li><a href="../../../index.html">Overview</a>
<ul>
<li><a href="../../index.html">Developer documentation</a>
<ul>
<li><a href="../index.html">Engine Implementations</a>
<ul>
<li>Previous: <a href="../mediawiki.html" title="previous chapter">MediaWiki Engine</a>
<li>Next: <a href="archlinux.html" title="next chapter">Arch Linux</a></ul>
</li></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 role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../../_sources/dev/engines/online/annas_archive.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright SearXNG team.
</div>
<script src="../../../_static/version_warning_offset.js"></script>
</body>
</html>

View file

@ -0,0 +1,172 @@
<!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>Arch Linux &#8212; SearXNG Documentation (2023.8.11+905ce2a6f)</title>
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=4f649999" />
<link rel="stylesheet" type="text/css" href="../../../_static/searxng.css?v=52e4ff28" />
<link rel="stylesheet" type="text/css" href="../../../_static/tabs.css?v=a5c4661c" />
<script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js?v=3c88bde0"></script>
<script src="../../../_static/doctools.js?v=888ff710"></script>
<script src="../../../_static/sphinx_highlight.js?v=4825356b"></script>
<link rel="index" title="Index" href="../../../genindex.html" />
<link rel="search" title="Search" href="../../../search.html" />
<link rel="next" title="Bing Engines" href="bing.html" />
<link rel="prev" title="Annas Archive" href="annas_archive.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="bing.html" title="Bing Engines"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="annas_archive.html" title="Annas Archive"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">SearXNG Documentation (2023.8.11+905ce2a6f)</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../index.html" >Developer documentation</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="../index.html" accesskey="U">Engine Implementations</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Arch Linux</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="arch-linux">
<span id="archlinux-engine"></span><h1>Arch Linux<a class="headerlink" href="#arch-linux" title="Permalink to this heading"></a></h1>
<nav class="contents local" id="contents">
<ul class="simple">
<li><p><a class="reference internal" href="#arch-linux-wiki" id="id1">Arch Linux Wiki</a></p></li>
</ul>
</nav>
<span class="target" id="module-searx.engines.archlinux"></span><section id="arch-linux-wiki">
<h2><a class="toc-backref" href="#id1" role="doc-backlink">Arch Linux Wiki</a><a class="headerlink" href="#arch-linux-wiki" title="Permalink to this heading"></a></h2>
<p>This implementation does not use a official API: Mediawiki provides API, but
Arch Wiki blocks access to it.</p>
</section>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.archlinux.fetch_traits">
<span class="sig-prename descclassname"><span class="pre">searx.engines.archlinux.</span></span><span class="sig-name descname"><span class="pre">fetch_traits</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">engine_traits</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="../enginelib.html#searx.enginelib.traits.EngineTraits" title="searx.enginelib.traits.EngineTraits"><span class="pre">EngineTraits</span></a></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/archlinux.html#fetch_traits"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.archlinux.fetch_traits" title="Permalink to this definition"></a></dt>
<dd><p>Fetch languages from Archlinix-Wiki. The location of the Wiki address of a
language is mapped in a <a class="reference internal" href="../enginelib.html#searx.enginelib.traits.EngineTraits.custom" title="searx.enginelib.traits.EngineTraits.custom"><code class="xref py py-obj docutils literal notranslate"><span class="pre">custom</span> <span class="pre">field</span></code></a> (<code class="docutils literal notranslate"><span class="pre">wiki_netloc</span></code>). Depending
on the location, the <code class="docutils literal notranslate"><span class="pre">title</span></code> argument in the request is translated.</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="s2">&quot;custom&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;wiki_netloc&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;de&quot;</span><span class="p">:</span> <span class="s2">&quot;wiki.archlinux.de&quot;</span><span class="p">,</span>
<span class="c1"># ...</span>
<span class="s2">&quot;zh&quot;</span><span class="p">:</span> <span class="s2">&quot;wiki.archlinuxcn.org&quot;</span>
<span class="p">}</span>
<span class="s2">&quot;title&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;de&quot;</span><span class="p">:</span> <span class="s2">&quot;Spezial:Suche&quot;</span><span class="p">,</span>
<span class="c1"># ...</span>
<span class="s2">&quot;zh&quot;</span><span class="p">:</span> <span class="s2">&quot;Special:搜索&quot;</span>
<span class="p">},</span>
<span class="p">},</span>
</pre></div>
</div>
</dd></dl>
</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/searxng-wordmark.svg" alt="Logo"/>
</a></p>
<h3><a href="../../../index.html">Table of Contents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../user/index.html">User information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../own-instance.html">Why use a private instance?</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../admin/index.html">Administrator documentation</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../index.html">Developer documentation</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../quickstart.html">Development Quickstart</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../contribution_guide.html">How to contribute</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../index.html">Engine Implementations</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../search_api.html">Search API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../plugins.html">Plugins</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../translation.html">Translation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../lxcdev.html">Developing in Linux Containers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../makefile.html">Makefile &amp; <code class="docutils literal notranslate"><span class="pre">./manage</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../reST.html">reST primer</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../searxng_extra/index.html">Tooling box <code class="docutils literal notranslate"><span class="pre">searxng_extra</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../utils/index.html">DevOps tooling box</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../src/index.html">Source-Code</a></li>
</ul>
<h3>Project Links</h3>
<ul>
<li><a href="https://github.com/searxng/searxng/tree/master">Source</a>
<li><a href="https://github.com/searxng/searxng/wiki">Wiki</a>
<li><a href="https://searx.space">Public instances</a>
<li><a href="https://github.com/searxng/searxng/issues">Issue Tracker</a>
</ul><h3>Navigation</h3>
<ul>
<li><a href="../../../index.html">Overview</a>
<ul>
<li><a href="../../index.html">Developer documentation</a>
<ul>
<li><a href="../index.html">Engine Implementations</a>
<ul>
<li>Previous: <a href="annas_archive.html" title="previous chapter">Annas Archive</a>
<li>Next: <a href="bing.html" title="next chapter">Bing Engines</a></ul>
</li></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 role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../../_sources/dev/engines/online/archlinux.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright SearXNG team.
</div>
<script src="../../../_static/version_warning_offset.js"></script>
</body>
</html>

View file

@ -0,0 +1,325 @@
<!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>Bing Engines &#8212; SearXNG Documentation (2023.8.11+905ce2a6f)</title>
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=4f649999" />
<link rel="stylesheet" type="text/css" href="../../../_static/searxng.css?v=52e4ff28" />
<link rel="stylesheet" type="text/css" href="../../../_static/tabs.css?v=a5c4661c" />
<script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js?v=3c88bde0"></script>
<script src="../../../_static/doctools.js?v=888ff710"></script>
<script src="../../../_static/sphinx_highlight.js?v=4825356b"></script>
<link rel="index" title="Index" href="../../../genindex.html" />
<link rel="search" title="Search" href="../../../search.html" />
<link rel="next" title="Brave Engines" href="brave.html" />
<link rel="prev" title="Arch Linux" href="archlinux.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="brave.html" title="Brave Engines"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="archlinux.html" title="Arch Linux"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">SearXNG Documentation (2023.8.11+905ce2a6f)</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../index.html" >Developer documentation</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="../index.html" accesskey="U">Engine Implementations</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Bing Engines</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="bing-engines">
<span id="id1"></span><h1>Bing Engines<a class="headerlink" href="#bing-engines" title="Permalink to this heading"></a></h1>
<nav class="contents local" id="contents">
<ul class="simple">
<li><p><a class="reference internal" href="#module-searx.engines.bing" id="id2">Bing WEB</a></p></li>
<li><p><a class="reference internal" href="#module-searx.engines.bing_images" id="id3">Bing Images</a></p></li>
<li><p><a class="reference internal" href="#module-searx.engines.bing_videos" id="id4">Bing Videos</a></p></li>
<li><p><a class="reference internal" href="#module-searx.engines.bing_news" id="id5">Bing News</a></p></li>
</ul>
</nav>
<section id="module-searx.engines.bing">
<span id="bing-web"></span><span id="bing-web-engine"></span><h2><a class="toc-backref" href="#id2" role="doc-backlink">Bing WEB</a><a class="headerlink" href="#module-searx.engines.bing" title="Permalink to this heading"></a></h2>
<p>This is the implementation of the Bing-WEB engine. Some of this
implementations are shared by other engines:</p>
<ul class="simple">
<li><p><a class="reference internal" href="#bing-images-engine"><span class="std std-ref">Bing Images</span></a></p></li>
<li><p><a class="reference internal" href="#bing-news-engine"><span class="std std-ref">Bing News</span></a></p></li>
<li><p><a class="reference internal" href="#bing-videos-engine"><span class="std std-ref">Bing Videos</span></a></p></li>
</ul>
<p>On the <a class="reference external" href="https://www.bing.com/account/general">preference page</a> Bing offers a lot of languages an regions (see section
Search results languages and Country/region). However, the abundant choice
does not correspond to reality, where Bing has a full-text indexer only for a
limited number of languages. By example: you can select a language like Māori
but you never get a result in this language.</p>
<p>What comes a bit closer to the truth are the <a class="reference external" href="https://learn.microsoft.com/en-us/bing/search-apis/">search-APIs</a> but they don`t seem
to be completely correct either (if you take a closer look you will find some
inaccuracies there too):</p>
<ul class="simple">
<li><p><a class="reference internal" href="#searx.engines.bing.bing_traits_url" title="searx.engines.bing.bing_traits_url"><code class="xref py py-obj docutils literal notranslate"><span class="pre">searx.engines.bing.bing_traits_url</span></code></a></p></li>
<li><p><a class="reference internal" href="#searx.engines.bing_videos.bing_traits_url" title="searx.engines.bing_videos.bing_traits_url"><code class="xref py py-obj docutils literal notranslate"><span class="pre">searx.engines.bing_videos.bing_traits_url</span></code></a></p></li>
<li><p><a class="reference internal" href="#searx.engines.bing_images.bing_traits_url" title="searx.engines.bing_images.bing_traits_url"><code class="xref py py-obj docutils literal notranslate"><span class="pre">searx.engines.bing_images.bing_traits_url</span></code></a></p></li>
<li><p><a class="reference internal" href="#searx.engines.bing_news.bing_traits_url" title="searx.engines.bing_news.bing_traits_url"><code class="xref py py-obj docutils literal notranslate"><span class="pre">searx.engines.bing_news.bing_traits_url</span></code></a></p></li>
</ul>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.bing.fetch_traits">
<span class="sig-prename descclassname"><span class="pre">searx.engines.bing.</span></span><span class="sig-name descname"><span class="pre">fetch_traits</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">engine_traits</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="../enginelib.html#searx.enginelib.traits.EngineTraits" title="searx.enginelib.traits.EngineTraits"><span class="pre">EngineTraits</span></a></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/bing.html#fetch_traits"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.bing.fetch_traits" title="Permalink to this definition"></a></dt>
<dd><p>Fetch languages and regions from Bing-Web.</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.bing.request">
<span class="sig-prename descclassname"><span class="pre">searx.engines.bing.</span></span><span class="sig-name descname"><span class="pre">request</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">query</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">params</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/bing.html#request"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.bing.request" title="Permalink to this definition"></a></dt>
<dd><p>Assemble a Bing-Web request.</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.bing.base_url">
<span class="sig-prename descclassname"><span class="pre">searx.engines.bing.</span></span><span class="sig-name descname"><span class="pre">base_url</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'https://www.bing.com/search'</span></em><a class="headerlink" href="#searx.engines.bing.base_url" title="Permalink to this definition"></a></dt>
<dd><p>Bing (Web) search URL</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.bing.bing_traits_url">
<span class="sig-prename descclassname"><span class="pre">searx.engines.bing.</span></span><span class="sig-name descname"><span class="pre">bing_traits_url</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'https://learn.microsoft.com/en-us/bing/search-apis/bing-web-search/reference/market-codes'</span></em><a class="headerlink" href="#searx.engines.bing.bing_traits_url" title="Permalink to this definition"></a></dt>
<dd><p>Bing (Web) search API description</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.bing.send_accept_language_header">
<span class="sig-prename descclassname"><span class="pre">searx.engines.bing.</span></span><span class="sig-name descname"><span class="pre">send_accept_language_header</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">True</span></em><a class="headerlink" href="#searx.engines.bing.send_accept_language_header" title="Permalink to this definition"></a></dt>
<dd><p>Bing tries to guess users language and territory from the HTTP
Accept-Language. Optional the user can select a search-language (can be
different to the UI language) and a region (market code).</p>
</dd></dl>
</section>
<section id="module-searx.engines.bing_images">
<span id="bing-images"></span><span id="bing-images-engine"></span><h2><a class="toc-backref" href="#id3" role="doc-backlink">Bing Images</a><a class="headerlink" href="#module-searx.engines.bing_images" title="Permalink to this heading"></a></h2>
<p>Bing-Images: description see <a class="reference internal" href="#module-searx.engines.bing" title="searx.engines.bing"><code class="xref py py-obj docutils literal notranslate"><span class="pre">searx.engines.bing</span></code></a>.</p>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.bing_images.fetch_traits">
<span class="sig-prename descclassname"><span class="pre">searx.engines.bing_images.</span></span><span class="sig-name descname"><span class="pre">fetch_traits</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">engine_traits</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="../enginelib.html#searx.enginelib.traits.EngineTraits" title="searx.enginelib.traits.EngineTraits"><span class="pre">EngineTraits</span></a></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/bing_images.html#fetch_traits"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.bing_images.fetch_traits" title="Permalink to this definition"></a></dt>
<dd><p>Fetch languages and regions from Bing-News.</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.bing_images.request">
<span class="sig-prename descclassname"><span class="pre">searx.engines.bing_images.</span></span><span class="sig-name descname"><span class="pre">request</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">query</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">params</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/bing_images.html#request"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.bing_images.request" title="Permalink to this definition"></a></dt>
<dd><p>Assemble a Bing-Image request.</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.bing_images.response">
<span class="sig-prename descclassname"><span class="pre">searx.engines.bing_images.</span></span><span class="sig-name descname"><span class="pre">response</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">resp</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/bing_images.html#response"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.bing_images.response" title="Permalink to this definition"></a></dt>
<dd><p>Get response from Bing-Images</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.bing_images.base_url">
<span class="sig-prename descclassname"><span class="pre">searx.engines.bing_images.</span></span><span class="sig-name descname"><span class="pre">base_url</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'https://www.bing.com/images/async'</span></em><a class="headerlink" href="#searx.engines.bing_images.base_url" title="Permalink to this definition"></a></dt>
<dd><p>Bing (Images) search URL</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.bing_images.bing_traits_url">
<span class="sig-prename descclassname"><span class="pre">searx.engines.bing_images.</span></span><span class="sig-name descname"><span class="pre">bing_traits_url</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'https://learn.microsoft.com/en-us/bing/search-apis/bing-image-search/reference/market-codes'</span></em><a class="headerlink" href="#searx.engines.bing_images.bing_traits_url" title="Permalink to this definition"></a></dt>
<dd><p>Bing (Images) search API description</p>
</dd></dl>
</section>
<section id="module-searx.engines.bing_videos">
<span id="bing-videos"></span><span id="bing-videos-engine"></span><h2><a class="toc-backref" href="#id4" role="doc-backlink">Bing Videos</a><a class="headerlink" href="#module-searx.engines.bing_videos" title="Permalink to this heading"></a></h2>
<p>Bing-Videos: description see <a class="reference internal" href="#module-searx.engines.bing" title="searx.engines.bing"><code class="xref py py-obj docutils literal notranslate"><span class="pre">searx.engines.bing</span></code></a>.</p>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.bing_videos.fetch_traits">
<span class="sig-prename descclassname"><span class="pre">searx.engines.bing_videos.</span></span><span class="sig-name descname"><span class="pre">fetch_traits</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">engine_traits</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="../enginelib.html#searx.enginelib.traits.EngineTraits" title="searx.enginelib.traits.EngineTraits"><span class="pre">EngineTraits</span></a></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/bing_videos.html#fetch_traits"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.bing_videos.fetch_traits" title="Permalink to this definition"></a></dt>
<dd><p>Fetch languages and regions from Bing-Videos.</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.bing_videos.request">
<span class="sig-prename descclassname"><span class="pre">searx.engines.bing_videos.</span></span><span class="sig-name descname"><span class="pre">request</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">query</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">params</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/bing_videos.html#request"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.bing_videos.request" title="Permalink to this definition"></a></dt>
<dd><p>Assemble a Bing-Video request.</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.bing_videos.response">
<span class="sig-prename descclassname"><span class="pre">searx.engines.bing_videos.</span></span><span class="sig-name descname"><span class="pre">response</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">resp</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/bing_videos.html#response"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.bing_videos.response" title="Permalink to this definition"></a></dt>
<dd><p>Get response from Bing-Video</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.bing_videos.base_url">
<span class="sig-prename descclassname"><span class="pre">searx.engines.bing_videos.</span></span><span class="sig-name descname"><span class="pre">base_url</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'https://www.bing.com/videos/asyncv2'</span></em><a class="headerlink" href="#searx.engines.bing_videos.base_url" title="Permalink to this definition"></a></dt>
<dd><p>Bing (Videos) async search URL.</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.bing_videos.bing_traits_url">
<span class="sig-prename descclassname"><span class="pre">searx.engines.bing_videos.</span></span><span class="sig-name descname"><span class="pre">bing_traits_url</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'https://learn.microsoft.com/en-us/bing/search-apis/bing-video-search/reference/market-codes'</span></em><a class="headerlink" href="#searx.engines.bing_videos.bing_traits_url" title="Permalink to this definition"></a></dt>
<dd><p>Bing (Video) search API description</p>
</dd></dl>
</section>
<section id="module-searx.engines.bing_news">
<span id="bing-news"></span><span id="bing-news-engine"></span><h2><a class="toc-backref" href="#id5" role="doc-backlink">Bing News</a><a class="headerlink" href="#module-searx.engines.bing_news" title="Permalink to this heading"></a></h2>
<p>Bing-News: description see <a class="reference internal" href="#module-searx.engines.bing" title="searx.engines.bing"><code class="xref py py-obj docutils literal notranslate"><span class="pre">searx.engines.bing</span></code></a>.</p>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.bing_news.fetch_traits">
<span class="sig-prename descclassname"><span class="pre">searx.engines.bing_news.</span></span><span class="sig-name descname"><span class="pre">fetch_traits</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">engine_traits</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="../enginelib.html#searx.enginelib.traits.EngineTraits" title="searx.enginelib.traits.EngineTraits"><span class="pre">EngineTraits</span></a></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/bing_news.html#fetch_traits"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.bing_news.fetch_traits" title="Permalink to this definition"></a></dt>
<dd><p>Fetch languages and regions from Bing-News.</p>
<p>The <a class="reference internal" href="#searx.engines.bing_news.bing_traits_url" title="searx.engines.bing_news.bing_traits_url"><code class="xref py py-obj docutils literal notranslate"><span class="pre">description</span></code></a> of the
first table says <em>“query parameter when calling the Video Search API.”</em>
.. thats why I use the 4. table “News Category API markets” for the
<code class="docutils literal notranslate"><span class="pre">xpath_market_codes</span></code>.</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.bing_news.request">
<span class="sig-prename descclassname"><span class="pre">searx.engines.bing_news.</span></span><span class="sig-name descname"><span class="pre">request</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">query</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">params</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/bing_news.html#request"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.bing_news.request" title="Permalink to this definition"></a></dt>
<dd><p>Assemble a Bing-News request.</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.bing_news.response">
<span class="sig-prename descclassname"><span class="pre">searx.engines.bing_news.</span></span><span class="sig-name descname"><span class="pre">response</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">resp</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/bing_news.html#response"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.bing_news.response" title="Permalink to this definition"></a></dt>
<dd><p>Get response from Bing-Video</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.bing_news.base_url">
<span class="sig-prename descclassname"><span class="pre">searx.engines.bing_news.</span></span><span class="sig-name descname"><span class="pre">base_url</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'https://www.bing.com/news/infinitescrollajax'</span></em><a class="headerlink" href="#searx.engines.bing_news.base_url" title="Permalink to this definition"></a></dt>
<dd><p>Bing (News) search URL</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.bing_news.bing_traits_url">
<span class="sig-prename descclassname"><span class="pre">searx.engines.bing_news.</span></span><span class="sig-name descname"><span class="pre">bing_traits_url</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'https://learn.microsoft.com/en-us/bing/search-apis/bing-news-search/reference/market-codes'</span></em><a class="headerlink" href="#searx.engines.bing_news.bing_traits_url" title="Permalink to this definition"></a></dt>
<dd><p>Bing (News) search API description</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.bing_news.mkt_alias">
<span class="sig-prename descclassname"><span class="pre">searx.engines.bing_news.</span></span><span class="sig-name descname"><span class="pre">mkt_alias</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">{'zh':</span> <span class="pre">'en-WW',</span> <span class="pre">'zh-CN':</span> <span class="pre">'en-WW'}</span></em><a class="headerlink" href="#searx.engines.bing_news.mkt_alias" title="Permalink to this definition"></a></dt>
<dd><p>Bing News has an official market code zh-CN but we wont get a result with
this market code. For zh and zh-CN we better use the <em>Worldwide aggregate</em>
market code (en-WW).</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.bing_news.time_map">
<span class="sig-prename descclassname"><span class="pre">searx.engines.bing_news.</span></span><span class="sig-name descname"><span class="pre">time_map</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">{'day':</span> <span class="pre">'4',</span> <span class="pre">'month':</span> <span class="pre">'9',</span> <span class="pre">'week':</span> <span class="pre">'8'}</span></em><a class="headerlink" href="#searx.engines.bing_news.time_map" title="Permalink to this definition"></a></dt>
<dd><p>A string 4 means <em>last hour</em>. We use <em>last hour</em> for <code class="docutils literal notranslate"><span class="pre">day</span></code> here since the
difference of <em>last day</em> and <em>last week</em> in the result list is just marginally.</p>
</dd></dl>
</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/searxng-wordmark.svg" alt="Logo"/>
</a></p>
<h3><a href="../../../index.html">Table of Contents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../user/index.html">User information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../own-instance.html">Why use a private instance?</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../admin/index.html">Administrator documentation</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../index.html">Developer documentation</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../quickstart.html">Development Quickstart</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../contribution_guide.html">How to contribute</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../index.html">Engine Implementations</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../search_api.html">Search API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../plugins.html">Plugins</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../translation.html">Translation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../lxcdev.html">Developing in Linux Containers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../makefile.html">Makefile &amp; <code class="docutils literal notranslate"><span class="pre">./manage</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../reST.html">reST primer</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../searxng_extra/index.html">Tooling box <code class="docutils literal notranslate"><span class="pre">searxng_extra</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../utils/index.html">DevOps tooling box</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../src/index.html">Source-Code</a></li>
</ul>
<h3>Project Links</h3>
<ul>
<li><a href="https://github.com/searxng/searxng/tree/master">Source</a>
<li><a href="https://github.com/searxng/searxng/wiki">Wiki</a>
<li><a href="https://searx.space">Public instances</a>
<li><a href="https://github.com/searxng/searxng/issues">Issue Tracker</a>
</ul><h3>Navigation</h3>
<ul>
<li><a href="../../../index.html">Overview</a>
<ul>
<li><a href="../../index.html">Developer documentation</a>
<ul>
<li><a href="../index.html">Engine Implementations</a>
<ul>
<li>Previous: <a href="archlinux.html" title="previous chapter">Arch Linux</a>
<li>Next: <a href="brave.html" title="next chapter">Brave Engines</a></ul>
</li></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 role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../../_sources/dev/engines/online/bing.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright SearXNG team.
</div>
<script src="../../../_static/version_warning_offset.js"></script>
</body>
</html>

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>Brave Engines &#8212; SearXNG Documentation (2023.8.11+905ce2a6f)</title>
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=4f649999" />
<link rel="stylesheet" type="text/css" href="../../../_static/searxng.css?v=52e4ff28" />
<link rel="stylesheet" type="text/css" href="../../../_static/tabs.css?v=a5c4661c" />
<script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js?v=3c88bde0"></script>
<script src="../../../_static/doctools.js?v=888ff710"></script>
<script src="../../../_static/sphinx_highlight.js?v=4825356b"></script>
<link rel="index" title="Index" href="../../../genindex.html" />
<link rel="search" title="Search" href="../../../search.html" />
<link rel="next" title="BT4G" href="bt4g.html" />
<link rel="prev" title="Bing Engines" href="bing.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="bt4g.html" title="BT4G"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="bing.html" title="Bing Engines"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">SearXNG Documentation (2023.8.11+905ce2a6f)</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../index.html" >Developer documentation</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="../index.html" accesskey="U">Engine Implementations</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Brave Engines</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="brave-engines">
<span id="brave-engine"></span><h1>Brave Engines<a class="headerlink" href="#brave-engines" title="Permalink to this heading"></a></h1>
<nav class="contents local" id="contents">
<p class="topic-title">Contents</p>
<ul class="simple">
<li><p><a class="reference internal" href="#brave-regions" id="id3">Brave regions</a></p></li>
<li><p><a class="reference internal" href="#brave-languages" id="id4">Brave languages</a></p></li>
<li><p><a class="reference internal" href="#implementations" id="id5">Implementations</a></p></li>
</ul>
</nav>
<span class="target" id="module-searx.engines.brave"></span><p>Brave supports the categories listed in <a class="reference internal" href="#searx.engines.brave.brave_category" title="searx.engines.brave.brave_category"><code class="xref py py-obj docutils literal notranslate"><span class="pre">brave_category</span></code></a> (General,
news, videos, images). The support of <a class="reference internal" href="#searx.engines.brave.paging" title="searx.engines.brave.paging"><code class="xref py py-obj docutils literal notranslate"><span class="pre">paging</span></code></a> and <a class="reference internal" href="#searx.engines.brave.time_range_support" title="searx.engines.brave.time_range_support"><code class="xref py py-obj docutils literal notranslate"><span class="pre">time</span> <span class="pre">range</span></code></a> is limited (see remarks).</p>
<p>Configured <code class="docutils literal notranslate"><span class="pre">brave</span></code> engines:</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">brave</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">brave</span>
<span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">...</span>
<span class="w"> </span><span class="nt">brave_category</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">search</span>
<span class="w"> </span><span class="nt">time_range_support</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="nt">paging</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</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">brave.images</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">brave</span>
<span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">...</span>
<span class="w"> </span><span class="nt">brave_category</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">images</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">brave.videos</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">brave</span>
<span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">...</span>
<span class="w"> </span><span class="nt">brave_category</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">videos</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">brave.news</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">brave</span>
<span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">...</span>
<span class="w"> </span><span class="nt">brave_category</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">news</span>
</pre></div>
</div>
<section id="brave-regions">
<span id="id1"></span><h2><a class="toc-backref" href="#id3" role="doc-backlink">Brave regions</a><a class="headerlink" href="#brave-regions" title="Permalink to this heading"></a></h2>
<p>Brave uses two-digit tags for the regions like <code class="docutils literal notranslate"><span class="pre">ca</span></code> while SearXNG deals with
locales. To get a mapping, all <em>officatl de-facto</em> languages of the Brave
region are mapped to regions in SearXNG (see <a class="reference external" href="https://babel.readthedocs.io/en/latest/api/languages.html#babel.languages.get_official_languages" title="(in Babel v2.2)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">babel</span></code></a>):</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="s2">&quot;regions&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="o">..</span>
<span class="s2">&quot;en-CA&quot;</span><span class="p">:</span> <span class="s2">&quot;ca&quot;</span><span class="p">,</span>
<span class="s2">&quot;fr-CA&quot;</span><span class="p">:</span> <span class="s2">&quot;ca&quot;</span><span class="p">,</span>
<span class="o">..</span>
<span class="p">}</span>
</pre></div>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>The language (aka region) support of Braves index is limited to very basic
languages. The search results for languages like Chinese or Arabic are of
low quality.</p>
</div>
</section>
<section id="brave-languages">
<span id="id2"></span><h2><a class="toc-backref" href="#id4" role="doc-backlink">Brave languages</a><a class="headerlink" href="#brave-languages" title="Permalink to this heading"></a></h2>
<p>Braves language support is limited to the UI (menues, area local notations,
etc). Braves index only seems to support a locale, but it does not seem to
support any languages in its index. The choice of available languages is very
small (and its not clear to me where the differencee in UI is when switching
from en-us to en-ca or en-gb).</p>
<p>In the <a class="reference internal" href="../enginelib.html#searx.enginelib.traits.EngineTraits" title="searx.enginelib.traits.EngineTraits"><code class="xref py py-obj docutils literal notranslate"><span class="pre">EngineTraits</span> <span class="pre">object</span></code></a> the
UI languages are stored in a custom field named <code class="docutils literal notranslate"><span class="pre">ui_lang</span></code>:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="s2">&quot;custom&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;ui_lang&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;ca&quot;</span><span class="p">:</span> <span class="s2">&quot;ca&quot;</span><span class="p">,</span>
<span class="s2">&quot;de-DE&quot;</span><span class="p">:</span> <span class="s2">&quot;de-de&quot;</span><span class="p">,</span>
<span class="s2">&quot;en-CA&quot;</span><span class="p">:</span> <span class="s2">&quot;en-ca&quot;</span><span class="p">,</span>
<span class="s2">&quot;en-GB&quot;</span><span class="p">:</span> <span class="s2">&quot;en-gb&quot;</span><span class="p">,</span>
<span class="s2">&quot;en-US&quot;</span><span class="p">:</span> <span class="s2">&quot;en-us&quot;</span><span class="p">,</span>
<span class="s2">&quot;es&quot;</span><span class="p">:</span> <span class="s2">&quot;es&quot;</span><span class="p">,</span>
<span class="s2">&quot;fr-CA&quot;</span><span class="p">:</span> <span class="s2">&quot;fr-ca&quot;</span><span class="p">,</span>
<span class="s2">&quot;fr-FR&quot;</span><span class="p">:</span> <span class="s2">&quot;fr-fr&quot;</span><span class="p">,</span>
<span class="s2">&quot;ja-JP&quot;</span><span class="p">:</span> <span class="s2">&quot;ja-jp&quot;</span><span class="p">,</span>
<span class="s2">&quot;pt-BR&quot;</span><span class="p">:</span> <span class="s2">&quot;pt-br&quot;</span><span class="p">,</span>
<span class="s2">&quot;sq-AL&quot;</span><span class="p">:</span> <span class="s2">&quot;sq-al&quot;</span>
<span class="p">}</span>
<span class="p">},</span>
</pre></div>
</div>
</section>
<section id="implementations">
<h2><a class="toc-backref" href="#id5" role="doc-backlink">Implementations</a><a class="headerlink" href="#implementations" title="Permalink to this heading"></a></h2>
</section>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.brave.fetch_traits">
<span class="sig-prename descclassname"><span class="pre">searx.engines.brave.</span></span><span class="sig-name descname"><span class="pre">fetch_traits</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">engine_traits</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="../enginelib.html#searx.enginelib.traits.EngineTraits" title="searx.enginelib.traits.EngineTraits"><span class="pre">EngineTraits</span></a></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/brave.html#fetch_traits"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.brave.fetch_traits" title="Permalink to this definition"></a></dt>
<dd><p>Fetch <a class="reference internal" href="#brave-languages"><span class="std std-ref">languages</span></a> and <a class="reference internal" href="#brave-regions"><span class="std std-ref">regions</span></a> from Brave.</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.brave.brave_category">
<span class="sig-prename descclassname"><span class="pre">searx.engines.brave.</span></span><span class="sig-name descname"><span class="pre">brave_category</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'search'</span></em><a class="headerlink" href="#searx.engines.brave.brave_category" title="Permalink to this definition"></a></dt>
<dd><p>Brave supports common web-search, video search, image and video search.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">search</span></code>: Common WEB search</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">videos</span></code>: search for videos</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">images</span></code>: search for images</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">news</span></code>: search for news</p></li>
</ul>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.brave.brave_spellcheck">
<span class="sig-prename descclassname"><span class="pre">searx.engines.brave.</span></span><span class="sig-name descname"><span class="pre">brave_spellcheck</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">False</span></em><a class="headerlink" href="#searx.engines.brave.brave_spellcheck" title="Permalink to this definition"></a></dt>
<dd><p>Brave supports some kind of spell checking. When activated, Brave tries to
fix typos, e.g. it searches for <code class="docutils literal notranslate"><span class="pre">food</span></code> when the user queries for <code class="docutils literal notranslate"><span class="pre">fooh</span></code>. In
the UI of Brave the user gets warned about this, since we can not warn the user
in SearXNG, the spellchecking is disabled by default.</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.brave.paging">
<span class="sig-prename descclassname"><span class="pre">searx.engines.brave.</span></span><span class="sig-name descname"><span class="pre">paging</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">False</span></em><a class="headerlink" href="#searx.engines.brave.paging" title="Permalink to this definition"></a></dt>
<dd><p>Brave only supports paging in <a class="reference internal" href="#searx.engines.brave.brave_category" title="searx.engines.brave.brave_category"><code class="xref py py-obj docutils literal notranslate"><span class="pre">brave_category</span></code></a> <code class="docutils literal notranslate"><span class="pre">search</span></code> (UI
category All).</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.brave.time_range_support">
<span class="sig-prename descclassname"><span class="pre">searx.engines.brave.</span></span><span class="sig-name descname"><span class="pre">time_range_support</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">False</span></em><a class="headerlink" href="#searx.engines.brave.time_range_support" title="Permalink to this definition"></a></dt>
<dd><p>Brave only supports time-range in <a class="reference internal" href="#searx.engines.brave.brave_category" title="searx.engines.brave.brave_category"><code class="xref py py-obj docutils literal notranslate"><span class="pre">brave_category</span></code></a> <code class="docutils literal notranslate"><span class="pre">search</span></code> (UI
category All).</p>
</dd></dl>
</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/searxng-wordmark.svg" alt="Logo"/>
</a></p>
<h3><a href="../../../index.html">Table of Contents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../user/index.html">User information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../own-instance.html">Why use a private instance?</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../admin/index.html">Administrator documentation</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../index.html">Developer documentation</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../quickstart.html">Development Quickstart</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../contribution_guide.html">How to contribute</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../index.html">Engine Implementations</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../search_api.html">Search API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../plugins.html">Plugins</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../translation.html">Translation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../lxcdev.html">Developing in Linux Containers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../makefile.html">Makefile &amp; <code class="docutils literal notranslate"><span class="pre">./manage</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../reST.html">reST primer</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../searxng_extra/index.html">Tooling box <code class="docutils literal notranslate"><span class="pre">searxng_extra</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../utils/index.html">DevOps tooling box</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../src/index.html">Source-Code</a></li>
</ul>
<h3>Project Links</h3>
<ul>
<li><a href="https://github.com/searxng/searxng/tree/master">Source</a>
<li><a href="https://github.com/searxng/searxng/wiki">Wiki</a>
<li><a href="https://searx.space">Public instances</a>
<li><a href="https://github.com/searxng/searxng/issues">Issue Tracker</a>
</ul><h3>Navigation</h3>
<ul>
<li><a href="../../../index.html">Overview</a>
<ul>
<li><a href="../../index.html">Developer documentation</a>
<ul>
<li><a href="../index.html">Engine Implementations</a>
<ul>
<li>Previous: <a href="bing.html" title="previous chapter">Bing Engines</a>
<li>Next: <a href="bt4g.html" title="next chapter">BT4G</a></ul>
</li></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 role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../../_sources/dev/engines/online/brave.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright SearXNG team.
</div>
<script src="../../../_static/version_warning_offset.js"></script>
</body>
</html>

View file

@ -0,0 +1,194 @@
<!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>BT4G &#8212; SearXNG Documentation (2023.8.11+905ce2a6f)</title>
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=4f649999" />
<link rel="stylesheet" type="text/css" href="../../../_static/searxng.css?v=52e4ff28" />
<link rel="stylesheet" type="text/css" href="../../../_static/tabs.css?v=a5c4661c" />
<script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js?v=3c88bde0"></script>
<script src="../../../_static/doctools.js?v=888ff710"></script>
<script src="../../../_static/sphinx_highlight.js?v=4825356b"></script>
<link rel="index" title="Index" href="../../../genindex.html" />
<link rel="search" title="Search" href="../../../search.html" />
<link rel="next" title="Dailymotion" href="dailymotion.html" />
<link rel="prev" title="Brave Engines" href="brave.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="dailymotion.html" title="Dailymotion"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="brave.html" title="Brave Engines"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">SearXNG Documentation (2023.8.11+905ce2a6f)</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../index.html" >Developer documentation</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="../index.html" accesskey="U">Engine Implementations</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">BT4G</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="bt4g">
<span id="bt4g-engine"></span><h1>BT4G<a class="headerlink" href="#bt4g" title="Permalink to this heading"></a></h1>
<nav class="contents local" id="contents">
<p class="topic-title">Contents</p>
<ul class="simple">
<li><p><a class="reference internal" href="#configuration" id="id2">Configuration</a></p></li>
<li><p><a class="reference internal" href="#implementations" id="id3">Implementations</a></p></li>
</ul>
</nav>
<span class="target" id="module-searx.engines.bt4g"></span><p><a class="reference external" href="https://bt4g.com/">BT4G</a> (bt4g.com) is not a tracker and doesnt store any content and only
collects torrent metadata (such as file names and file sizes) and a magnet link
(torrent identifier).</p>
<p>This engine does not parse the HTML page because there is an API in XML (RSS).
The RSS feed provides fewer data like amount of seeders/leechers and the files
in the torrent file. Its a tradeoff for a “stable” engine as the XML from RSS
content will change way less than the HTML page.</p>
<section id="configuration">
<h2><a class="toc-backref" href="#id2" role="doc-backlink">Configuration</a><a class="headerlink" href="#configuration" title="Permalink to this heading"></a></h2>
<p>The engine has the following additional settings:</p>
<ul class="simple">
<li><p><a class="reference internal" href="#searx.engines.bt4g.bt4g_order_by" title="searx.engines.bt4g.bt4g_order_by"><code class="xref py py-obj docutils literal notranslate"><span class="pre">bt4g_order_by</span></code></a></p></li>
<li><p><a class="reference internal" href="#searx.engines.bt4g.bt4g_category" title="searx.engines.bt4g.bt4g_category"><code class="xref py py-obj docutils literal notranslate"><span class="pre">bt4g_category</span></code></a></p></li>
</ul>
<p>With this options a SearXNG maintainer is able to configure <strong>additional</strong>
engines for specific torrent searches. For example a engine to search only for
Movies and sort the result list by the count of seeders.</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">bt4g.movie</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">bt4g</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">bt4gv</span>
<span class="w"> </span><span class="nt">categories</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">video</span>
<span class="w"> </span><span class="nt">bt4g_order_by</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">seeders</span>
<span class="w"> </span><span class="nt">bt4g_category</span><span class="p">:</span><span class="w"> </span><span class="s">&#39;movie&#39;</span>
</pre></div>
</div>
</section>
<section id="implementations">
<h2><a class="toc-backref" href="#id3" role="doc-backlink">Implementations</a><a class="headerlink" href="#implementations" title="Permalink to this heading"></a></h2>
</section>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.bt4g.bt4g_category">
<span class="sig-prename descclassname"><span class="pre">searx.engines.bt4g.</span></span><span class="sig-name descname"><span class="pre">bt4g_category</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'all'</span></em><a class="headerlink" href="#searx.engines.bt4g.bt4g_category" title="Permalink to this definition"></a></dt>
<dd><p>BT$G offers categoies: <code class="docutils literal notranslate"><span class="pre">all</span></code> (default), <code class="docutils literal notranslate"><span class="pre">audio</span></code>, <code class="docutils literal notranslate"><span class="pre">movie</span></code>, <code class="docutils literal notranslate"><span class="pre">doc</span></code>,
<code class="docutils literal notranslate"><span class="pre">app</span></code> and `` other``.</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.bt4g.bt4g_order_by">
<span class="sig-prename descclassname"><span class="pre">searx.engines.bt4g.</span></span><span class="sig-name descname"><span class="pre">bt4g_order_by</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'relevance'</span></em><a class="headerlink" href="#searx.engines.bt4g.bt4g_order_by" title="Permalink to this definition"></a></dt>
<dd><p>Result list can be ordered by <code class="docutils literal notranslate"><span class="pre">relevance</span></code> (default), <code class="docutils literal notranslate"><span class="pre">size</span></code>, <code class="docutils literal notranslate"><span class="pre">seeders</span></code>
or <code class="docutils literal notranslate"><span class="pre">time</span></code>.</p>
<div class="admonition hint">
<p class="admonition-title">Hint</p>
<p>When <em>time_range</em> is activate, the results always orderd by <code class="docutils literal notranslate"><span class="pre">time</span></code>.</p>
</div>
</dd></dl>
</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/searxng-wordmark.svg" alt="Logo"/>
</a></p>
<h3><a href="../../../index.html">Table of Contents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../user/index.html">User information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../own-instance.html">Why use a private instance?</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../admin/index.html">Administrator documentation</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../index.html">Developer documentation</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../quickstart.html">Development Quickstart</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../contribution_guide.html">How to contribute</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../index.html">Engine Implementations</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../search_api.html">Search API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../plugins.html">Plugins</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../translation.html">Translation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../lxcdev.html">Developing in Linux Containers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../makefile.html">Makefile &amp; <code class="docutils literal notranslate"><span class="pre">./manage</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../reST.html">reST primer</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../searxng_extra/index.html">Tooling box <code class="docutils literal notranslate"><span class="pre">searxng_extra</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../utils/index.html">DevOps tooling box</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../src/index.html">Source-Code</a></li>
</ul>
<h3>Project Links</h3>
<ul>
<li><a href="https://github.com/searxng/searxng/tree/master">Source</a>
<li><a href="https://github.com/searxng/searxng/wiki">Wiki</a>
<li><a href="https://searx.space">Public instances</a>
<li><a href="https://github.com/searxng/searxng/issues">Issue Tracker</a>
</ul><h3>Navigation</h3>
<ul>
<li><a href="../../../index.html">Overview</a>
<ul>
<li><a href="../../index.html">Developer documentation</a>
<ul>
<li><a href="../index.html">Engine Implementations</a>
<ul>
<li>Previous: <a href="brave.html" title="previous chapter">Brave Engines</a>
<li>Next: <a href="dailymotion.html" title="next chapter">Dailymotion</a></ul>
</li></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 role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../../_sources/dev/engines/online/bt4g.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright SearXNG team.
</div>
<script src="../../../_static/version_warning_offset.js"></script>
</body>
</html>

View file

@ -0,0 +1,204 @@
<!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>Dailymotion &#8212; SearXNG Documentation (2023.8.11+905ce2a6f)</title>
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=4f649999" />
<link rel="stylesheet" type="text/css" href="../../../_static/searxng.css?v=52e4ff28" />
<link rel="stylesheet" type="text/css" href="../../../_static/tabs.css?v=a5c4661c" />
<script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js?v=3c88bde0"></script>
<script src="../../../_static/doctools.js?v=888ff710"></script>
<script src="../../../_static/sphinx_highlight.js?v=4825356b"></script>
<link rel="index" title="Index" href="../../../genindex.html" />
<link rel="search" title="Search" href="../../../search.html" />
<link rel="next" title="DukcDukGo Engines" href="duckduckgo.html" />
<link rel="prev" title="BT4G" href="bt4g.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="duckduckgo.html" title="DukcDukGo Engines"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="bt4g.html" title="BT4G"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">SearXNG Documentation (2023.8.11+905ce2a6f)</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../index.html" >Developer documentation</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="../index.html" accesskey="U">Engine Implementations</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Dailymotion</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="dailymotion">
<span id="dailymotion-engine"></span><h1>Dailymotion<a class="headerlink" href="#dailymotion" title="Permalink to this heading"></a></h1>
<nav class="contents local" id="contents">
<ul class="simple">
<li><p><a class="reference internal" href="#dailymotion-videos" id="id1">Dailymotion (Videos)</a></p></li>
</ul>
</nav>
<span class="target" id="module-searx.engines.dailymotion"></span><section id="dailymotion-videos">
<h2><a class="toc-backref" href="#id1" role="doc-backlink">Dailymotion (Videos)</a><a class="headerlink" href="#dailymotion-videos" title="Permalink to this heading"></a></h2>
</section>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.dailymotion.fetch_traits">
<span class="sig-prename descclassname"><span class="pre">searx.engines.dailymotion.</span></span><span class="sig-name descname"><span class="pre">fetch_traits</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">engine_traits</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="../enginelib.html#searx.enginelib.traits.EngineTraits" title="searx.enginelib.traits.EngineTraits"><span class="pre">EngineTraits</span></a></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/dailymotion.html#fetch_traits"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.dailymotion.fetch_traits" title="Permalink to this definition"></a></dt>
<dd><p>Fetch locales &amp; languages from dailymotion.</p>
<p>Locales fetched from <a class="reference external" href="https://api.dailymotion.com/locales">api/locales</a>.
There are duplications in the locale codes returned from Dailymotion which
can be ignored:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">en_EN</span> <span class="o">--&gt;</span> <span class="n">en_GB</span><span class="p">,</span> <span class="n">en_US</span>
<span class="n">ar_AA</span> <span class="o">--&gt;</span> <span class="n">ar_EG</span><span class="p">,</span> <span class="n">ar_AE</span><span class="p">,</span> <span class="n">ar_SA</span>
</pre></div>
</div>
<p>The language list <a class="reference external" href="https://api.dailymotion.com/languages">api/languages</a>
contains over 7000 <em>languages</em> codes (see <a class="reference external" href="https://github.com/searxng/searxng/pull/1071">PR1071</a>). We use only those
language codes that are used in the locales.</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.dailymotion.family_filter_map">
<span class="sig-prename descclassname"><span class="pre">searx.engines.dailymotion.</span></span><span class="sig-name descname"><span class="pre">family_filter_map</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">{0:</span> <span class="pre">'false',</span> <span class="pre">1:</span> <span class="pre">'true',</span> <span class="pre">2:</span> <span class="pre">'true'}</span></em><a class="headerlink" href="#searx.engines.dailymotion.family_filter_map" title="Permalink to this definition"></a></dt>
<dd><p>By default, the family filter is turned on. Setting this parameter to
<code class="docutils literal notranslate"><span class="pre">false</span></code> will stop filtering-out explicit content from searches and global
contexts (<code class="docutils literal notranslate"><span class="pre">family_filter</span></code> in <a class="reference external" href="https://developers.dailymotion.com/api/#global-parameters">Global API Parameters</a> ).</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.dailymotion.iframe_src">
<span class="sig-prename descclassname"><span class="pre">searx.engines.dailymotion.</span></span><span class="sig-name descname"><span class="pre">iframe_src</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'https://www.dailymotion.com/embed/video/{video_id}'</span></em><a class="headerlink" href="#searx.engines.dailymotion.iframe_src" title="Permalink to this definition"></a></dt>
<dd><p>URL template to embed video in SearXNGs result list.</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.dailymotion.result_fields">
<span class="sig-prename descclassname"><span class="pre">searx.engines.dailymotion.</span></span><span class="sig-name descname"><span class="pre">result_fields</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">['allow_embed',</span> <span class="pre">'description',</span> <span class="pre">'title',</span> <span class="pre">'created_time',</span> <span class="pre">'duration',</span> <span class="pre">'url',</span> <span class="pre">'thumbnail_360_url',</span> <span class="pre">'id']</span></em><a class="headerlink" href="#searx.engines.dailymotion.result_fields" title="Permalink to this definition"></a></dt>
<dd><p><a class="reference external" href="https://developers.dailymotion.com/api/#fields-selection">Fields selection</a>, by default, a few fields are returned. To request more
specific fields, the <code class="docutils literal notranslate"><span class="pre">fields</span></code> parameter is used with the list of fields
SearXNG needs in the response to build a video result list.</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.dailymotion.safesearch_params">
<span class="sig-prename descclassname"><span class="pre">searx.engines.dailymotion.</span></span><span class="sig-name descname"><span class="pre">safesearch_params</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">{0:</span> <span class="pre">{},</span> <span class="pre">1:</span> <span class="pre">{'is_created_for_kids':</span> <span class="pre">'true'},</span> <span class="pre">2:</span> <span class="pre">{'is_created_for_kids':</span> <span class="pre">'true'}}</span></em><a class="headerlink" href="#searx.engines.dailymotion.safesearch_params" title="Permalink to this definition"></a></dt>
<dd><p>True if this video is “Created for Kids” / intends to target an audience
under the age of 16 (<code class="docutils literal notranslate"><span class="pre">is_created_for_kids</span></code> in <a class="reference external" href="https://developers.dailymotion.com/api/#video-filters">Video filters API</a> )</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.dailymotion.search_url">
<span class="sig-prename descclassname"><span class="pre">searx.engines.dailymotion.</span></span><span class="sig-name descname"><span class="pre">search_url</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'https://api.dailymotion.com/videos?'</span></em><a class="headerlink" href="#searx.engines.dailymotion.search_url" title="Permalink to this definition"></a></dt>
<dd><p>URL to retrieve a list of videos.</p>
<ul class="simple">
<li><p><a class="reference external" href="https://developers.dailymotion.com/tools/">REST GET</a></p></li>
<li><p><a class="reference external" href="https://developers.dailymotion.com/api/#global-parameters">Global API Parameters</a></p></li>
<li><p><a class="reference external" href="https://developers.dailymotion.com/api/#video-filters">Video filters API</a></p></li>
</ul>
</dd></dl>
</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/searxng-wordmark.svg" alt="Logo"/>
</a></p>
<h3><a href="../../../index.html">Table of Contents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../user/index.html">User information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../own-instance.html">Why use a private instance?</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../admin/index.html">Administrator documentation</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../index.html">Developer documentation</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../quickstart.html">Development Quickstart</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../contribution_guide.html">How to contribute</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../index.html">Engine Implementations</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../search_api.html">Search API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../plugins.html">Plugins</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../translation.html">Translation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../lxcdev.html">Developing in Linux Containers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../makefile.html">Makefile &amp; <code class="docutils literal notranslate"><span class="pre">./manage</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../reST.html">reST primer</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../searxng_extra/index.html">Tooling box <code class="docutils literal notranslate"><span class="pre">searxng_extra</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../utils/index.html">DevOps tooling box</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../src/index.html">Source-Code</a></li>
</ul>
<h3>Project Links</h3>
<ul>
<li><a href="https://github.com/searxng/searxng/tree/master">Source</a>
<li><a href="https://github.com/searxng/searxng/wiki">Wiki</a>
<li><a href="https://searx.space">Public instances</a>
<li><a href="https://github.com/searxng/searxng/issues">Issue Tracker</a>
</ul><h3>Navigation</h3>
<ul>
<li><a href="../../../index.html">Overview</a>
<ul>
<li><a href="../../index.html">Developer documentation</a>
<ul>
<li><a href="../index.html">Engine Implementations</a>
<ul>
<li>Previous: <a href="bt4g.html" title="previous chapter">BT4G</a>
<li>Next: <a href="duckduckgo.html" title="next chapter">DukcDukGo Engines</a></ul>
</li></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 role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../../_sources/dev/engines/online/dailymotion.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright SearXNG team.
</div>
<script src="../../../_static/version_warning_offset.js"></script>
</body>
</html>

View file

@ -0,0 +1,256 @@
<!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>DukcDukGo Engines &#8212; SearXNG Documentation (2023.8.11+905ce2a6f)</title>
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=4f649999" />
<link rel="stylesheet" type="text/css" href="../../../_static/searxng.css?v=52e4ff28" />
<link rel="stylesheet" type="text/css" href="../../../_static/tabs.css?v=a5c4661c" />
<script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js?v=3c88bde0"></script>
<script src="../../../_static/doctools.js?v=888ff710"></script>
<script src="../../../_static/sphinx_highlight.js?v=4825356b"></script>
<link rel="index" title="Index" href="../../../genindex.html" />
<link rel="search" title="Search" href="../../../search.html" />
<link rel="next" title="Google Engines" href="google.html" />
<link rel="prev" title="Dailymotion" href="dailymotion.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="google.html" title="Google Engines"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="dailymotion.html" title="Dailymotion"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">SearXNG Documentation (2023.8.11+905ce2a6f)</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../index.html" >Developer documentation</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="../index.html" accesskey="U">Engine Implementations</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">DukcDukGo Engines</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="dukcdukgo-engines">
<span id="duckduckgo-engines"></span><h1>DukcDukGo Engines<a class="headerlink" href="#dukcdukgo-engines" title="Permalink to this heading"></a></h1>
<nav class="contents local" id="contents">
<ul class="simple">
<li><p><a class="reference internal" href="#duckduckgo-lite" id="id1">DuckDuckGo Lite</a></p></li>
<li><p><a class="reference internal" href="#duckduckgo-images" id="id2">DuckDuckGo Images</a></p></li>
<li><p><a class="reference internal" href="#duckduckgo-instant-answer-api" id="id3">DuckDuckGo Instant Answer API</a></p></li>
<li><p><a class="reference internal" href="#duckduckgo-weather" id="id4">DuckDuckGo Weather</a></p></li>
</ul>
</nav>
<span class="target" id="module-searx.engines.duckduckgo"></span><section id="duckduckgo-lite">
<h2><a class="toc-backref" href="#id1" role="doc-backlink">DuckDuckGo Lite</a><a class="headerlink" href="#duckduckgo-lite" title="Permalink to this heading"></a></h2>
</section>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.duckduckgo.cache_vqd">
<span class="sig-prename descclassname"><span class="pre">searx.engines.duckduckgo.</span></span><span class="sig-name descname"><span class="pre">cache_vqd</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">query</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">value</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/duckduckgo.html#cache_vqd"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.duckduckgo.cache_vqd" title="Permalink to this definition"></a></dt>
<dd><p>Caches a <code class="docutils literal notranslate"><span class="pre">vqd</span></code> value from a query.</p>
<p>The vqd value depends on the query string and is needed for the follow up
pages or the images loaded by a XMLHttpRequest:</p>
<ul class="simple">
<li><p>DuckDuckGo Web: <cite>https://links.duckduckgo.com/d.js?q=…&amp;vqd=…</cite></p></li>
<li><p>DuckDuckGo Images: <cite>https://duckduckgo.com/i.js??q=…&amp;vqd=…</cite></p></li>
</ul>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.duckduckgo.fetch_traits">
<span class="sig-prename descclassname"><span class="pre">searx.engines.duckduckgo.</span></span><span class="sig-name descname"><span class="pre">fetch_traits</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">engine_traits</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="../enginelib.html#searx.enginelib.traits.EngineTraits" title="searx.enginelib.traits.EngineTraits"><span class="pre">EngineTraits</span></a></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/duckduckgo.html#fetch_traits"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.duckduckgo.fetch_traits" title="Permalink to this definition"></a></dt>
<dd><p>Fetch languages &amp; regions from DuckDuckGo.</p>
<p>SearXNGs <code class="docutils literal notranslate"><span class="pre">all</span></code> locale maps DuckDuckGos “Alle regions” (<code class="docutils literal notranslate"><span class="pre">wt-wt</span></code>).
DuckDuckGos language “Browsers prefered language” (<code class="docutils literal notranslate"><span class="pre">wt_WT</span></code>) makes no
sense in a SearXNG request since SearXNGs <code class="docutils literal notranslate"><span class="pre">all</span></code> will not add a
<code class="docutils literal notranslate"><span class="pre">Accept-Language</span></code> HTTP header. The value in <code class="docutils literal notranslate"><span class="pre">engine_traits.all_locale</span></code>
is <code class="docutils literal notranslate"><span class="pre">wt-wt</span></code> (the region).</p>
<p>Beside regions DuckDuckGo also defines its lanaguages by region codes. By
example these are the english languages in DuckDuckGo:</p>
<ul class="simple">
<li><p>en_US</p></li>
<li><p>en_AU</p></li>
<li><p>en_CA</p></li>
<li><p>en_GB</p></li>
</ul>
<p>The function <a class="reference internal" href="#searx.engines.duckduckgo.get_ddg_lang" title="searx.engines.duckduckgo.get_ddg_lang"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_ddg_lang</span></code></a> evaluates DuckDuckGos language from
SearXNGs locale.</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.duckduckgo.get_ddg_lang">
<span class="sig-prename descclassname"><span class="pre">searx.engines.duckduckgo.</span></span><span class="sig-name descname"><span class="pre">get_ddg_lang</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">eng_traits</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="../enginelib.html#searx.enginelib.traits.EngineTraits" title="searx.enginelib.traits.EngineTraits"><span class="pre">EngineTraits</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">sxng_locale</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">default</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'en_US'</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/duckduckgo.html#get_ddg_lang"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.duckduckgo.get_ddg_lang" title="Permalink to this definition"></a></dt>
<dd><p>Get DuckDuckGos language identifier from SearXNGs locale.</p>
<p>DuckDuckGo defines its lanaguages by region codes (see
<a class="reference internal" href="#searx.engines.duckduckgo.fetch_traits" title="searx.engines.duckduckgo.fetch_traits"><code class="xref py py-obj docutils literal notranslate"><span class="pre">fetch_traits</span></code></a>).</p>
<p>To get region and language of a DDG service use:</p>
<p>It might confuse, but the <code class="docutils literal notranslate"><span class="pre">l</span></code> value of the cookie is what SearXNG calls
the <em>region</em>:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1"># !ddi paris :es-AR --&gt; {&#39;ad&#39;: &#39;es_AR&#39;, &#39;ah&#39;: &#39;ar-es&#39;, &#39;l&#39;: &#39;ar-es&#39;}</span>
<span class="n">params</span><span class="p">[</span><span class="s1">&#39;cookies&#39;</span><span class="p">][</span><span class="s1">&#39;ad&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">eng_lang</span>
<span class="n">params</span><span class="p">[</span><span class="s1">&#39;cookies&#39;</span><span class="p">][</span><span class="s1">&#39;ah&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">eng_region</span>
<span class="n">params</span><span class="p">[</span><span class="s1">&#39;cookies&#39;</span><span class="p">][</span><span class="s1">&#39;l&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">eng_region</span>
</pre></div>
</div>
<div class="admonition hint">
<p class="admonition-title">Hint</p>
<p><a class="reference external" href="https://lite.duckduckgo.com/lite">DDG-lite</a> does not offer a language
selection to the user, only a region can be selected by the user
(<code class="docutils literal notranslate"><span class="pre">eng_region</span></code> from the example above). DDG-lite stores the selected
region in a cookie:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">params</span><span class="p">[</span><span class="s1">&#39;cookies&#39;</span><span class="p">][</span><span class="s1">&#39;kl&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">eng_region</span> <span class="c1"># &#39;ar-es&#39;</span>
</pre></div>
</div>
</div>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.duckduckgo.get_vqd">
<span class="sig-prename descclassname"><span class="pre">searx.engines.duckduckgo.</span></span><span class="sig-name descname"><span class="pre">get_vqd</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">query</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">headers</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/duckduckgo.html#get_vqd"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.duckduckgo.get_vqd" title="Permalink to this definition"></a></dt>
<dd><p>Returns the <code class="docutils literal notranslate"><span class="pre">vqd</span></code> that fits to the <em>query</em>. If there is no <code class="docutils literal notranslate"><span class="pre">vqd</span></code> cached
(<a class="reference internal" href="#searx.engines.duckduckgo.cache_vqd" title="searx.engines.duckduckgo.cache_vqd"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cache_vqd</span></code></a>) the query is sent to DDG to get a vqd value from the
response.</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.duckduckgo.send_accept_language_header">
<span class="sig-prename descclassname"><span class="pre">searx.engines.duckduckgo.</span></span><span class="sig-name descname"><span class="pre">send_accept_language_header</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">True</span></em><a class="headerlink" href="#searx.engines.duckduckgo.send_accept_language_header" title="Permalink to this definition"></a></dt>
<dd><p>DuckDuckGo-Lite tries to guess users prefered language from the HTTP
<code class="docutils literal notranslate"><span class="pre">Accept-Language</span></code>. Optional the user can select a region filter (but not a
language).</p>
</dd></dl>
<span class="target" id="module-searx.engines.duckduckgo_images"></span><section id="duckduckgo-images">
<h2><a class="toc-backref" href="#id2" role="doc-backlink">DuckDuckGo Images</a><a class="headerlink" href="#duckduckgo-images" title="Permalink to this heading"></a></h2>
</section>
<span class="target" id="module-searx.engines.duckduckgo_definitions"></span><section id="duckduckgo-instant-answer-api">
<h2><a class="toc-backref" href="#id3" role="doc-backlink">DuckDuckGo Instant Answer API</a><a class="headerlink" href="#duckduckgo-instant-answer-api" title="Permalink to this heading"></a></h2>
<p>The <a class="reference external" href="https://duckduckgo.com/api">DDG-API</a> is no longer documented but from
reverse engineering we can see that some services (e.g. instant answers) still
in use from the DDG search engine.</p>
<p>As far we can say the <em>instant answers</em> API does not support languages, or at
least we could not find out how language support should work. It seems that
most of the features are based on English terms.</p>
</section>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.duckduckgo_definitions.area_to_str">
<span class="sig-prename descclassname"><span class="pre">searx.engines.duckduckgo_definitions.</span></span><span class="sig-name descname"><span class="pre">area_to_str</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">area</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/duckduckgo_definitions.html#area_to_str"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.duckduckgo_definitions.area_to_str" title="Permalink to this definition"></a></dt>
<dd><p>parse <code class="docutils literal notranslate"><span class="pre">{'unit':</span> <span class="pre">'https://www.wikidata.org/entity/Q712226',</span> <span class="pre">'amount':</span> <span class="pre">'+20.99'}</span></code></p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.duckduckgo_definitions.is_broken_text">
<span class="sig-prename descclassname"><span class="pre">searx.engines.duckduckgo_definitions.</span></span><span class="sig-name descname"><span class="pre">is_broken_text</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">text</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/duckduckgo_definitions.html#is_broken_text"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.duckduckgo_definitions.is_broken_text" title="Permalink to this definition"></a></dt>
<dd><p>duckduckgo may return something like <code class="docutils literal notranslate"><span class="pre">&lt;a</span> <span class="pre">href=&quot;xxxx&quot;&gt;http://somewhere</span> <span class="pre">Related</span> <span class="pre">website&lt;a/&gt;</span></code></p>
<p>The href URL is broken, the “Related website” may contains some HTML.</p>
<p>The best solution seems to ignore these results.</p>
</dd></dl>
<span class="target" id="module-searx.engines.duckduckgo_weather"></span><section id="duckduckgo-weather">
<h2><a class="toc-backref" href="#id4" role="doc-backlink">DuckDuckGo Weather</a><a class="headerlink" href="#duckduckgo-weather" title="Permalink to this heading"></a></h2>
</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/searxng-wordmark.svg" alt="Logo"/>
</a></p>
<h3><a href="../../../index.html">Table of Contents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../user/index.html">User information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../own-instance.html">Why use a private instance?</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../admin/index.html">Administrator documentation</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../index.html">Developer documentation</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../quickstart.html">Development Quickstart</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../contribution_guide.html">How to contribute</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../index.html">Engine Implementations</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../search_api.html">Search API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../plugins.html">Plugins</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../translation.html">Translation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../lxcdev.html">Developing in Linux Containers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../makefile.html">Makefile &amp; <code class="docutils literal notranslate"><span class="pre">./manage</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../reST.html">reST primer</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../searxng_extra/index.html">Tooling box <code class="docutils literal notranslate"><span class="pre">searxng_extra</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../utils/index.html">DevOps tooling box</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../src/index.html">Source-Code</a></li>
</ul>
<h3>Project Links</h3>
<ul>
<li><a href="https://github.com/searxng/searxng/tree/master">Source</a>
<li><a href="https://github.com/searxng/searxng/wiki">Wiki</a>
<li><a href="https://searx.space">Public instances</a>
<li><a href="https://github.com/searxng/searxng/issues">Issue Tracker</a>
</ul><h3>Navigation</h3>
<ul>
<li><a href="../../../index.html">Overview</a>
<ul>
<li><a href="../../index.html">Developer documentation</a>
<ul>
<li><a href="../index.html">Engine Implementations</a>
<ul>
<li>Previous: <a href="dailymotion.html" title="previous chapter">Dailymotion</a>
<li>Next: <a href="google.html" title="next chapter">Google Engines</a></ul>
</li></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 role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../../_sources/dev/engines/online/duckduckgo.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright SearXNG team.
</div>
<script src="../../../_static/version_warning_offset.js"></script>
</body>
</html>

View file

@ -0,0 +1,413 @@
<!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>Google Engines &#8212; SearXNG Documentation (2023.8.11+905ce2a6f)</title>
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=4f649999" />
<link rel="stylesheet" type="text/css" href="../../../_static/searxng.css?v=52e4ff28" />
<link rel="stylesheet" type="text/css" href="../../../_static/tabs.css?v=a5c4661c" />
<script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js?v=3c88bde0"></script>
<script src="../../../_static/doctools.js?v=888ff710"></script>
<script src="../../../_static/sphinx_highlight.js?v=4825356b"></script>
<link rel="index" title="Index" href="../../../genindex.html" />
<link rel="search" title="Search" href="../../../search.html" />
<link rel="next" title="Lemmy" href="lemmy.html" />
<link rel="prev" title="DukcDukGo Engines" href="duckduckgo.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="lemmy.html" title="Lemmy"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="duckduckgo.html" title="DukcDukGo Engines"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">SearXNG Documentation (2023.8.11+905ce2a6f)</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../index.html" >Developer documentation</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="../index.html" accesskey="U">Engine Implementations</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Google Engines</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="google-engines">
<span id="id1"></span><h1>Google Engines<a class="headerlink" href="#google-engines" title="Permalink to this heading"></a></h1>
<nav class="contents local" id="contents">
<ul class="simple">
<li><p><a class="reference internal" href="#google-api" id="id4">Google API</a></p></li>
<li><p><a class="reference internal" href="#module-searx.engines.google" id="id5">Google WEB</a></p></li>
<li><p><a class="reference internal" href="#google-autocomplete" id="id6">Google Autocomplete</a></p></li>
<li><p><a class="reference internal" href="#module-searx.engines.google_images" id="id7">Google Images</a></p></li>
<li><p><a class="reference internal" href="#module-searx.engines.google_videos" id="id8">Google Videos</a></p></li>
<li><p><a class="reference internal" href="#module-searx.engines.google_news" id="id9">Google News</a></p></li>
<li><p><a class="reference internal" href="#module-searx.engines.google_scholar" id="id10">Google Scholar</a></p></li>
</ul>
</nav>
<section id="google-api">
<span id="id2"></span><h2><a class="toc-backref" href="#id4" role="doc-backlink">Google API</a><a class="headerlink" href="#google-api" title="Permalink to this heading"></a></h2>
<p>SearXNGs implementation of the Google API is mainly done in
<a class="reference internal" href="#searx.engines.google.get_google_info" title="searx.engines.google.get_google_info"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_google_info</span></code></a>.</p>
<p>For detailed description of the <em>REST-full</em> API see: <a class="reference external" href="https://developers.google.com/custom-search/docs/xml_results#WebSearch_Query_Parameter_Definitions">Query Parameter
Definitions</a>. The linked API documentation can sometimes be helpful during
reverse engineering. However, we cannot use it in the freely accessible WEB
services; not all parameters can be applied and some engines are more <em>special</em>
than other (e.g. <a class="reference internal" href="#google-news-engine"><span class="std std-ref">Google News</span></a>).</p>
</section>
<section id="module-searx.engines.google">
<span id="google-web"></span><span id="google-web-engine"></span><h2><a class="toc-backref" href="#id5" role="doc-backlink">Google WEB</a><a class="headerlink" href="#module-searx.engines.google" title="Permalink to this heading"></a></h2>
<p>This is the implementation of the Google WEB engine. Some of this
implementations (manly the <a class="reference internal" href="#searx.engines.google.get_google_info" title="searx.engines.google.get_google_info"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_google_info</span></code></a>) are shared by other
engines:</p>
<ul class="simple">
<li><p><a class="reference internal" href="#google-images-engine"><span class="std std-ref">Google Images</span></a></p></li>
<li><p><a class="reference internal" href="#google-news-engine"><span class="std std-ref">Google News</span></a></p></li>
<li><p><a class="reference internal" href="#google-videos-engine"><span class="std std-ref">Google Videos</span></a></p></li>
<li><p><a class="reference internal" href="#google-scholar-engine"><span class="std std-ref">Google Scholar</span></a></p></li>
<li><p><a class="reference internal" href="#google-autocomplete"><span class="std std-ref">Google Autocomplete</span></a></p></li>
</ul>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.google.fetch_traits">
<span class="sig-prename descclassname"><span class="pre">searx.engines.google.</span></span><span class="sig-name descname"><span class="pre">fetch_traits</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">engine_traits</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="../enginelib.html#searx.enginelib.traits.EngineTraits" title="searx.enginelib.traits.EngineTraits"><span class="pre">EngineTraits</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">add_domains</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.11)"><span class="pre">bool</span></a></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/google.html#fetch_traits"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.google.fetch_traits" title="Permalink to this definition"></a></dt>
<dd><p>Fetch languages from Google.</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.google.get_google_info">
<span class="sig-prename descclassname"><span class="pre">searx.engines.google.</span></span><span class="sig-name descname"><span class="pre">get_google_info</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">params</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">eng_traits</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/google.html#get_google_info"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.google.get_google_info" title="Permalink to this definition"></a></dt>
<dd><p>Composing various (language) properties for the google engines (<a class="reference internal" href="#google-api"><span class="std std-ref">Google API</span></a>).</p>
<p>This function is called by the various google engines (<a class="reference internal" href="#google-web-engine"><span class="std std-ref">Google WEB</span></a>, <a class="reference internal" href="#google-images-engine"><span class="std std-ref">Google Images</span></a>, <a class="reference internal" href="#google-news-engine"><span class="std std-ref">Google News</span></a> and
<a class="reference internal" href="#google-videos-engine"><span class="std std-ref">Google Videos</span></a>).</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>param</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.11)"><em>dict</em></a>) Request parameters of the engine. At least
a <code class="docutils literal notranslate"><span class="pre">searxng_locale</span></code> key should be in the dictionary.</p></li>
<li><p><strong>eng_traits</strong> Engines traits fetched from google preferences
(<a class="reference internal" href="../enginelib.html#searx.enginelib.traits.EngineTraits" title="searx.enginelib.traits.EngineTraits"><code class="xref py py-obj docutils literal notranslate"><span class="pre">searx.enginelib.traits.EngineTraits</span></code></a>)</p></li>
</ul>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.11)">dict</a></p>
</dd>
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p><p>Py-Dictionary with the key/value pairs:</p>
<dl class="simple">
<dt>language:</dt><dd><p>The language code that is used by google (e.g. <code class="docutils literal notranslate"><span class="pre">lang_en</span></code> or
<code class="docutils literal notranslate"><span class="pre">lang_zh-TW</span></code>)</p>
</dd>
<dt>country:</dt><dd><p>The country code that is used by google (e.g. <code class="docutils literal notranslate"><span class="pre">US</span></code> or <code class="docutils literal notranslate"><span class="pre">TW</span></code>)</p>
</dd>
<dt>locale:</dt><dd><p>A instance of <a class="reference external" href="https://babel.readthedocs.io/en/latest/api/core.html#babel.core.Locale" title="(in Babel v2.2)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">babel.core.Locale</span></code></a> build from the
<code class="docutils literal notranslate"><span class="pre">searxng_locale</span></code> value.</p>
</dd>
<dt>subdomain:</dt><dd><p>Google subdomain <code class="xref py py-obj docutils literal notranslate"><span class="pre">google_domains</span></code> that fits to the country
code.</p>
</dd>
<dt>params:</dt><dd><p>Py-Dictionary with additional request arguments (can be passed to
<a class="reference external" href="https://docs.python.org/3/library/urllib.parse.html#urllib.parse.urlencode" title="(in Python v3.11)"><code class="xref py py-func docutils literal notranslate"><span class="pre">urllib.parse.urlencode()</span></code></a>).</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">hl</span></code> parameter: specifies the interface language of user interface.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">lr</span></code> parameter: restricts search results to documents written in
a particular language.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">cr</span></code> parameter: restricts search results to documents
originating in a particular country.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ie</span></code> parameter: sets the character encoding scheme that should
be used to interpret the query string (utf8).</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">oe</span></code> parameter: sets the character encoding scheme that should
be used to decode the XML result (utf8).</p></li>
</ul>
</dd>
<dt>headers:</dt><dd><p>Py-Dictionary with additional HTTP headers (can be passed to
requests headers)</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">Accept:</span> <span class="pre">'*/*</span></code></p></li>
</ul>
</dd>
</dl>
</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.google.request">
<span class="sig-prename descclassname"><span class="pre">searx.engines.google.</span></span><span class="sig-name descname"><span class="pre">request</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">query</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">params</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/google.html#request"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.google.request" title="Permalink to this definition"></a></dt>
<dd><p>Google search request</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.google.response">
<span class="sig-prename descclassname"><span class="pre">searx.engines.google.</span></span><span class="sig-name descname"><span class="pre">response</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">resp</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/google.html#response"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.google.response" title="Permalink to this definition"></a></dt>
<dd><p>Get response from googles search request</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.google.UI_ASYNC">
<span class="sig-prename descclassname"><span class="pre">searx.engines.google.</span></span><span class="sig-name descname"><span class="pre">UI_ASYNC</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'use_ac:true,_fmt:prog'</span></em><a class="headerlink" href="#searx.engines.google.UI_ASYNC" title="Permalink to this definition"></a></dt>
<dd><p>Format of the response from UIs async request.</p>
</dd></dl>
</section>
<section id="google-autocomplete">
<span id="id3"></span><h2><a class="toc-backref" href="#id6" role="doc-backlink">Google Autocomplete</a><a class="headerlink" href="#google-autocomplete" title="Permalink to this heading"></a></h2>
<dl class="py function">
<dt class="sig sig-object py" id="searx.autocomplete.google_complete">
<span class="sig-prename descclassname"><span class="pre">searx.autocomplete.</span></span><span class="sig-name descname"><span class="pre">google_complete</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">query</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sxng_locale</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/autocomplete.html#google_complete"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.autocomplete.google_complete" title="Permalink to this definition"></a></dt>
<dd><p>Autocomplete from Google. Supports Googles languages and subdomains
(<a class="reference internal" href="#searx.engines.google.get_google_info" title="searx.engines.google.get_google_info"><code class="xref py py-obj docutils literal notranslate"><span class="pre">searx.engines.google.get_google_info</span></code></a>) by using the async REST
API:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>https://{subdomain}/complete/search?{args}
</pre></div>
</div>
</dd></dl>
</section>
<section id="module-searx.engines.google_images">
<span id="google-images"></span><span id="google-images-engine"></span><h2><a class="toc-backref" href="#id7" role="doc-backlink">Google Images</a><a class="headerlink" href="#module-searx.engines.google_images" title="Permalink to this heading"></a></h2>
<p>This is the implementation of the Google Images engine using the internal
Google API used by the Google Go Android app.</p>
<p>This internal API offer results in</p>
<ul class="simple">
<li><p>JSON (<code class="docutils literal notranslate"><span class="pre">_fmt:json</span></code>)</p></li>
<li><p><a class="reference external" href="https://en.wikipedia.org/wiki/Protocol_Buffers">Protobuf</a> (<code class="docutils literal notranslate"><span class="pre">_fmt:pb</span></code>)</p></li>
<li><p><a class="reference external" href="https://en.wikipedia.org/wiki/Protocol_Buffers">Protobuf</a> compressed? (<code class="docutils literal notranslate"><span class="pre">_fmt:pc</span></code>)</p></li>
<li><p>HTML (<code class="docutils literal notranslate"><span class="pre">_fmt:html</span></code>)</p></li>
<li><p><a class="reference external" href="https://en.wikipedia.org/wiki/Protocol_Buffers">Protobuf</a> encoded in JSON (<code class="docutils literal notranslate"><span class="pre">_fmt:jspb</span></code>).</p></li>
</ul>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.google_images.request">
<span class="sig-prename descclassname"><span class="pre">searx.engines.google_images.</span></span><span class="sig-name descname"><span class="pre">request</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">query</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">params</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/google_images.html#request"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.google_images.request" title="Permalink to this definition"></a></dt>
<dd><p>Google-Image search request</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.google_images.response">
<span class="sig-prename descclassname"><span class="pre">searx.engines.google_images.</span></span><span class="sig-name descname"><span class="pre">response</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">resp</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/google_images.html#response"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.google_images.response" title="Permalink to this definition"></a></dt>
<dd><p>Get response from googles search request</p>
</dd></dl>
</section>
<section id="module-searx.engines.google_videos">
<span id="google-videos"></span><span id="google-videos-engine"></span><h2><a class="toc-backref" href="#id8" role="doc-backlink">Google Videos</a><a class="headerlink" href="#module-searx.engines.google_videos" title="Permalink to this heading"></a></h2>
<p>This is the implementation of the Google Videos engine.</p>
<div class="admonition-content-security-policy-csp admonition">
<p class="admonition-title">Content-Security-Policy (CSP)</p>
<p>This engine needs to allow images from the <a class="reference external" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs">data URLs</a> (prefixed with the
<code class="docutils literal notranslate"><span class="pre">data:</span></code> scheme):</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Header</span> <span class="nb">set</span> <span class="n">Content</span><span class="o">-</span><span class="n">Security</span><span class="o">-</span><span class="n">Policy</span> <span class="s2">&quot;img-src &#39;self&#39; data: ;&quot;</span>
</pre></div>
</div>
</div>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.google_videos.request">
<span class="sig-prename descclassname"><span class="pre">searx.engines.google_videos.</span></span><span class="sig-name descname"><span class="pre">request</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">query</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">params</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/google_videos.html#request"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.google_videos.request" title="Permalink to this definition"></a></dt>
<dd><p>Google-Video search request</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.google_videos.response">
<span class="sig-prename descclassname"><span class="pre">searx.engines.google_videos.</span></span><span class="sig-name descname"><span class="pre">response</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">resp</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/google_videos.html#response"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.google_videos.response" title="Permalink to this definition"></a></dt>
<dd><p>Get response from googles search request</p>
</dd></dl>
</section>
<section id="module-searx.engines.google_news">
<span id="google-news"></span><span id="google-news-engine"></span><h2><a class="toc-backref" href="#id9" role="doc-backlink">Google News</a><a class="headerlink" href="#module-searx.engines.google_news" title="Permalink to this heading"></a></h2>
<p>This is the implementation of the Google News engine.</p>
<p>Google News has a different region handling compared to Google WEB.</p>
<ul class="simple">
<li><p>the <code class="docutils literal notranslate"><span class="pre">ceid</span></code> argument has to be set (<a class="reference internal" href="#searx.engines.google_news.ceid_list" title="searx.engines.google_news.ceid_list"><code class="xref py py-obj docutils literal notranslate"><span class="pre">ceid_list</span></code></a>)</p></li>
<li><p>the <a class="reference external" href="https://developers.google.com/custom-search/docs/xml_results#hlsp">hl</a> argument has to be set correctly (and different to Google WEB)</p></li>
<li><p>the <a class="reference external" href="https://developers.google.com/custom-search/docs/xml_results#glsp">gl</a> argument is mandatory</p></li>
</ul>
<p>If one of this argument is not set correctly, the request is redirected to
CONSENT dialog:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>https://consent.google.com/m?continue=
</pre></div>
</div>
<p>The google news API ignores some parameters from the common <a class="reference internal" href="#google-api"><span class="std std-ref">Google API</span></a>:</p>
<ul class="simple">
<li><p><a class="reference external" href="https://developers.google.com/custom-search/docs/xml_results#numsp">num</a> : the number of search results is ignored / there is no paging all
results for a query term are in the first response.</p></li>
<li><p><a class="reference external" href="https://developers.google.com/custom-search/docs/xml_results#safesp">save</a> : is ignored / Google-News results are always <em>SafeSearch</em></p></li>
</ul>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.google_news.request">
<span class="sig-prename descclassname"><span class="pre">searx.engines.google_news.</span></span><span class="sig-name descname"><span class="pre">request</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">query</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">params</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/google_news.html#request"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.google_news.request" title="Permalink to this definition"></a></dt>
<dd><p>Google-News search request</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.google_news.response">
<span class="sig-prename descclassname"><span class="pre">searx.engines.google_news.</span></span><span class="sig-name descname"><span class="pre">response</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">resp</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/google_news.html#response"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.google_news.response" title="Permalink to this definition"></a></dt>
<dd><p>Get response from googles search request</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.google_news.ceid_list">
<span class="sig-prename descclassname"><span class="pre">searx.engines.google_news.</span></span><span class="sig-name descname"><span class="pre">ceid_list</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">['AE:ar',</span> <span class="pre">'AR:es-419',</span> <span class="pre">'AT:de',</span> <span class="pre">'AU:en',</span> <span class="pre">'BD:bn',</span> <span class="pre">'BE:fr',</span> <span class="pre">'BE:nl',</span> <span class="pre">'BG:bg',</span> <span class="pre">'BR:pt-419',</span> <span class="pre">'BW:en',</span> <span class="pre">'CA:en',</span> <span class="pre">'CA:fr',</span> <span class="pre">'CH:de',</span> <span class="pre">'CH:fr',</span> <span class="pre">'CL:es-419',</span> <span class="pre">'CN:zh-Hans',</span> <span class="pre">'CO:es-419',</span> <span class="pre">'CU:es-419',</span> <span class="pre">'CZ:cs',</span> <span class="pre">'DE:de',</span> <span class="pre">'EG:ar',</span> <span class="pre">'ES:es',</span> <span class="pre">'ET:en',</span> <span class="pre">'FR:fr',</span> <span class="pre">'GB:en',</span> <span class="pre">'GH:en',</span> <span class="pre">'GR:el',</span> <span class="pre">'HK:zh-Hant',</span> <span class="pre">'HU:hu',</span> <span class="pre">'ID:en',</span> <span class="pre">'ID:id',</span> <span class="pre">'IE:en',</span> <span class="pre">'IL:en',</span> <span class="pre">'IL:he',</span> <span class="pre">'IN:bn',</span> <span class="pre">'IN:en',</span> <span class="pre">'IN:hi',</span> <span class="pre">'IN:ml',</span> <span class="pre">'IN:mr',</span> <span class="pre">'IN:ta',</span> <span class="pre">'IN:te',</span> <span class="pre">'IT:it',</span> <span class="pre">'JP:ja',</span> <span class="pre">'KE:en',</span> <span class="pre">'KR:ko',</span> <span class="pre">'LB:ar',</span> <span class="pre">'LT:lt',</span> <span class="pre">'LV:en',</span> <span class="pre">'LV:lv',</span> <span class="pre">'MA:fr',</span> <span class="pre">'MX:es-419',</span> <span class="pre">'MY:en',</span> <span class="pre">'NA:en',</span> <span class="pre">'NG:en',</span> <span class="pre">'NL:nl',</span> <span class="pre">'NO:no',</span> <span class="pre">'NZ:en',</span> <span class="pre">'PE:es-419',</span> <span class="pre">'PH:en',</span> <span class="pre">'PK:en',</span> <span class="pre">'PL:pl',</span> <span class="pre">'PT:pt-150',</span> <span class="pre">'RO:ro',</span> <span class="pre">'RS:sr',</span> <span class="pre">'RU:ru',</span> <span class="pre">'SA:ar',</span> <span class="pre">'SE:sv',</span> <span class="pre">'SG:en',</span> <span class="pre">'SI:sl',</span> <span class="pre">'SK:sk',</span> <span class="pre">'SN:fr',</span> <span class="pre">'TH:th',</span> <span class="pre">'TR:tr',</span> <span class="pre">'TW:zh-Hant',</span> <span class="pre">'TZ:en',</span> <span class="pre">'UA:ru',</span> <span class="pre">'UA:uk',</span> <span class="pre">'UG:en',</span> <span class="pre">'US:en',</span> <span class="pre">'US:es-419',</span> <span class="pre">'VE:es-419',</span> <span class="pre">'VN:vi',</span> <span class="pre">'ZA:en',</span> <span class="pre">'ZW:en']</span></em><a class="headerlink" href="#searx.engines.google_news.ceid_list" title="Permalink to this definition"></a></dt>
<dd><p>List of region/language combinations supported by Google News. Values of the
<code class="docutils literal notranslate"><span class="pre">ceid</span></code> argument of the Google News REST API.</p>
</dd></dl>
</section>
<section id="module-searx.engines.google_scholar">
<span id="google-scholar"></span><span id="google-scholar-engine"></span><h2><a class="toc-backref" href="#id10" role="doc-backlink">Google Scholar</a><a class="headerlink" href="#module-searx.engines.google_scholar" title="Permalink to this heading"></a></h2>
<p>This is the implementation of the Google Scholar engine.</p>
<p>Compared to other Google services the Scholar engine has a simple GET REST-API
and there does not exists <cite>async</cite> API. Even though the API slightly vintage we
can make use of the <a class="reference internal" href="#google-api"><span class="std std-ref">Google API</span></a> to assemble the arguments of the GET
request.</p>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.google_scholar.detect_google_captcha">
<span class="sig-prename descclassname"><span class="pre">searx.engines.google_scholar.</span></span><span class="sig-name descname"><span class="pre">detect_google_captcha</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">dom</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/google_scholar.html#detect_google_captcha"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.google_scholar.detect_google_captcha" title="Permalink to this definition"></a></dt>
<dd><p>In case of CAPTCHA Google Scholar open its own <em>not a Robot</em> dialog and is
not redirected to <code class="docutils literal notranslate"><span class="pre">sorry.google.com</span></code>.</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.google_scholar.parse_gs_a">
<span class="sig-prename descclassname"><span class="pre">searx.engines.google_scholar.</span></span><span class="sig-name descname"><span class="pre">parse_gs_a</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">text</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><span class="pre">str</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.11)"><span class="pre">None</span></a></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/google_scholar.html#parse_gs_a"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.google_scholar.parse_gs_a" title="Permalink to this definition"></a></dt>
<dd><p>Parse the text written in green.</p>
<p>Possible formats:
* “{authors} - {journal}, {year} - {publisher}”
* “{authors} - {year} - {publisher}”
* “{authors} - {publisher}”</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.google_scholar.request">
<span class="sig-prename descclassname"><span class="pre">searx.engines.google_scholar.</span></span><span class="sig-name descname"><span class="pre">request</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">query</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">params</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/google_scholar.html#request"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.google_scholar.request" title="Permalink to this definition"></a></dt>
<dd><p>Google-Scholar search request</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.google_scholar.response">
<span class="sig-prename descclassname"><span class="pre">searx.engines.google_scholar.</span></span><span class="sig-name descname"><span class="pre">response</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">resp</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/google_scholar.html#response"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.google_scholar.response" title="Permalink to this definition"></a></dt>
<dd><p>Parse response from Google Scholar</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.google_scholar.time_range_args">
<span class="sig-prename descclassname"><span class="pre">searx.engines.google_scholar.</span></span><span class="sig-name descname"><span class="pre">time_range_args</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">params</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/google_scholar.html#time_range_args"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.google_scholar.time_range_args" title="Permalink to this definition"></a></dt>
<dd><p>Returns a dictionary with a time range arguments based on
<code class="docutils literal notranslate"><span class="pre">params['time_range']</span></code>.</p>
<p>Google Scholar supports a detailed search by year. Searching by <em>last
month</em> or <em>last week</em> (as offered by SearXNG) is uncommon for scientific
publications and is not supported by Google Scholar.</p>
<p>To limit the result list when the users selects a range, all the SearXNG
ranges (<em>day</em>, <em>week</em>, <em>month</em>, <em>year</em>) are mapped to <em>year</em>. If no range
is set an empty dictionary of arguments is returned. Example; when
user selects a time range (current year minus one in 2022):</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="p">{</span> <span class="s1">&#39;as_ylo&#39;</span> <span class="p">:</span> <span class="mi">2021</span> <span class="p">}</span>
</pre></div>
</div>
</dd></dl>
</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/searxng-wordmark.svg" alt="Logo"/>
</a></p>
<h3><a href="../../../index.html">Table of Contents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../user/index.html">User information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../own-instance.html">Why use a private instance?</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../admin/index.html">Administrator documentation</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../index.html">Developer documentation</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../quickstart.html">Development Quickstart</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../contribution_guide.html">How to contribute</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../index.html">Engine Implementations</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../search_api.html">Search API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../plugins.html">Plugins</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../translation.html">Translation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../lxcdev.html">Developing in Linux Containers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../makefile.html">Makefile &amp; <code class="docutils literal notranslate"><span class="pre">./manage</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../reST.html">reST primer</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../searxng_extra/index.html">Tooling box <code class="docutils literal notranslate"><span class="pre">searxng_extra</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../utils/index.html">DevOps tooling box</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../src/index.html">Source-Code</a></li>
</ul>
<h3>Project Links</h3>
<ul>
<li><a href="https://github.com/searxng/searxng/tree/master">Source</a>
<li><a href="https://github.com/searxng/searxng/wiki">Wiki</a>
<li><a href="https://searx.space">Public instances</a>
<li><a href="https://github.com/searxng/searxng/issues">Issue Tracker</a>
</ul><h3>Navigation</h3>
<ul>
<li><a href="../../../index.html">Overview</a>
<ul>
<li><a href="../../index.html">Developer documentation</a>
<ul>
<li><a href="../index.html">Engine Implementations</a>
<ul>
<li>Previous: <a href="duckduckgo.html" title="previous chapter">DukcDukGo Engines</a>
<li>Next: <a href="lemmy.html" title="next chapter">Lemmy</a></ul>
</li></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 role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../../_sources/dev/engines/online/google.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright SearXNG team.
</div>
<script src="../../../_static/version_warning_offset.js"></script>
</body>
</html>

View file

@ -0,0 +1,190 @@
<!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>Lemmy &#8212; SearXNG Documentation (2023.8.11+905ce2a6f)</title>
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=4f649999" />
<link rel="stylesheet" type="text/css" href="../../../_static/searxng.css?v=52e4ff28" />
<link rel="stylesheet" type="text/css" href="../../../_static/tabs.css?v=a5c4661c" />
<script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js?v=3c88bde0"></script>
<script src="../../../_static/doctools.js?v=888ff710"></script>
<script src="../../../_static/sphinx_highlight.js?v=4825356b"></script>
<link rel="index" title="Index" href="../../../genindex.html" />
<link rel="search" title="Search" href="../../../search.html" />
<link rel="next" title="Peertube Engines" href="peertube.html" />
<link rel="prev" title="Google Engines" href="google.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="peertube.html" title="Peertube Engines"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="google.html" title="Google Engines"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">SearXNG Documentation (2023.8.11+905ce2a6f)</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../index.html" >Developer documentation</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="../index.html" accesskey="U">Engine Implementations</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Lemmy</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="lemmy">
<span id="lemmy-engine"></span><h1>Lemmy<a class="headerlink" href="#lemmy" title="Permalink to this heading"></a></h1>
<nav class="contents local" id="contents">
<p class="topic-title">Contents</p>
<ul class="simple">
<li><p><a class="reference internal" href="#configuration" id="id1">Configuration</a></p></li>
<li><p><a class="reference internal" href="#implementations" id="id2">Implementations</a></p></li>
</ul>
</nav>
<span class="target" id="module-searx.engines.lemmy"></span><p>This engine uses the Lemmy API (<a class="reference external" href="https://lemmy.ml/api/v3/search">https://lemmy.ml/api/v3/search</a>), which is
documented at <a class="reference external" href="https://join-lemmy.org/api/modules.html">lemmy-js-client</a> / <a class="reference external" href="https://join-lemmy.org/api/interfaces/Search.html">Interface Search</a>. Since Lemmy is
federated, results are from many different, independent lemmy instances, and not
only the official one.</p>
<section id="configuration">
<h2><a class="toc-backref" href="#id1" role="doc-backlink">Configuration</a><a class="headerlink" href="#configuration" title="Permalink to this heading"></a></h2>
<p>The engine has the following additional settings:</p>
<ul class="simple">
<li><p><a class="reference internal" href="#searx.engines.lemmy.base_url" title="searx.engines.lemmy.base_url"><code class="xref py py-obj docutils literal notranslate"><span class="pre">base_url</span></code></a></p></li>
<li><p><a class="reference internal" href="#searx.engines.lemmy.lemmy_type" title="searx.engines.lemmy.lemmy_type"><code class="xref py py-obj docutils literal notranslate"><span class="pre">lemmy_type</span></code></a></p></li>
</ul>
<p>This implementation is used by different lemmy engines in the <a class="reference internal" href="../../../admin/settings/settings_engine.html#settings-engine"><span class="std std-ref">settings.yml</span></a>:</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">lemmy communities</span>
<span class="w"> </span><span class="nt">lemmy_type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Communities</span>
<span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">...</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">lemmy users</span>
<span class="w"> </span><span class="nt">lemmy_type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Users</span>
<span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">...</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">lemmy posts</span>
<span class="w"> </span><span class="nt">lemmy_type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Posts</span>
<span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">...</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">lemmy comments</span>
<span class="w"> </span><span class="nt">lemmy_type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Comments</span>
<span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">...</span>
</pre></div>
</div>
</section>
<section id="implementations">
<h2><a class="toc-backref" href="#id2" role="doc-backlink">Implementations</a><a class="headerlink" href="#implementations" title="Permalink to this heading"></a></h2>
</section>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.lemmy.base_url">
<span class="sig-prename descclassname"><span class="pre">searx.engines.lemmy.</span></span><span class="sig-name descname"><span class="pre">base_url</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'https://lemmy.ml/'</span></em><a class="headerlink" href="#searx.engines.lemmy.base_url" title="Permalink to this definition"></a></dt>
<dd><p>By default, <a class="reference external" href="https://lemmy.ml">https://lemmy.ml</a> is used for providing the results. If you want
to use a different lemmy instance, you can specify <code class="docutils literal notranslate"><span class="pre">base_url</span></code>.</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.lemmy.lemmy_type">
<span class="sig-prename descclassname"><span class="pre">searx.engines.lemmy.</span></span><span class="sig-name descname"><span class="pre">lemmy_type</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'Communities'</span></em><a class="headerlink" href="#searx.engines.lemmy.lemmy_type" title="Permalink to this definition"></a></dt>
<dd><p>Any of <code class="docutils literal notranslate"><span class="pre">Communities</span></code>, <code class="docutils literal notranslate"><span class="pre">Users</span></code>, <code class="docutils literal notranslate"><span class="pre">Posts</span></code>, <code class="docutils literal notranslate"><span class="pre">Comments</span></code></p>
</dd></dl>
</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/searxng-wordmark.svg" alt="Logo"/>
</a></p>
<h3><a href="../../../index.html">Table of Contents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../user/index.html">User information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../own-instance.html">Why use a private instance?</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../admin/index.html">Administrator documentation</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../index.html">Developer documentation</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../quickstart.html">Development Quickstart</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../contribution_guide.html">How to contribute</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../index.html">Engine Implementations</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../search_api.html">Search API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../plugins.html">Plugins</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../translation.html">Translation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../lxcdev.html">Developing in Linux Containers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../makefile.html">Makefile &amp; <code class="docutils literal notranslate"><span class="pre">./manage</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../reST.html">reST primer</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../searxng_extra/index.html">Tooling box <code class="docutils literal notranslate"><span class="pre">searxng_extra</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../utils/index.html">DevOps tooling box</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../src/index.html">Source-Code</a></li>
</ul>
<h3>Project Links</h3>
<ul>
<li><a href="https://github.com/searxng/searxng/tree/master">Source</a>
<li><a href="https://github.com/searxng/searxng/wiki">Wiki</a>
<li><a href="https://searx.space">Public instances</a>
<li><a href="https://github.com/searxng/searxng/issues">Issue Tracker</a>
</ul><h3>Navigation</h3>
<ul>
<li><a href="../../../index.html">Overview</a>
<ul>
<li><a href="../../index.html">Developer documentation</a>
<ul>
<li><a href="../index.html">Engine Implementations</a>
<ul>
<li>Previous: <a href="google.html" title="previous chapter">Google Engines</a>
<li>Next: <a href="peertube.html" title="next chapter">Peertube Engines</a></ul>
</li></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 role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../../_sources/dev/engines/online/lemmy.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright SearXNG team.
</div>
<script src="../../../_static/version_warning_offset.js"></script>
</body>
</html>

View file

@ -0,0 +1,190 @@
<!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>Peertube Engines &#8212; SearXNG Documentation (2023.8.11+905ce2a6f)</title>
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=4f649999" />
<link rel="stylesheet" type="text/css" href="../../../_static/searxng.css?v=52e4ff28" />
<link rel="stylesheet" type="text/css" href="../../../_static/tabs.css?v=a5c4661c" />
<script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js?v=3c88bde0"></script>
<script src="../../../_static/doctools.js?v=888ff710"></script>
<script src="../../../_static/sphinx_highlight.js?v=4825356b"></script>
<link rel="index" title="Index" href="../../../genindex.html" />
<link rel="search" title="Search" href="../../../search.html" />
<link rel="next" title="Piped" href="piped.html" />
<link rel="prev" title="Lemmy" href="lemmy.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="piped.html" title="Piped"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="lemmy.html" title="Lemmy"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">SearXNG Documentation (2023.8.11+905ce2a6f)</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../index.html" >Developer documentation</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="../index.html" accesskey="U">Engine Implementations</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Peertube Engines</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="peertube-engines">
<span id="id1"></span><h1>Peertube Engines<a class="headerlink" href="#peertube-engines" title="Permalink to this heading"></a></h1>
<nav class="contents local" id="contents">
<ul class="simple">
<li><p><a class="reference internal" href="#module-searx.engines.peertube" id="id2">Peertube Video</a></p></li>
<li><p><a class="reference internal" href="#module-searx.engines.sepiasearch" id="id3">SepiaSearch</a></p></li>
</ul>
</nav>
<section id="module-searx.engines.peertube">
<span id="peertube-video"></span><span id="peertube-video-engine"></span><h2><a class="toc-backref" href="#id2" role="doc-backlink">Peertube Video</a><a class="headerlink" href="#module-searx.engines.peertube" title="Permalink to this heading"></a></h2>
<p>Peertube and <a class="reference internal" href="#module-searx.engines.sepiasearch" title="searx.engines.sepiasearch"><code class="xref py py-obj docutils literal notranslate"><span class="pre">SepiaSearch</span></code></a> do share
(more or less) the same REST API and the schema of the JSON result is identical.</p>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.peertube.fetch_traits">
<span class="sig-prename descclassname"><span class="pre">searx.engines.peertube.</span></span><span class="sig-name descname"><span class="pre">fetch_traits</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">engine_traits</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="../enginelib.html#searx.enginelib.traits.EngineTraits" title="searx.enginelib.traits.EngineTraits"><span class="pre">EngineTraits</span></a></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/peertube.html#fetch_traits"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.peertube.fetch_traits" title="Permalink to this definition"></a></dt>
<dd><p>Fetch languages from peertubes search-index source code.</p>
<p>See <a class="reference external" href="https://framagit.org/framasoft/peertube/search-index/-/commit/8ed5c729#3d8747f9a60695c367c70bb64efba8f403721fad_0_291">videoLanguages</a> in commit <a class="reference external" href="https://framagit.org/framasoft/peertube/search-index/-/commit/8ed5c729">8ed5c729 - Refactor and redesign client</a></p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.peertube.request">
<span class="sig-prename descclassname"><span class="pre">searx.engines.peertube.</span></span><span class="sig-name descname"><span class="pre">request</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">query</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">params</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/peertube.html#request"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.peertube.request" title="Permalink to this definition"></a></dt>
<dd><p>Assemble request for the Peertube API</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.peertube.video_response">
<span class="sig-prename descclassname"><span class="pre">searx.engines.peertube.</span></span><span class="sig-name descname"><span class="pre">video_response</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">resp</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/peertube.html#video_response"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.peertube.video_response" title="Permalink to this definition"></a></dt>
<dd><p>Parse video response from SepiaSearch and Peertube instances.</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.peertube.base_url">
<span class="sig-prename descclassname"><span class="pre">searx.engines.peertube.</span></span><span class="sig-name descname"><span class="pre">base_url</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'https://peer.tube'</span></em><a class="headerlink" href="#searx.engines.peertube.base_url" title="Permalink to this definition"></a></dt>
<dd><p>Base URL of the Peertube instance. A list of instances is available at:</p>
<ul class="simple">
<li><p><a class="reference external" href="https://instances.joinpeertube.org/instances">https://instances.joinpeertube.org/instances</a></p></li>
</ul>
</dd></dl>
</section>
<section id="module-searx.engines.sepiasearch">
<span id="sepiasearch"></span><span id="sepiasearch-engine"></span><h2><a class="toc-backref" href="#id3" role="doc-backlink">SepiaSearch</a><a class="headerlink" href="#module-searx.engines.sepiasearch" title="Permalink to this heading"></a></h2>
<p>SepiaSearch uses the same languages as <a class="reference internal" href="#module-searx.engines.peertube" title="searx.engines.peertube"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Peertube</span></code></a> and the response is identical to the response from the
peertube engines.</p>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.sepiasearch.request">
<span class="sig-prename descclassname"><span class="pre">searx.engines.sepiasearch.</span></span><span class="sig-name descname"><span class="pre">request</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">query</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">params</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/sepiasearch.html#request"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.sepiasearch.request" title="Permalink to this definition"></a></dt>
<dd><p>Assemble request for the SepiaSearch API</p>
</dd></dl>
</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/searxng-wordmark.svg" alt="Logo"/>
</a></p>
<h3><a href="../../../index.html">Table of Contents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../user/index.html">User information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../own-instance.html">Why use a private instance?</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../admin/index.html">Administrator documentation</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../index.html">Developer documentation</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../quickstart.html">Development Quickstart</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../contribution_guide.html">How to contribute</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../index.html">Engine Implementations</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../search_api.html">Search API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../plugins.html">Plugins</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../translation.html">Translation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../lxcdev.html">Developing in Linux Containers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../makefile.html">Makefile &amp; <code class="docutils literal notranslate"><span class="pre">./manage</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../reST.html">reST primer</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../searxng_extra/index.html">Tooling box <code class="docutils literal notranslate"><span class="pre">searxng_extra</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../utils/index.html">DevOps tooling box</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../src/index.html">Source-Code</a></li>
</ul>
<h3>Project Links</h3>
<ul>
<li><a href="https://github.com/searxng/searxng/tree/master">Source</a>
<li><a href="https://github.com/searxng/searxng/wiki">Wiki</a>
<li><a href="https://searx.space">Public instances</a>
<li><a href="https://github.com/searxng/searxng/issues">Issue Tracker</a>
</ul><h3>Navigation</h3>
<ul>
<li><a href="../../../index.html">Overview</a>
<ul>
<li><a href="../../index.html">Developer documentation</a>
<ul>
<li><a href="../index.html">Engine Implementations</a>
<ul>
<li>Previous: <a href="lemmy.html" title="previous chapter">Lemmy</a>
<li>Next: <a href="piped.html" title="next chapter">Piped</a></ul>
</li></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 role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../../_sources/dev/engines/online/peertube.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright SearXNG team.
</div>
<script src="../../../_static/version_warning_offset.js"></script>
</body>
</html>

View file

@ -0,0 +1,208 @@
<!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>Piped &#8212; SearXNG Documentation (2023.8.11+905ce2a6f)</title>
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=4f649999" />
<link rel="stylesheet" type="text/css" href="../../../_static/searxng.css?v=52e4ff28" />
<link rel="stylesheet" type="text/css" href="../../../_static/tabs.css?v=a5c4661c" />
<script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js?v=3c88bde0"></script>
<script src="../../../_static/doctools.js?v=888ff710"></script>
<script src="../../../_static/sphinx_highlight.js?v=4825356b"></script>
<link rel="index" title="Index" href="../../../genindex.html" />
<link rel="search" title="Search" href="../../../search.html" />
<link rel="next" title="Recoll Engine" href="recoll.html" />
<link rel="prev" title="Peertube Engines" href="peertube.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="recoll.html" title="Recoll Engine"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="peertube.html" title="Peertube Engines"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">SearXNG Documentation (2023.8.11+905ce2a6f)</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../index.html" >Developer documentation</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="../index.html" accesskey="U">Engine Implementations</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Piped</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="piped">
<span id="piped-engine"></span><h1>Piped<a class="headerlink" href="#piped" title="Permalink to this heading"></a></h1>
<nav class="contents local" id="contents">
<p class="topic-title">Contents</p>
<ul class="simple">
<li><p><a class="reference internal" href="#configuration" id="id1">Configuration</a></p></li>
<li><p><a class="reference internal" href="#known-quirks" id="id2">Known Quirks</a></p></li>
<li><p><a class="reference internal" href="#implementations" id="id3">Implementations</a></p></li>
</ul>
</nav>
<span class="target" id="module-searx.engines.piped"></span><p>An alternative privacy-friendly YouTube frontend which is efficient by
design. <a class="reference external" href="https://docs.piped.video/docs/architecture/">Pipeds architecture</a> consists of 3 components:</p>
<ul class="simple">
<li><p><a class="reference internal" href="#searx.engines.piped.backend_url" title="searx.engines.piped.backend_url"><code class="xref py py-obj docutils literal notranslate"><span class="pre">backend</span></code></a></p></li>
<li><p><a class="reference internal" href="#searx.engines.piped.frontend_url" title="searx.engines.piped.frontend_url"><code class="xref py py-obj docutils literal notranslate"><span class="pre">frontend</span></code></a></p></li>
<li><p>proxy</p></li>
</ul>
<section id="configuration">
<h2><a class="toc-backref" href="#id1" role="doc-backlink">Configuration</a><a class="headerlink" href="#configuration" title="Permalink to this heading"></a></h2>
<p>The <a class="reference internal" href="#searx.engines.piped.backend_url" title="searx.engines.piped.backend_url"><code class="xref py py-obj docutils literal notranslate"><span class="pre">backend_url</span></code></a> and <a class="reference internal" href="#searx.engines.piped.frontend_url" title="searx.engines.piped.frontend_url"><code class="xref py py-obj docutils literal notranslate"><span class="pre">frontend_url</span></code></a> has to be set in the engine
named <cite>piped</cite> and are used by all piped engines</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">piped</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">piped</span>
<span class="w"> </span><span class="nt">piped_filter</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">videos</span>
<span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">...</span>
<span class="w"> </span><span class="nt">frontend_url</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https://..</span>
<span class="w"> </span><span class="nt">backend_url</span><span class="p">:</span>
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https://..</span>
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https://..</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">piped.music</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">piped</span>
<span class="w"> </span><span class="nt">network</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">piped</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">ppdm</span>
<span class="w"> </span><span class="nt">piped_filter</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">music_songs</span>
<span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">...</span>
</pre></div>
</div>
</section>
<section id="known-quirks">
<h2><a class="toc-backref" href="#id2" role="doc-backlink">Known Quirks</a><a class="headerlink" href="#known-quirks" title="Permalink to this heading"></a></h2>
<p>The implementation to support <a class="reference internal" href="../enginelib.html#searx.enginelib.Engine.paging" title="searx.enginelib.Engine.paging"><code class="xref py py-obj docutils literal notranslate"><span class="pre">paging</span></code></a>
is based on the <em>nextpage</em> method of Pipeds REST API / the <a class="reference internal" href="#searx.engines.piped.frontend_url" title="searx.engines.piped.frontend_url"><code class="xref py py-obj docutils literal notranslate"><span class="pre">frontend</span>
<span class="pre">API</span></code></a>. This feature is <em>next page driven</em> and plays well with the
<a class="reference internal" href="../../../admin/settings/settings_ui.html#settings-ui"><span class="std std-ref">infinite_scroll</span></a> setting in SearXNG but it does not really
fit into SearXNGs UI to select a page by number.</p>
</section>
<section id="implementations">
<h2><a class="toc-backref" href="#id3" role="doc-backlink">Implementations</a><a class="headerlink" href="#implementations" title="Permalink to this heading"></a></h2>
</section>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.piped.backend_url">
<span class="sig-prename descclassname"><span class="pre">searx.engines.piped.</span></span><span class="sig-name descname"><span class="pre">backend_url</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.11)"><span class="pre">list</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><span class="pre">str</span></a></em><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'https://pipedapi.kavin.rocks'</span></em><a class="headerlink" href="#searx.engines.piped.backend_url" title="Permalink to this definition"></a></dt>
<dd><p><a class="reference external" href="https://github.com/TeamPiped/Piped-Backend">Piped-Backend</a>: The core component behind Piped. The value is an URL or a
list of URLs. In the latter case instance will be selected randomly. For a
complete list of offical instances see Piped-Instances (<a class="reference external" href="https://piped-instances.kavin.rocks/">JSON</a>)</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.piped.frontend_url">
<span class="sig-prename descclassname"><span class="pre">searx.engines.piped.</span></span><span class="sig-name descname"><span class="pre">frontend_url</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><span class="pre">str</span></a></em><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'https://piped.video'</span></em><a class="headerlink" href="#searx.engines.piped.frontend_url" title="Permalink to this definition"></a></dt>
<dd><p><a class="reference external" href="https://github.com/TeamPiped/Piped">Piped-Frontend</a>: URL to use as link and for embeds.</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.piped.piped_filter">
<span class="sig-prename descclassname"><span class="pre">searx.engines.piped.</span></span><span class="sig-name descname"><span class="pre">piped_filter</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'all'</span></em><a class="headerlink" href="#searx.engines.piped.piped_filter" title="Permalink to this definition"></a></dt>
<dd><p>Content filter <code class="docutils literal notranslate"><span class="pre">music_songs</span></code> or <code class="docutils literal notranslate"><span class="pre">videos</span></code></p>
</dd></dl>
</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/searxng-wordmark.svg" alt="Logo"/>
</a></p>
<h3><a href="../../../index.html">Table of Contents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../user/index.html">User information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../own-instance.html">Why use a private instance?</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../admin/index.html">Administrator documentation</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../index.html">Developer documentation</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../quickstart.html">Development Quickstart</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../contribution_guide.html">How to contribute</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../index.html">Engine Implementations</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../search_api.html">Search API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../plugins.html">Plugins</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../translation.html">Translation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../lxcdev.html">Developing in Linux Containers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../makefile.html">Makefile &amp; <code class="docutils literal notranslate"><span class="pre">./manage</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../reST.html">reST primer</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../searxng_extra/index.html">Tooling box <code class="docutils literal notranslate"><span class="pre">searxng_extra</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../utils/index.html">DevOps tooling box</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../src/index.html">Source-Code</a></li>
</ul>
<h3>Project Links</h3>
<ul>
<li><a href="https://github.com/searxng/searxng/tree/master">Source</a>
<li><a href="https://github.com/searxng/searxng/wiki">Wiki</a>
<li><a href="https://searx.space">Public instances</a>
<li><a href="https://github.com/searxng/searxng/issues">Issue Tracker</a>
</ul><h3>Navigation</h3>
<ul>
<li><a href="../../../index.html">Overview</a>
<ul>
<li><a href="../../index.html">Developer documentation</a>
<ul>
<li><a href="../index.html">Engine Implementations</a>
<ul>
<li>Previous: <a href="peertube.html" title="previous chapter">Peertube Engines</a>
<li>Next: <a href="recoll.html" title="next chapter">Recoll Engine</a></ul>
</li></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 role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../../_sources/dev/engines/online/piped.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright SearXNG team.
</div>
<script src="../../../_static/version_warning_offset.js"></script>
</body>
</html>

View file

@ -0,0 +1,190 @@
<!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>Recoll Engine &#8212; SearXNG Documentation (2023.8.11+905ce2a6f)</title>
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=4f649999" />
<link rel="stylesheet" type="text/css" href="../../../_static/searxng.css?v=52e4ff28" />
<link rel="stylesheet" type="text/css" href="../../../_static/tabs.css?v=a5c4661c" />
<script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js?v=3c88bde0"></script>
<script src="../../../_static/doctools.js?v=888ff710"></script>
<script src="../../../_static/sphinx_highlight.js?v=4825356b"></script>
<link rel="index" title="Index" href="../../../genindex.html" />
<link rel="search" title="Search" href="../../../search.html" />
<link rel="next" title="Startpage Engines" href="startpage.html" />
<link rel="prev" title="Piped" href="piped.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="startpage.html" title="Startpage Engines"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="piped.html" title="Piped"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">SearXNG Documentation (2023.8.11+905ce2a6f)</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../index.html" >Developer documentation</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="../index.html" accesskey="U">Engine Implementations</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Recoll Engine</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="recoll-engine">
<span id="engine-recoll"></span><h1>Recoll Engine<a class="headerlink" href="#recoll-engine" title="Permalink to this heading"></a></h1>
<nav class="contents local" id="contents">
<ul class="simple">
<li><p><a class="reference internal" href="#configuration" id="id1">Configuration</a></p></li>
<li><p><a class="reference internal" href="#example" id="id2">Example</a></p></li>
<li><p><a class="reference internal" href="#implementations" id="id3">Implementations</a></p></li>
</ul>
</nav>
<span class="target" id="module-searx.engines.recoll"></span><aside class="sidebar">
<p class="sidebar-title">info</p>
<ul class="simple">
<li><p><a class="reference external" href="https://www.lesbonscomptes.com/recoll/">Recoll</a></p></li>
<li><p><a class="reference external" href="https://framagit.org/medoc92/recollwebui.git">recoll-webui</a></p></li>
<li><p><a class="reference external" href="https://github.com/searxng/searxng/blob/master/searx/engines/recoll.py">git://searx/engines/recoll.py</a></p></li>
</ul>
</aside>
<p><a class="reference external" href="https://www.lesbonscomptes.com/recoll/">Recoll</a> is a desktop full-text search tool based on Xapian. By itself <a class="reference external" href="https://www.lesbonscomptes.com/recoll/">Recoll</a>
does not offer WEB or API access, this can be achieved using <a class="reference external" href="https://framagit.org/medoc92/recollwebui.git">recoll-webui</a></p>
<section id="configuration">
<h2><a class="toc-backref" href="#id1" role="doc-backlink">Configuration</a><a class="headerlink" href="#configuration" title="Permalink to this heading"></a></h2>
<p>You must configure the following settings:</p>
<dl class="simple">
<dt><code class="docutils literal notranslate"><span class="pre">base_url</span></code>:</dt><dd><p>Location where recoll-webui can be reached.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">mount_prefix</span></code>:</dt><dd><p>Location where the file hierarchy is mounted on your <em>local</em> filesystem.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">dl_prefix</span></code>:</dt><dd><p>Location where the file hierarchy as indexed by recoll can be reached.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">search_dir</span></code>:</dt><dd><p>Part of the indexed file hierarchy to be search, if empty the full domain is
searched.</p>
</dd>
</dl>
</section>
<section id="example">
<h2><a class="toc-backref" href="#id2" role="doc-backlink">Example</a><a class="headerlink" href="#example" title="Permalink to this heading"></a></h2>
<p>Scenario:</p>
<ol class="arabic simple">
<li><p>Recoll indexes a local filesystem mounted in <code class="docutils literal notranslate"><span class="pre">/export/documents/reference</span></code>,</p></li>
<li><p>the Recoll search interface can be reached at <a class="reference external" href="https://recoll.example.org/">https://recoll.example.org/</a> and</p></li>
<li><p>the contents of this filesystem can be reached though <a class="reference external" href="https://download.example.org/reference">https://download.example.org/reference</a></p></li>
</ol>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="nt">base_url</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https://recoll.example.org/</span>
<span class="nt">mount_prefix</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">/export/documents</span>
<span class="nt">dl_prefix</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https://download.example.org</span>
<span class="nt">search_dir</span><span class="p">:</span><span class="w"> </span><span class="s">&#39;&#39;</span>
</pre></div>
</div>
</section>
<section id="implementations">
<h2><a class="toc-backref" href="#id3" role="doc-backlink">Implementations</a><a class="headerlink" href="#implementations" title="Permalink to this heading"></a></h2>
</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/searxng-wordmark.svg" alt="Logo"/>
</a></p>
<h3><a href="../../../index.html">Table of Contents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../user/index.html">User information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../own-instance.html">Why use a private instance?</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../admin/index.html">Administrator documentation</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../index.html">Developer documentation</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../quickstart.html">Development Quickstart</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../contribution_guide.html">How to contribute</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../index.html">Engine Implementations</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../search_api.html">Search API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../plugins.html">Plugins</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../translation.html">Translation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../lxcdev.html">Developing in Linux Containers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../makefile.html">Makefile &amp; <code class="docutils literal notranslate"><span class="pre">./manage</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../reST.html">reST primer</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../searxng_extra/index.html">Tooling box <code class="docutils literal notranslate"><span class="pre">searxng_extra</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../utils/index.html">DevOps tooling box</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../src/index.html">Source-Code</a></li>
</ul>
<h3>Project Links</h3>
<ul>
<li><a href="https://github.com/searxng/searxng/tree/master">Source</a>
<li><a href="https://github.com/searxng/searxng/wiki">Wiki</a>
<li><a href="https://searx.space">Public instances</a>
<li><a href="https://github.com/searxng/searxng/issues">Issue Tracker</a>
</ul><h3>Navigation</h3>
<ul>
<li><a href="../../../index.html">Overview</a>
<ul>
<li><a href="../../index.html">Developer documentation</a>
<ul>
<li><a href="../index.html">Engine Implementations</a>
<ul>
<li>Previous: <a href="piped.html" title="previous chapter">Piped</a>
<li>Next: <a href="startpage.html" title="next chapter">Startpage Engines</a></ul>
</li></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 role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../../_sources/dev/engines/online/recoll.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright SearXNG team.
</div>
<script src="../../../_static/version_warning_offset.js"></script>
</body>
</html>

View file

@ -0,0 +1,281 @@
<!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>Startpage Engines &#8212; SearXNG Documentation (2023.8.11+905ce2a6f)</title>
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=4f649999" />
<link rel="stylesheet" type="text/css" href="../../../_static/searxng.css?v=52e4ff28" />
<link rel="stylesheet" type="text/css" href="../../../_static/tabs.css?v=a5c4661c" />
<script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js?v=3c88bde0"></script>
<script src="../../../_static/doctools.js?v=888ff710"></script>
<script src="../../../_static/sphinx_highlight.js?v=4825356b"></script>
<link rel="index" title="Index" href="../../../genindex.html" />
<link rel="search" title="Search" href="../../../search.html" />
<link rel="next" title="Tagesschau API" href="tagesschau.html" />
<link rel="prev" title="Recoll Engine" href="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="tagesschau.html" title="Tagesschau API"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="recoll.html" title="Recoll Engine"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">SearXNG Documentation (2023.8.11+905ce2a6f)</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../index.html" >Developer documentation</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="../index.html" accesskey="U">Engine Implementations</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Startpage Engines</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="startpage-engines">
<span id="id1"></span><h1>Startpage Engines<a class="headerlink" href="#startpage-engines" title="Permalink to this heading"></a></h1>
<nav class="contents local" id="contents">
<ul class="simple">
<li><p><a class="reference internal" href="#startpage-regions" id="id9">Startpage regions</a></p></li>
<li><p><a class="reference internal" href="#startpage-languages" id="id10">Startpage languages</a></p></li>
<li><p><a class="reference internal" href="#startpage-categories" id="id11">Startpage categories</a></p></li>
</ul>
</nav>
<span class="target" id="module-searx.engines.startpage"></span><p>Startpages language &amp; region selectors are a mess ..</p>
<section id="startpage-regions">
<span id="id2"></span><h2><a class="toc-backref" href="#id9" role="doc-backlink">Startpage regions</a><a class="headerlink" href="#startpage-regions" title="Permalink to this heading"></a></h2>
<p>In the list of regions there are tags we need to map to common region tags:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">pt</span><span class="o">-</span><span class="n">BR_BR</span> <span class="o">--&gt;</span> <span class="n">pt_BR</span>
<span class="n">zh</span><span class="o">-</span><span class="n">CN_CN</span> <span class="o">--&gt;</span> <span class="n">zh_Hans_CN</span>
<span class="n">zh</span><span class="o">-</span><span class="n">TW_TW</span> <span class="o">--&gt;</span> <span class="n">zh_Hant_TW</span>
<span class="n">zh</span><span class="o">-</span><span class="n">TW_HK</span> <span class="o">--&gt;</span> <span class="n">zh_Hant_HK</span>
<span class="n">en</span><span class="o">-</span><span class="n">GB_GB</span> <span class="o">--&gt;</span> <span class="n">en_GB</span>
</pre></div>
</div>
<p>and there is at least one tag with a three letter language tag (ISO 639-2):</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">fil_PH</span> <span class="o">--&gt;</span> <span class="n">fil_PH</span>
</pre></div>
</div>
<p>The locale code <code class="docutils literal notranslate"><span class="pre">no_NO</span></code> from Startpage does not exists and is mapped to
<code class="docutils literal notranslate"><span class="pre">nb-NO</span></code>:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">babel</span><span class="o">.</span><span class="n">core</span><span class="o">.</span><span class="n">UnknownLocaleError</span><span class="p">:</span> <span class="n">unknown</span> <span class="n">locale</span> <span class="s1">&#39;no_NO&#39;</span>
</pre></div>
</div>
<p>For reference see languages-subtag at iana; <code class="docutils literal notranslate"><span class="pre">no</span></code> is the macrolanguage <a class="footnote-reference brackets" href="#id5" id="id3" role="doc-noteref"><span class="fn-bracket">[</span>1<span class="fn-bracket">]</span></a> and
W3C recommends subtag over macrolanguage <a class="footnote-reference brackets" href="#id6" id="id4" role="doc-noteref"><span class="fn-bracket">[</span>2<span class="fn-bracket">]</span></a>.</p>
<aside class="footnote-list brackets">
<aside class="footnote brackets" id="id5" role="note">
<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#id3">1</a><span class="fn-bracket">]</span></span>
<p><a class="reference external" href="https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry">iana: language-subtag-registry</a></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nb">type</span><span class="p">:</span> <span class="n">language</span>
<span class="n">Subtag</span><span class="p">:</span> <span class="n">nb</span>
<span class="n">Description</span><span class="p">:</span> <span class="n">Norwegian</span> <span class="n">Bokmål</span>
<span class="n">Added</span><span class="p">:</span> <span class="mi">2005</span><span class="o">-</span><span class="mi">10</span><span class="o">-</span><span class="mi">16</span>
<span class="n">Suppress</span><span class="o">-</span><span class="n">Script</span><span class="p">:</span> <span class="n">Latn</span>
<span class="n">Macrolanguage</span><span class="p">:</span> <span class="n">no</span>
</pre></div>
</div>
</aside>
<aside class="footnote brackets" id="id6" role="note">
<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#id4">2</a><span class="fn-bracket">]</span></span>
<p>Use macrolanguages with care. Some language subtags have a Scope field set to
macrolanguage, i.e. this primary language subtag encompasses a number of more
specific primary language subtags in the registry. … As we recommended for
the collection subtags mentioned above, in most cases you should try to use
the more specific subtags … <a class="reference external" href="https://www.w3.org/International/questions/qa-choosing-language-tags#langsubtag">W3: The primary language subtag</a></p>
</aside>
</aside>
</section>
<section id="startpage-languages">
<span id="id7"></span><h2><a class="toc-backref" href="#id10" role="doc-backlink">Startpage languages</a><a class="headerlink" href="#startpage-languages" title="Permalink to this heading"></a></h2>
<dl>
<dt><a class="reference internal" href="#searx.engines.startpage.send_accept_language_header" title="searx.engines.startpage.send_accept_language_header"><code class="xref py py-obj docutils literal notranslate"><span class="pre">send_accept_language_header</span></code></a>:</dt><dd><p>The displayed name in Startpages settings page depend on the location of the
IP when <code class="docutils literal notranslate"><span class="pre">Accept-Language</span></code> HTTP header is unset. In <a class="reference internal" href="#searx.engines.startpage.fetch_traits" title="searx.engines.startpage.fetch_traits"><code class="xref py py-obj docutils literal notranslate"><span class="pre">fetch_traits</span></code></a>
we use:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="s1">&#39;Accept-Language&#39;</span><span class="p">:</span> <span class="s2">&quot;en-US,en;q=0.5&quot;</span><span class="p">,</span>
<span class="o">..</span>
</pre></div>
</div>
<p>to get uniform names independent from the IP).</p>
</dd>
</dl>
</section>
<section id="startpage-categories">
<span id="id8"></span><h2><a class="toc-backref" href="#id11" role="doc-backlink">Startpage categories</a><a class="headerlink" href="#startpage-categories" title="Permalink to this heading"></a></h2>
<p>Startpages category (for Web-search, News, Videos, ..) is set by
<a class="reference internal" href="#searx.engines.startpage.startpage_categ" title="searx.engines.startpage.startpage_categ"><code class="xref py py-obj docutils literal notranslate"><span class="pre">startpage_categ</span></code></a> in settings.yml:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">-</span> <span class="n">name</span><span class="p">:</span> <span class="n">startpage</span>
<span class="n">engine</span><span class="p">:</span> <span class="n">startpage</span>
<span class="n">startpage_categ</span><span class="p">:</span> <span class="n">web</span>
<span class="o">...</span>
</pre></div>
</div>
<div class="admonition hint">
<p class="admonition-title">Hint</p>
<p>The default category is <code class="docutils literal notranslate"><span class="pre">web</span></code> .. and other categories than <code class="docutils literal notranslate"><span class="pre">web</span></code> are not
yet implemented.</p>
</div>
</section>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.startpage.fetch_traits">
<span class="sig-prename descclassname"><span class="pre">searx.engines.startpage.</span></span><span class="sig-name descname"><span class="pre">fetch_traits</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">engine_traits</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="../enginelib.html#searx.enginelib.traits.EngineTraits" title="searx.enginelib.traits.EngineTraits"><span class="pre">EngineTraits</span></a></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/startpage.html#fetch_traits"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.startpage.fetch_traits" title="Permalink to this definition"></a></dt>
<dd><p>Fetch <a class="reference internal" href="#startpage-languages"><span class="std std-ref">languages</span></a> and <a class="reference internal" href="#startpage-regions"><span class="std std-ref">regions</span></a> from Startpage.</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.startpage.get_sc_code">
<span class="sig-prename descclassname"><span class="pre">searx.engines.startpage.</span></span><span class="sig-name descname"><span class="pre">get_sc_code</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">searxng_locale</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">params</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/startpage.html#get_sc_code"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.startpage.get_sc_code" title="Permalink to this definition"></a></dt>
<dd><p>Get an actual <code class="docutils literal notranslate"><span class="pre">sc</span></code> argument from Startpages search form (HTML page).</p>
<p>Startpage puts a <code class="docutils literal notranslate"><span class="pre">sc</span></code> argument on every HTML <a class="reference internal" href="#searx.engines.startpage.search_form_xpath" title="searx.engines.startpage.search_form_xpath"><code class="xref py py-obj docutils literal notranslate"><span class="pre">search</span> <span class="pre">form</span></code></a>. Without this argument Startpage considers the request
is from a bot. We do not know what is encoded in the value of the <code class="docutils literal notranslate"><span class="pre">sc</span></code>
argument, but it seems to be a kind of a <em>time-stamp</em>.</p>
<p>Startpages search form generates a new sc-code on each request. This
function scrap a new sc-code from Startpages home page every
<a class="reference internal" href="#searx.engines.startpage.sc_code_cache_sec" title="searx.engines.startpage.sc_code_cache_sec"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sc_code_cache_sec</span></code></a> seconds.</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.startpage.request">
<span class="sig-prename descclassname"><span class="pre">searx.engines.startpage.</span></span><span class="sig-name descname"><span class="pre">request</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">query</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">params</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/startpage.html#request"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.startpage.request" title="Permalink to this definition"></a></dt>
<dd><p>Assemble a Startpage request.</p>
<p>To avoid CAPTCHA we need to send a well formed HTTP POST request with a
cookie. We need to form a request that is identical to the request build by
Startpages search form:</p>
<ul class="simple">
<li><p>in the cookie the <strong>region</strong> is selected</p></li>
<li><p>in the HTTP POST data the <strong>language</strong> is selected</p></li>
</ul>
<p>Additionally the arguments form Startpages search form needs to be set in
HTML POST data / compare <code class="docutils literal notranslate"><span class="pre">&lt;input&gt;</span></code> elements: <a class="reference internal" href="#searx.engines.startpage.search_form_xpath" title="searx.engines.startpage.search_form_xpath"><code class="xref py py-obj docutils literal notranslate"><span class="pre">search_form_xpath</span></code></a>.</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.startpage.sc_code_cache_sec">
<span class="sig-prename descclassname"><span class="pre">searx.engines.startpage.</span></span><span class="sig-name descname"><span class="pre">sc_code_cache_sec</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">30</span></em><a class="headerlink" href="#searx.engines.startpage.sc_code_cache_sec" title="Permalink to this definition"></a></dt>
<dd><p>Time in seconds the sc-code is cached in memory <a class="reference internal" href="#searx.engines.startpage.get_sc_code" title="searx.engines.startpage.get_sc_code"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_sc_code</span></code></a>.</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.startpage.search_form_xpath">
<span class="sig-prename descclassname"><span class="pre">searx.engines.startpage.</span></span><span class="sig-name descname"><span class="pre">search_form_xpath</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'//form[&#64;id=&quot;search&quot;]'</span></em><a class="headerlink" href="#searx.engines.startpage.search_form_xpath" title="Permalink to this definition"></a></dt>
<dd><p>XPath of Startpages origin search form</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.startpage.send_accept_language_header">
<span class="sig-prename descclassname"><span class="pre">searx.engines.startpage.</span></span><span class="sig-name descname"><span class="pre">send_accept_language_header</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">True</span></em><a class="headerlink" href="#searx.engines.startpage.send_accept_language_header" title="Permalink to this definition"></a></dt>
<dd><p>Startpage tries to guess users language and territory from the HTTP
<code class="docutils literal notranslate"><span class="pre">Accept-Language</span></code>. Optional the user can select a search-language (can be
different to the UI language) and a region filter.</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.startpage.startpage_categ">
<span class="sig-prename descclassname"><span class="pre">searx.engines.startpage.</span></span><span class="sig-name descname"><span class="pre">startpage_categ</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'web'</span></em><a class="headerlink" href="#searx.engines.startpage.startpage_categ" title="Permalink to this definition"></a></dt>
<dd><p>Startpages category, visit <a class="reference internal" href="#startpage-categories"><span class="std std-ref">Startpage categories</span></a>.</p>
</dd></dl>
</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/searxng-wordmark.svg" alt="Logo"/>
</a></p>
<h3><a href="../../../index.html">Table of Contents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../user/index.html">User information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../own-instance.html">Why use a private instance?</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../admin/index.html">Administrator documentation</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../index.html">Developer documentation</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../quickstart.html">Development Quickstart</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../contribution_guide.html">How to contribute</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../index.html">Engine Implementations</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../search_api.html">Search API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../plugins.html">Plugins</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../translation.html">Translation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../lxcdev.html">Developing in Linux Containers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../makefile.html">Makefile &amp; <code class="docutils literal notranslate"><span class="pre">./manage</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../reST.html">reST primer</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../searxng_extra/index.html">Tooling box <code class="docutils literal notranslate"><span class="pre">searxng_extra</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../utils/index.html">DevOps tooling box</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../src/index.html">Source-Code</a></li>
</ul>
<h3>Project Links</h3>
<ul>
<li><a href="https://github.com/searxng/searxng/tree/master">Source</a>
<li><a href="https://github.com/searxng/searxng/wiki">Wiki</a>
<li><a href="https://searx.space">Public instances</a>
<li><a href="https://github.com/searxng/searxng/issues">Issue Tracker</a>
</ul><h3>Navigation</h3>
<ul>
<li><a href="../../../index.html">Overview</a>
<ul>
<li><a href="../../index.html">Developer documentation</a>
<ul>
<li><a href="../index.html">Engine Implementations</a>
<ul>
<li>Previous: <a href="recoll.html" title="previous chapter">Recoll Engine</a>
<li>Next: <a href="tagesschau.html" title="next chapter">Tagesschau API</a></ul>
</li></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 role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../../_sources/dev/engines/online/startpage.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright SearXNG team.
</div>
<script src="../../../_static/version_warning_offset.js"></script>
</body>
</html>

View file

@ -0,0 +1,146 @@
<!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>Tagesschau API &#8212; SearXNG Documentation (2023.8.11+905ce2a6f)</title>
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=4f649999" />
<link rel="stylesheet" type="text/css" href="../../../_static/searxng.css?v=52e4ff28" />
<link rel="stylesheet" type="text/css" href="../../../_static/tabs.css?v=a5c4661c" />
<script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js?v=3c88bde0"></script>
<script src="../../../_static/doctools.js?v=888ff710"></script>
<script src="../../../_static/sphinx_highlight.js?v=4825356b"></script>
<link rel="index" title="Index" href="../../../genindex.html" />
<link rel="search" title="Search" href="../../../search.html" />
<link rel="next" title="Torznab WebAPI" href="torznab.html" />
<link rel="prev" title="Startpage Engines" href="startpage.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="torznab.html" title="Torznab WebAPI"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="startpage.html" title="Startpage Engines"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">SearXNG Documentation (2023.8.11+905ce2a6f)</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../index.html" >Developer documentation</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="../index.html" accesskey="U">Engine Implementations</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Tagesschau API</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="tagesschau-api">
<span id="tagesschau-engine"></span><h1>Tagesschau API<a class="headerlink" href="#tagesschau-api" title="Permalink to this heading"></a></h1>
<span class="target" id="module-searx.engines.tagesschau"></span><p>ARD: <a class="reference external" href="https://github.com/AndreasFischer1985/tagesschau-api/blob/main/README_en.md">Tagesschau API</a></p>
<p>The Tagesschau is a news program of the ARD. Via the <a class="reference external" href="https://github.com/AndreasFischer1985/tagesschau-api/blob/main/README_en.md">Tagesschau API</a>, current
news and media reports are available in JSON format. The <a class="reference external" href="https://github.com/bundesAPI">Bundesstelle für Open
Data</a> offers a <a class="reference external" href="https://swagger.io/specification/">OpenAPI</a> portal at <a class="reference external" href="https://bund.dev/apis">bundDEV</a> where APIs are documented an can
be tested.</p>
<p>This SearXNG engine uses the <a class="reference external" href="http://tagesschau.api.bund.dev/">/api2u/search</a> API.</p>
</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/searxng-wordmark.svg" alt="Logo"/>
</a></p>
<h3><a href="../../../index.html">Table of Contents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../user/index.html">User information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../own-instance.html">Why use a private instance?</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../admin/index.html">Administrator documentation</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../index.html">Developer documentation</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../quickstart.html">Development Quickstart</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../contribution_guide.html">How to contribute</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../index.html">Engine Implementations</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../search_api.html">Search API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../plugins.html">Plugins</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../translation.html">Translation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../lxcdev.html">Developing in Linux Containers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../makefile.html">Makefile &amp; <code class="docutils literal notranslate"><span class="pre">./manage</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../reST.html">reST primer</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../searxng_extra/index.html">Tooling box <code class="docutils literal notranslate"><span class="pre">searxng_extra</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../utils/index.html">DevOps tooling box</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../src/index.html">Source-Code</a></li>
</ul>
<h3>Project Links</h3>
<ul>
<li><a href="https://github.com/searxng/searxng/tree/master">Source</a>
<li><a href="https://github.com/searxng/searxng/wiki">Wiki</a>
<li><a href="https://searx.space">Public instances</a>
<li><a href="https://github.com/searxng/searxng/issues">Issue Tracker</a>
</ul><h3>Navigation</h3>
<ul>
<li><a href="../../../index.html">Overview</a>
<ul>
<li><a href="../../index.html">Developer documentation</a>
<ul>
<li><a href="../index.html">Engine Implementations</a>
<ul>
<li>Previous: <a href="startpage.html" title="previous chapter">Startpage Engines</a>
<li>Next: <a href="torznab.html" title="next chapter">Torznab WebAPI</a></ul>
</li></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 role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../../_sources/dev/engines/online/tagesschau.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright SearXNG team.
</div>
<script src="../../../_static/version_warning_offset.js"></script>
</body>
</html>

View file

@ -0,0 +1,212 @@
<!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>Torznab WebAPI &#8212; SearXNG Documentation (2023.8.11+905ce2a6f)</title>
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=4f649999" />
<link rel="stylesheet" type="text/css" href="../../../_static/searxng.css?v=52e4ff28" />
<link rel="stylesheet" type="text/css" href="../../../_static/tabs.css?v=a5c4661c" />
<script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js?v=3c88bde0"></script>
<script src="../../../_static/doctools.js?v=888ff710"></script>
<script src="../../../_static/sphinx_highlight.js?v=4825356b"></script>
<link rel="index" title="Index" href="../../../genindex.html" />
<link rel="search" title="Search" href="../../../search.html" />
<link rel="next" title="Wikimedia" href="wikipedia.html" />
<link rel="prev" title="Tagesschau API" href="tagesschau.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="wikipedia.html" title="Wikimedia"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="tagesschau.html" title="Tagesschau API"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">SearXNG Documentation (2023.8.11+905ce2a6f)</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../index.html" >Developer documentation</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="../index.html" accesskey="U">Engine Implementations</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Torznab WebAPI</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="torznab-webapi">
<span id="torznab-engine"></span><h1>Torznab WebAPI<a class="headerlink" href="#torznab-webapi" title="Permalink to this heading"></a></h1>
<nav class="contents local" id="contents">
<ul class="simple">
<li><p><a class="reference internal" href="#configuration" id="id1">Configuration</a></p></li>
<li><p><a class="reference internal" href="#implementations" id="id2">Implementations</a></p></li>
</ul>
</nav>
<span class="target" id="module-searx.engines.torznab"></span><p><a class="reference external" href="https://torznab.github.io/spec-1.3-draft/index.html">Torznab</a> is an API specification that provides a standardized way to query
torrent site for content. It is used by a number of torrent applications,
including <a class="reference external" href="https://github.com/Prowlarr/Prowlarr">Prowlarr</a> and <a class="reference external" href="https://github.com/Jackett/Jackett">Jackett</a>.</p>
<p>Using this engine together with <a class="reference external" href="https://github.com/Prowlarr/Prowlarr">Prowlarr</a> or <a class="reference external" href="https://github.com/Jackett/Jackett">Jackett</a> allows you to search
a huge number of torrent sites which are not directly supported.</p>
<section id="configuration">
<h2><a class="toc-backref" href="#id1" role="doc-backlink">Configuration</a><a class="headerlink" href="#configuration" title="Permalink to this heading"></a></h2>
<p>The engine has the following settings:</p>
<dl class="simple">
<dt><code class="docutils literal notranslate"><span class="pre">base_url</span></code>:</dt><dd><p>Torznab endpoint URL.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">api_key</span></code>:</dt><dd><p>The API key to use for authentication.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">torznab_categories</span></code>:</dt><dd><p>The categories to use for searching. This is a list of category IDs. See
<a class="reference external" href="https://wiki.servarr.com/en/prowlarr/cardigann-yml-definition#categories">Prowlarr-categories</a> or <a class="reference external" href="https://github.com/Jackett/Jackett/wiki/Jackett-Categories">Jackett-categories</a> for more information.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">show_torrent_files</span></code>:</dt><dd><p>Whether to show the torrent file in the search results. Be carful as using
this with <a class="reference external" href="https://github.com/Prowlarr/Prowlarr">Prowlarr</a> or <a class="reference external" href="https://github.com/Jackett/Jackett">Jackett</a> leaks the API key. This should be used only
if you are querying a Torznab endpoint without authentication or if the
instance is private. Be aware that private trackers may ban you if you share
the torrent file. Defaults to <code class="docutils literal notranslate"><span class="pre">false</span></code>.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">show_magnet_links</span></code>:</dt><dd><p>Whether to show the magnet link in the search results. Be aware that private
trackers may ban you if you share the magnet link. Defaults to <code class="docutils literal notranslate"><span class="pre">true</span></code>.</p>
</dd>
</dl>
</section>
<section id="implementations">
<h2><a class="toc-backref" href="#id2" role="doc-backlink">Implementations</a><a class="headerlink" href="#implementations" title="Permalink to this heading"></a></h2>
</section>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.torznab.build_result">
<span class="sig-prename descclassname"><span class="pre">searx.engines.torznab.</span></span><span class="sig-name descname"><span class="pre">build_result</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">item</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Element</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference external" href="https://docs.python.org/3/library/typing.html#typing.Dict" title="(in Python v3.11)"><span class="pre">Dict</span></a><span class="p"><span class="pre">[</span></span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><span class="pre">str</span></a><span class="p"><span class="pre">,</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/typing.html#typing.Any" title="(in Python v3.11)"><span class="pre">Any</span></a><span class="p"><span class="pre">]</span></span></span></span><a class="reference internal" href="../../../_modules/searx/engines/torznab.html#build_result"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.torznab.build_result" title="Permalink to this definition"></a></dt>
<dd><p>Build a result from a XML item.</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.torznab.get_attribute">
<span class="sig-prename descclassname"><span class="pre">searx.engines.torznab.</span></span><span class="sig-name descname"><span class="pre">get_attribute</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">item</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">etree.Element</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">property_name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><span class="pre">str</span></a></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><span class="pre">str</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.11)"><span class="pre">None</span></a></span></span><a class="reference internal" href="../../../_modules/searx/engines/torznab.html#get_attribute"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.torznab.get_attribute" title="Permalink to this definition"></a></dt>
<dd><p>Get attribute from item.</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.torznab.get_torznab_attribute">
<span class="sig-prename descclassname"><span class="pre">searx.engines.torznab.</span></span><span class="sig-name descname"><span class="pre">get_torznab_attribute</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">item</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">etree.Element</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">attribute_name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><span class="pre">str</span></a></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><span class="pre">str</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.11)"><span class="pre">None</span></a></span></span><a class="reference internal" href="../../../_modules/searx/engines/torznab.html#get_torznab_attribute"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.torznab.get_torznab_attribute" title="Permalink to this definition"></a></dt>
<dd><p>Get torznab special attribute from item.</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.torznab.init">
<span class="sig-prename descclassname"><span class="pre">searx.engines.torznab.</span></span><span class="sig-name descname"><span class="pre">init</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">engine_settings</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/torznab.html#init"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.torznab.init" title="Permalink to this definition"></a></dt>
<dd><p>Initialize the engine.</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.torznab.request">
<span class="sig-prename descclassname"><span class="pre">searx.engines.torznab.</span></span><span class="sig-name descname"><span class="pre">request</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">query</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><span class="pre">str</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">params</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/typing.html#typing.Dict" title="(in Python v3.11)"><span class="pre">Dict</span></a><span class="p"><span class="pre">[</span></span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><span class="pre">str</span></a><span class="p"><span class="pre">,</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/typing.html#typing.Any" title="(in Python v3.11)"><span class="pre">Any</span></a><span class="p"><span class="pre">]</span></span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference external" href="https://docs.python.org/3/library/typing.html#typing.Dict" title="(in Python v3.11)"><span class="pre">Dict</span></a><span class="p"><span class="pre">[</span></span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><span class="pre">str</span></a><span class="p"><span class="pre">,</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/typing.html#typing.Any" title="(in Python v3.11)"><span class="pre">Any</span></a><span class="p"><span class="pre">]</span></span></span></span><a class="reference internal" href="../../../_modules/searx/engines/torznab.html#request"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.torznab.request" title="Permalink to this definition"></a></dt>
<dd><p>Build the request params.</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.torznab.response">
<span class="sig-prename descclassname"><span class="pre">searx.engines.torznab.</span></span><span class="sig-name descname"><span class="pre">response</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">resp</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">httpx.Response</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">List</span><span class="p"><span class="pre">[</span></span><span class="pre">Dict</span><span class="p"><span class="pre">[</span></span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><span class="pre">str</span></a><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">Any</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span></span></span><a class="reference internal" href="../../../_modules/searx/engines/torznab.html#response"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.torznab.response" title="Permalink to this definition"></a></dt>
<dd><p>Parse the XML response and return a list of results.</p>
</dd></dl>
</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/searxng-wordmark.svg" alt="Logo"/>
</a></p>
<h3><a href="../../../index.html">Table of Contents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../user/index.html">User information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../own-instance.html">Why use a private instance?</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../admin/index.html">Administrator documentation</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../index.html">Developer documentation</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../quickstart.html">Development Quickstart</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../contribution_guide.html">How to contribute</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../index.html">Engine Implementations</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../search_api.html">Search API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../plugins.html">Plugins</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../translation.html">Translation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../lxcdev.html">Developing in Linux Containers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../makefile.html">Makefile &amp; <code class="docutils literal notranslate"><span class="pre">./manage</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../reST.html">reST primer</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../searxng_extra/index.html">Tooling box <code class="docutils literal notranslate"><span class="pre">searxng_extra</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../utils/index.html">DevOps tooling box</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../src/index.html">Source-Code</a></li>
</ul>
<h3>Project Links</h3>
<ul>
<li><a href="https://github.com/searxng/searxng/tree/master">Source</a>
<li><a href="https://github.com/searxng/searxng/wiki">Wiki</a>
<li><a href="https://searx.space">Public instances</a>
<li><a href="https://github.com/searxng/searxng/issues">Issue Tracker</a>
</ul><h3>Navigation</h3>
<ul>
<li><a href="../../../index.html">Overview</a>
<ul>
<li><a href="../../index.html">Developer documentation</a>
<ul>
<li><a href="../index.html">Engine Implementations</a>
<ul>
<li>Previous: <a href="tagesschau.html" title="previous chapter">Tagesschau API</a>
<li>Next: <a href="wikipedia.html" title="next chapter">Wikimedia</a></ul>
</li></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 role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../../_sources/dev/engines/online/torznab.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright SearXNG team.
</div>
<script src="../../../_static/version_warning_offset.js"></script>
</body>
</html>

View file

@ -0,0 +1,299 @@
<!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>Wikimedia &#8212; SearXNG Documentation (2023.8.11+905ce2a6f)</title>
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=4f649999" />
<link rel="stylesheet" type="text/css" href="../../../_static/searxng.css?v=52e4ff28" />
<link rel="stylesheet" type="text/css" href="../../../_static/tabs.css?v=a5c4661c" />
<script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js?v=3c88bde0"></script>
<script src="../../../_static/doctools.js?v=888ff710"></script>
<script src="../../../_static/sphinx_highlight.js?v=4825356b"></script>
<link rel="index" title="Index" href="../../../genindex.html" />
<link rel="search" title="Search" href="../../../search.html" />
<link rel="next" title="Yacy" href="yacy.html" />
<link rel="prev" title="Torznab WebAPI" href="torznab.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="yacy.html" title="Yacy"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="torznab.html" title="Torznab WebAPI"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">SearXNG Documentation (2023.8.11+905ce2a6f)</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../index.html" >Developer documentation</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="../index.html" accesskey="U">Engine Implementations</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Wikimedia</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="wikimedia">
<span id="wikimedia-engines"></span><h1>Wikimedia<a class="headerlink" href="#wikimedia" title="Permalink to this heading"></a></h1>
<nav class="contents local" id="contents">
<ul class="simple">
<li><p><a class="reference internal" href="#module-searx.engines.wikipedia" id="id1">Wikipedia</a></p></li>
<li><p><a class="reference internal" href="#module-searx.engines.wikidata" id="id2">Wikidata</a></p></li>
</ul>
</nav>
<section id="module-searx.engines.wikipedia">
<span id="wikipedia"></span><span id="wikipedia-engine"></span><h2><a class="toc-backref" href="#id1" role="doc-backlink">Wikipedia</a><a class="headerlink" href="#module-searx.engines.wikipedia" title="Permalink to this heading"></a></h2>
<p>This module implements the Wikipedia engine. Some of this implementations
are shared by other engines:</p>
<ul class="simple">
<li><p><a class="reference internal" href="#wikidata-engine"><span class="std std-ref">Wikidata</span></a></p></li>
</ul>
<p>The list of supported languages is <a class="reference internal" href="#searx.engines.wikipedia.fetch_wikimedia_traits" title="searx.engines.wikipedia.fetch_wikimedia_traits"><code class="xref py py-obj docutils literal notranslate"><span class="pre">fetched</span></code></a> from
the article linked by <a class="reference internal" href="#searx.engines.wikipedia.list_of_wikipedias" title="searx.engines.wikipedia.list_of_wikipedias"><code class="xref py py-obj docutils literal notranslate"><span class="pre">list_of_wikipedias</span></code></a>.</p>
<p>Unlike traditional search engines, wikipedia does not support one Wikipedia for
all languages, but there is one Wikipedia for each supported language. Some of
these Wikipedias have a <a class="reference external" href="https://www.mediawiki.org/wiki/Writing_systems#LanguageConverter">LanguageConverter</a> enabled
(<a class="reference internal" href="#searx.engines.wikipedia.rest_v1_summary_url" title="searx.engines.wikipedia.rest_v1_summary_url"><code class="xref py py-obj docutils literal notranslate"><span class="pre">rest_v1_summary_url</span></code></a>).</p>
<p>A <a class="reference external" href="https://www.mediawiki.org/wiki/Writing_systems#LanguageConverter">LanguageConverter</a> (LC) is a system based on language variants that
automatically converts the content of a page into a different variant. A variant
is mostly the same language in a different script.</p>
<ul class="simple">
<li><p><a class="reference external" href="https://meta.wikimedia.org/wiki/Wikipedias_in_multiple_writing_systems">Wikipedias in multiple writing systems</a></p></li>
<li><p><a class="reference external" href="https://en.wikipedia.org/wiki/Chinese_Wikipedia#Automatic_conversion_between_traditional_and_simplified_Chinese_characters">Automatic conversion between traditional and simplified Chinese characters</a></p></li>
</ul>
<dl class="simple">
<dt><a class="reference external" href="https://github.com/searx/searx/pull/2554">PR-2554</a>:</dt><dd><p>The Wikipedia link returned by the API is still the same in all cases
(<a class="reference external" href="https://zh.wikipedia.org/wiki/%E5%87%BA%E7%A7%9F%E8%BB%8A">https://zh.wikipedia.org/wiki/出租車</a>) but if your browsers
<code class="docutils literal notranslate"><span class="pre">Accept-Language</span></code> is set to any of <code class="docutils literal notranslate"><span class="pre">zh</span></code>, <code class="docutils literal notranslate"><span class="pre">zh-CN</span></code>, <code class="docutils literal notranslate"><span class="pre">zh-TW</span></code>, <code class="docutils literal notranslate"><span class="pre">zh-HK</span></code>
or .. Wikipedias LC automatically returns the desired script in their
web-page.</p>
<ul class="simple">
<li><p>You can test the API here: <a class="reference external" href="https://reqbin.com/gesg2kvx">https://reqbin.com/gesg2kvx</a></p></li>
</ul>
</dd>
</dl>
<p>To support Wikipedias <a class="reference external" href="https://www.mediawiki.org/wiki/Writing_systems#LanguageConverter">LanguageConverter</a>, a SearXNG request to Wikipedia uses
<a class="reference internal" href="#searx.engines.wikipedia.get_wiki_params" title="searx.engines.wikipedia.get_wiki_params"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_wiki_params</span></code></a> and <code class="xref py py-obj docutils literal notranslate"><span class="pre">wiki_lc_locale_variants'</span> <span class="pre">in</span> <span class="pre">the</span>
<span class="pre">:py:obj:`fetch_wikimedia_traits</span></code> function.</p>
<p>To test in SearXNG, query for <code class="docutils literal notranslate"><span class="pre">!wp</span> <span class="pre">出租車</span></code> with each of the available Chinese
options:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">!wp</span> <span class="pre">出租車</span> <span class="pre">:zh</span></code> should show 出租車</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">!wp</span> <span class="pre">出租車</span> <span class="pre">:zh-CN</span></code> should show 出租车</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">!wp</span> <span class="pre">出租車</span> <span class="pre">:zh-TW</span></code> should show 計程車</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">!wp</span> <span class="pre">出租車</span> <span class="pre">:zh-HK</span></code> should show 的士</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">!wp</span> <span class="pre">出租車</span> <span class="pre">:zh-SG</span></code> should show 德士</p></li>
</ul>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.wikipedia.fetch_wikimedia_traits">
<span class="sig-prename descclassname"><span class="pre">searx.engines.wikipedia.</span></span><span class="sig-name descname"><span class="pre">fetch_wikimedia_traits</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">engine_traits</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="../enginelib.html#searx.enginelib.traits.EngineTraits" title="searx.enginelib.traits.EngineTraits"><span class="pre">EngineTraits</span></a></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/wikipedia.html#fetch_wikimedia_traits"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.wikipedia.fetch_wikimedia_traits" title="Permalink to this definition"></a></dt>
<dd><p>Fetch languages from Wikipedia. Not all languages from the
<a class="reference internal" href="#searx.engines.wikipedia.list_of_wikipedias" title="searx.engines.wikipedia.list_of_wikipedias"><code class="xref py py-obj docutils literal notranslate"><span class="pre">list_of_wikipedias</span></code></a> are supported by SearXNG locales, only those
known from <a class="reference internal" href="../../../src/searx.locales.html#searx.locales.LOCALE_NAMES" title="searx.locales.LOCALE_NAMES"><code class="xref py py-obj docutils literal notranslate"><span class="pre">searx.locales.LOCALE_NAMES</span></code></a> or those with a minimal
<a class="reference internal" href="#searx.engines.wikipedia.wikipedia_article_depth" title="searx.engines.wikipedia.wikipedia_article_depth"><code class="xref py py-obj docutils literal notranslate"><span class="pre">editing</span> <span class="pre">depth</span></code></a>.</p>
<p>The location of the Wikipedia address of a language is mapped in a
<a class="reference internal" href="../enginelib.html#searx.enginelib.traits.EngineTraits.custom" title="searx.enginelib.traits.EngineTraits.custom"><code class="xref py py-obj docutils literal notranslate"><span class="pre">custom</span> <span class="pre">field</span></code></a>
(<code class="docutils literal notranslate"><span class="pre">wiki_netloc</span></code>). Here is a reduced example:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">traits</span><span class="o">.</span><span class="n">custom</span><span class="p">[</span><span class="s1">&#39;wiki_netloc&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">{</span>
<span class="s2">&quot;en&quot;</span><span class="p">:</span> <span class="s2">&quot;en.wikipedia.org&quot;</span><span class="p">,</span>
<span class="o">..</span>
<span class="s2">&quot;gsw&quot;</span><span class="p">:</span> <span class="s2">&quot;als.wikipedia.org&quot;</span><span class="p">,</span>
<span class="o">..</span>
<span class="s2">&quot;zh&quot;</span><span class="p">:</span> <span class="s2">&quot;zh.wikipedia.org&quot;</span><span class="p">,</span>
<span class="s2">&quot;zh-classical&quot;</span><span class="p">:</span> <span class="s2">&quot;zh-classical.wikipedia.org&quot;</span>
<span class="p">}</span>
</pre></div>
</div>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.wikipedia.get_wiki_params">
<span class="sig-prename descclassname"><span class="pre">searx.engines.wikipedia.</span></span><span class="sig-name descname"><span class="pre">get_wiki_params</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">sxng_locale</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">eng_traits</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/wikipedia.html#get_wiki_params"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.wikipedia.get_wiki_params" title="Permalink to this definition"></a></dt>
<dd><p>Returns the Wikipedia language tag and the netloc that fits to the
<code class="docutils literal notranslate"><span class="pre">sxng_locale</span></code>. To support <a class="reference external" href="https://www.mediawiki.org/wiki/Writing_systems#LanguageConverter">LanguageConverter</a> this function rates a locale
(region) higher than a language (compare <a class="reference internal" href="#searx.engines.wikipedia.wiki_lc_locale_variants" title="searx.engines.wikipedia.wiki_lc_locale_variants"><code class="xref py py-obj docutils literal notranslate"><span class="pre">wiki_lc_locale_variants</span></code></a>).</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.wikipedia.request">
<span class="sig-prename descclassname"><span class="pre">searx.engines.wikipedia.</span></span><span class="sig-name descname"><span class="pre">request</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">query</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">params</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/wikipedia.html#request"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.wikipedia.request" title="Permalink to this definition"></a></dt>
<dd><p>Assemble a request (<a class="reference external" href="https://en.wikipedia.org/api/rest_v1/#/Page%20content/get_page_summary__title_">wikipedia rest_v1 summary API</a>).</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.wikipedia.list_of_wikipedias">
<span class="sig-prename descclassname"><span class="pre">searx.engines.wikipedia.</span></span><span class="sig-name descname"><span class="pre">list_of_wikipedias</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'https://meta.wikimedia.org/wiki/List_of_Wikipedias'</span></em><a class="headerlink" href="#searx.engines.wikipedia.list_of_wikipedias" title="Permalink to this definition"></a></dt>
<dd><p><a class="reference external" href="https://meta.wikimedia.org/wiki/List_of_Wikipedias">List of all wikipedias</a></p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.wikipedia.rest_v1_summary_url">
<span class="sig-prename descclassname"><span class="pre">searx.engines.wikipedia.</span></span><span class="sig-name descname"><span class="pre">rest_v1_summary_url</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'https://{wiki_netloc}/api/rest_v1/page/summary/{title}'</span></em><a class="headerlink" href="#searx.engines.wikipedia.rest_v1_summary_url" title="Permalink to this definition"></a></dt>
<dd><dl class="simple">
<dt><a class="reference external" href="https://en.wikipedia.org/api/rest_v1/#/Page%20content/get_page_summary__title_">wikipedia rest_v1 summary API</a>:</dt><dd><p>The summary response includes an extract of the first paragraph of the page in
plain text and HTML as well as the type of page. This is useful for page
previews (fka. Hovercards, aka. Popups) on the web and link previews in the
apps.</p>
</dd>
<dt>HTTP <code class="docutils literal notranslate"><span class="pre">Accept-Language</span></code> header (<a class="reference internal" href="#searx.engines.wikipedia.send_accept_language_header" title="searx.engines.wikipedia.send_accept_language_header"><code class="xref py py-obj docutils literal notranslate"><span class="pre">send_accept_language_header</span></code></a>):</dt><dd><p>The desired language variant code for wikis where <a class="reference external" href="https://www.mediawiki.org/wiki/Writing_systems#LanguageConverter">LanguageConverter</a> is
enabled.</p>
</dd>
</dl>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.wikipedia.send_accept_language_header">
<span class="sig-prename descclassname"><span class="pre">searx.engines.wikipedia.</span></span><span class="sig-name descname"><span class="pre">send_accept_language_header</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">True</span></em><a class="headerlink" href="#searx.engines.wikipedia.send_accept_language_header" title="Permalink to this definition"></a></dt>
<dd><p>The HTTP <code class="docutils literal notranslate"><span class="pre">Accept-Language</span></code> header is needed for wikis where
<a class="reference external" href="https://www.mediawiki.org/wiki/Writing_systems#LanguageConverter">LanguageConverter</a> is enabled.</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.wikipedia.wiki_lc_locale_variants">
<span class="sig-prename descclassname"><span class="pre">searx.engines.wikipedia.</span></span><span class="sig-name descname"><span class="pre">wiki_lc_locale_variants</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">{'zh':</span> <span class="pre">('zh-CN',</span> <span class="pre">'zh-HK',</span> <span class="pre">'zh-MO',</span> <span class="pre">'zh-MY',</span> <span class="pre">'zh-SG',</span> <span class="pre">'zh-TW'),</span> <span class="pre">'zh-classical':</span> <span class="pre">('zh-classical',)}</span></em><a class="headerlink" href="#searx.engines.wikipedia.wiki_lc_locale_variants" title="Permalink to this definition"></a></dt>
<dd><p>Mapping rule of the <a class="reference external" href="https://www.mediawiki.org/wiki/Writing_systems#LanguageConverter">LanguageConverter</a> to map a language and its variants to
a Locale (used in the HTTP <code class="docutils literal notranslate"><span class="pre">Accept-Language</span></code> header). For example see <a class="reference external" href="https://meta.wikimedia.org/wiki/Wikipedias_in_multiple_writing_systems#Chinese">LC
Chinese</a>.</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.wikipedia.wikipedia_article_depth">
<span class="sig-prename descclassname"><span class="pre">searx.engines.wikipedia.</span></span><span class="sig-name descname"><span class="pre">wikipedia_article_depth</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'https://meta.wikimedia.org/wiki/Wikipedia_article_depth'</span></em><a class="headerlink" href="#searx.engines.wikipedia.wikipedia_article_depth" title="Permalink to this definition"></a></dt>
<dd><p>The <em>editing depth</em> of Wikipedia is one of several possible rough indicators
of the encyclopedias collaborative quality, showing how frequently its articles
are updated. The measurement of depth was introduced after some limitations of
the classic measurement of article count were realized.</p>
</dd></dl>
</section>
<section id="module-searx.engines.wikidata">
<span id="wikidata"></span><span id="wikidata-engine"></span><h2><a class="toc-backref" href="#id2" role="doc-backlink">Wikidata</a><a class="headerlink" href="#module-searx.engines.wikidata" title="Permalink to this heading"></a></h2>
<p>This module implements the Wikidata engine. Some implementations are shared
from <a class="reference internal" href="#wikipedia-engine"><span class="std std-ref">Wikipedia</span></a>.</p>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.wikidata.fetch_traits">
<span class="sig-prename descclassname"><span class="pre">searx.engines.wikidata.</span></span><span class="sig-name descname"><span class="pre">fetch_traits</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">engine_traits</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="../enginelib.html#searx.enginelib.traits.EngineTraits" title="searx.enginelib.traits.EngineTraits"><span class="pre">EngineTraits</span></a></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/wikidata.html#fetch_traits"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.wikidata.fetch_traits" title="Permalink to this definition"></a></dt>
<dd><p>Uses languages evaluated from <a class="reference internal" href="#searx.engines.wikipedia.fetch_wikimedia_traits" title="searx.engines.wikipedia.fetch_wikimedia_traits"><code class="xref py py-obj docutils literal notranslate"><span class="pre">wikipedia.fetch_wikimedia_traits</span></code></a> and removes</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">traits.custom['wiki_netloc']</span></code>: wikidata does not have net-locations for
the languages and the list of all</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">traits.custom['WIKIPEDIA_LANGUAGES']</span></code>: not used in the wikipedia engine</p></li>
</ul>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.wikidata.get_thumbnail">
<span class="sig-prename descclassname"><span class="pre">searx.engines.wikidata.</span></span><span class="sig-name descname"><span class="pre">get_thumbnail</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">img_src</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/wikidata.html#get_thumbnail"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.wikidata.get_thumbnail" title="Permalink to this definition"></a></dt>
<dd><p>Get Thumbnail image from wikimedia commons</p>
<p>Images from commons.wikimedia.org are (HTTP) redirected to
upload.wikimedia.org. The redirected URL can be calculated by this
function.</p>
<ul class="simple">
<li><p><a class="reference external" href="https://stackoverflow.com/a/33691240">https://stackoverflow.com/a/33691240</a></p></li>
</ul>
</dd></dl>
</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/searxng-wordmark.svg" alt="Logo"/>
</a></p>
<h3><a href="../../../index.html">Table of Contents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../user/index.html">User information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../own-instance.html">Why use a private instance?</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../admin/index.html">Administrator documentation</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../index.html">Developer documentation</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../quickstart.html">Development Quickstart</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../contribution_guide.html">How to contribute</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../index.html">Engine Implementations</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../search_api.html">Search API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../plugins.html">Plugins</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../translation.html">Translation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../lxcdev.html">Developing in Linux Containers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../makefile.html">Makefile &amp; <code class="docutils literal notranslate"><span class="pre">./manage</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../reST.html">reST primer</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../searxng_extra/index.html">Tooling box <code class="docutils literal notranslate"><span class="pre">searxng_extra</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../utils/index.html">DevOps tooling box</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../src/index.html">Source-Code</a></li>
</ul>
<h3>Project Links</h3>
<ul>
<li><a href="https://github.com/searxng/searxng/tree/master">Source</a>
<li><a href="https://github.com/searxng/searxng/wiki">Wiki</a>
<li><a href="https://searx.space">Public instances</a>
<li><a href="https://github.com/searxng/searxng/issues">Issue Tracker</a>
</ul><h3>Navigation</h3>
<ul>
<li><a href="../../../index.html">Overview</a>
<ul>
<li><a href="../../index.html">Developer documentation</a>
<ul>
<li><a href="../index.html">Engine Implementations</a>
<ul>
<li>Previous: <a href="torznab.html" title="previous chapter">Torznab WebAPI</a>
<li>Next: <a href="yacy.html" title="next chapter">Yacy</a></ul>
</li></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 role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../../_sources/dev/engines/online/wikipedia.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright SearXNG team.
</div>
<script src="../../../_static/version_warning_offset.js"></script>
</body>
</html>

View file

@ -0,0 +1,186 @@
<!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>Yacy &#8212; SearXNG Documentation (2023.8.11+905ce2a6f)</title>
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=4f649999" />
<link rel="stylesheet" type="text/css" href="../../../_static/searxng.css?v=52e4ff28" />
<link rel="stylesheet" type="text/css" href="../../../_static/tabs.css?v=a5c4661c" />
<script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js?v=3c88bde0"></script>
<script src="../../../_static/doctools.js?v=888ff710"></script>
<script src="../../../_static/sphinx_highlight.js?v=4825356b"></script>
<link rel="index" title="Index" href="../../../genindex.html" />
<link rel="search" title="Search" href="../../../search.html" />
<link rel="next" title="Yahoo Engine" href="yahoo.html" />
<link rel="prev" title="Wikimedia" href="wikipedia.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="yahoo.html" title="Yahoo Engine"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="wikipedia.html" title="Wikimedia"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">SearXNG Documentation (2023.8.11+905ce2a6f)</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../index.html" >Developer documentation</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="../index.html" accesskey="U">Engine Implementations</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Yacy</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="yacy">
<span id="yacy-engine"></span><h1>Yacy<a class="headerlink" href="#yacy" title="Permalink to this heading"></a></h1>
<nav class="contents local" id="contents">
<p class="topic-title">Contents</p>
<ul class="simple">
<li><p><a class="reference internal" href="#configuration" id="id2">Configuration</a></p></li>
<li><p><a class="reference internal" href="#implementations" id="id3">Implementations</a></p></li>
</ul>
</nav>
<span class="target" id="module-searx.engines.yacy"></span><p><a class="reference external" href="https://yacy.net/">YaCy</a> is a free distributed search engine, built on the principles of
peer-to-peer (P2P) networks.</p>
<p>API: <a class="reference external" href="https://wiki.yacy.net/index.php/Dev:APIyacysearch">Dev:APIyacysearch</a></p>
<p>Releases:</p>
<ul class="simple">
<li><p><a class="reference external" href="https://github.com/yacy/yacy_search_server/tags">https://github.com/yacy/yacy_search_server/tags</a></p></li>
<li><p><a class="reference external" href="https://download.yacy.net/">https://download.yacy.net/</a></p></li>
</ul>
<section id="configuration">
<h2><a class="toc-backref" href="#id2" role="doc-backlink">Configuration</a><a class="headerlink" href="#configuration" title="Permalink to this heading"></a></h2>
<p>The engine has the following (additional) settings:</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">yacy</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">yacy</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">ya</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:8090</span>
<span class="w"> </span><span class="c1"># Yacy search mode. &#39;global&#39; or &#39;local&#39;.</span>
<span class="w"> </span><span class="nt">search_mode</span><span class="p">:</span><span class="w"> </span><span class="s">&#39;global&#39;</span>
<span class="w"> </span><span class="nt">number_of_results</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="nt">http_digest_auth_user</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;&quot;</span>
<span class="w"> </span><span class="nt">http_digest_auth_pass</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;&quot;</span>
</pre></div>
</div>
</section>
<section id="implementations">
<h2><a class="toc-backref" href="#id3" role="doc-backlink">Implementations</a><a class="headerlink" href="#implementations" title="Permalink to this heading"></a></h2>
</section>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.yacy.search_mode">
<span class="sig-prename descclassname"><span class="pre">searx.engines.yacy.</span></span><span class="sig-name descname"><span class="pre">search_mode</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'global'</span></em><a class="headerlink" href="#searx.engines.yacy.search_mode" title="Permalink to this definition"></a></dt>
<dd><p>Yacy search mode <code class="docutils literal notranslate"><span class="pre">global</span></code> or <code class="docutils literal notranslate"><span class="pre">local</span></code>. By default, Yacy operates in <code class="docutils literal notranslate"><span class="pre">global</span></code>
mode.</p>
<dl class="simple">
<dt><code class="docutils literal notranslate"><span class="pre">global</span></code></dt><dd><p>Peer-to-Peer search</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">local</span></code></dt><dd><p>Privacy or Stealth mode, restricts the search to local yacy instance.</p>
</dd>
</dl>
</dd></dl>
</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/searxng-wordmark.svg" alt="Logo"/>
</a></p>
<h3><a href="../../../index.html">Table of Contents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../user/index.html">User information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../own-instance.html">Why use a private instance?</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../admin/index.html">Administrator documentation</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../index.html">Developer documentation</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../quickstart.html">Development Quickstart</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../contribution_guide.html">How to contribute</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../index.html">Engine Implementations</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../search_api.html">Search API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../plugins.html">Plugins</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../translation.html">Translation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../lxcdev.html">Developing in Linux Containers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../makefile.html">Makefile &amp; <code class="docutils literal notranslate"><span class="pre">./manage</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../reST.html">reST primer</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../searxng_extra/index.html">Tooling box <code class="docutils literal notranslate"><span class="pre">searxng_extra</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../utils/index.html">DevOps tooling box</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../src/index.html">Source-Code</a></li>
</ul>
<h3>Project Links</h3>
<ul>
<li><a href="https://github.com/searxng/searxng/tree/master">Source</a>
<li><a href="https://github.com/searxng/searxng/wiki">Wiki</a>
<li><a href="https://searx.space">Public instances</a>
<li><a href="https://github.com/searxng/searxng/issues">Issue Tracker</a>
</ul><h3>Navigation</h3>
<ul>
<li><a href="../../../index.html">Overview</a>
<ul>
<li><a href="../../index.html">Developer documentation</a>
<ul>
<li><a href="../index.html">Engine Implementations</a>
<ul>
<li>Previous: <a href="wikipedia.html" title="previous chapter">Wikimedia</a>
<li>Next: <a href="yahoo.html" title="next chapter">Yahoo Engine</a></ul>
</li></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 role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../../_sources/dev/engines/online/yacy.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright SearXNG team.
</div>
<script src="../../../_static/version_warning_offset.js"></script>
</body>
</html>

View file

@ -0,0 +1,173 @@
<!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>Yahoo Engine &#8212; SearXNG Documentation (2023.8.11+905ce2a6f)</title>
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=4f649999" />
<link rel="stylesheet" type="text/css" href="../../../_static/searxng.css?v=52e4ff28" />
<link rel="stylesheet" type="text/css" href="../../../_static/tabs.css?v=a5c4661c" />
<script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js?v=3c88bde0"></script>
<script src="../../../_static/doctools.js?v=888ff710"></script>
<script src="../../../_static/sphinx_highlight.js?v=4825356b"></script>
<link rel="index" title="Index" href="../../../genindex.html" />
<link rel="search" title="Search" href="../../../search.html" />
<link rel="next" title="Z-Library" href="zlibrary.html" />
<link rel="prev" title="Yacy" href="yacy.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="zlibrary.html" title="Z-Library"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="yacy.html" title="Yacy"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">SearXNG Documentation (2023.8.11+905ce2a6f)</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../index.html" >Developer documentation</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="../index.html" accesskey="U">Engine Implementations</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Yahoo Engine</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="yahoo-engine">
<span id="id1"></span><h1>Yahoo Engine<a class="headerlink" href="#yahoo-engine" title="Permalink to this heading"></a></h1>
<span class="target" id="module-searx.engines.yahoo"></span><p>Yahoo Search (Web)</p>
<p>Languages are supported by mapping the language to a domain. If domain is not
found in <a class="reference internal" href="#searx.engines.yahoo.lang2domain" title="searx.engines.yahoo.lang2domain"><code class="xref py py-obj docutils literal notranslate"><span class="pre">lang2domain</span></code></a> URL <code class="docutils literal notranslate"><span class="pre">&lt;lang&gt;.search.yahoo.com</span></code> is used.</p>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.yahoo.fetch_traits">
<span class="sig-prename descclassname"><span class="pre">searx.engines.yahoo.</span></span><span class="sig-name descname"><span class="pre">fetch_traits</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">engine_traits</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="../enginelib.html#searx.enginelib.traits.EngineTraits" title="searx.enginelib.traits.EngineTraits"><span class="pre">EngineTraits</span></a></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/yahoo.html#fetch_traits"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.yahoo.fetch_traits" title="Permalink to this definition"></a></dt>
<dd><p>Fetch languages from yahoo</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.yahoo.parse_url">
<span class="sig-prename descclassname"><span class="pre">searx.engines.yahoo.</span></span><span class="sig-name descname"><span class="pre">parse_url</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">url_string</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/yahoo.html#parse_url"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.yahoo.parse_url" title="Permalink to this definition"></a></dt>
<dd><p>remove yahoo-specific tracking-url</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.yahoo.request">
<span class="sig-prename descclassname"><span class="pre">searx.engines.yahoo.</span></span><span class="sig-name descname"><span class="pre">request</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">query</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">params</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/yahoo.html#request"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.yahoo.request" title="Permalink to this definition"></a></dt>
<dd><p>build request</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.yahoo.response">
<span class="sig-prename descclassname"><span class="pre">searx.engines.yahoo.</span></span><span class="sig-name descname"><span class="pre">response</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">resp</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/yahoo.html#response"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.yahoo.response" title="Permalink to this definition"></a></dt>
<dd><p>parse response</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.yahoo.lang2domain">
<span class="sig-prename descclassname"><span class="pre">searx.engines.yahoo.</span></span><span class="sig-name descname"><span class="pre">lang2domain</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">{'any':</span> <span class="pre">'search.yahoo.com',</span> <span class="pre">'bg':</span> <span class="pre">'search.yahoo.com',</span> <span class="pre">'cs':</span> <span class="pre">'search.yahoo.com',</span> <span class="pre">'da':</span> <span class="pre">'search.yahoo.com',</span> <span class="pre">'el':</span> <span class="pre">'search.yahoo.com',</span> <span class="pre">'en':</span> <span class="pre">'search.yahoo.com',</span> <span class="pre">'et':</span> <span class="pre">'search.yahoo.com',</span> <span class="pre">'he':</span> <span class="pre">'search.yahoo.com',</span> <span class="pre">'hr':</span> <span class="pre">'search.yahoo.com',</span> <span class="pre">'ja':</span> <span class="pre">'search.yahoo.com',</span> <span class="pre">'ko':</span> <span class="pre">'search.yahoo.com',</span> <span class="pre">'sk':</span> <span class="pre">'search.yahoo.com',</span> <span class="pre">'sl':</span> <span class="pre">'search.yahoo.com',</span> <span class="pre">'zh_chs':</span> <span class="pre">'hk.search.yahoo.com',</span> <span class="pre">'zh_cht':</span> <span class="pre">'tw.search.yahoo.com'}</span></em><a class="headerlink" href="#searx.engines.yahoo.lang2domain" title="Permalink to this definition"></a></dt>
<dd><p>Map language to domain</p>
</dd></dl>
</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/searxng-wordmark.svg" alt="Logo"/>
</a></p>
<h3><a href="../../../index.html">Table of Contents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../user/index.html">User information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../own-instance.html">Why use a private instance?</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../admin/index.html">Administrator documentation</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../index.html">Developer documentation</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../quickstart.html">Development Quickstart</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../contribution_guide.html">How to contribute</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../index.html">Engine Implementations</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../search_api.html">Search API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../plugins.html">Plugins</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../translation.html">Translation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../lxcdev.html">Developing in Linux Containers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../makefile.html">Makefile &amp; <code class="docutils literal notranslate"><span class="pre">./manage</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../reST.html">reST primer</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../searxng_extra/index.html">Tooling box <code class="docutils literal notranslate"><span class="pre">searxng_extra</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../utils/index.html">DevOps tooling box</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../src/index.html">Source-Code</a></li>
</ul>
<h3>Project Links</h3>
<ul>
<li><a href="https://github.com/searxng/searxng/tree/master">Source</a>
<li><a href="https://github.com/searxng/searxng/wiki">Wiki</a>
<li><a href="https://searx.space">Public instances</a>
<li><a href="https://github.com/searxng/searxng/issues">Issue Tracker</a>
</ul><h3>Navigation</h3>
<ul>
<li><a href="../../../index.html">Overview</a>
<ul>
<li><a href="../../index.html">Developer documentation</a>
<ul>
<li><a href="../index.html">Engine Implementations</a>
<ul>
<li>Previous: <a href="yacy.html" title="previous chapter">Yacy</a>
<li>Next: <a href="zlibrary.html" title="next chapter">Z-Library</a></ul>
</li></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 role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../../_sources/dev/engines/online/yahoo.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright SearXNG team.
</div>
<script src="../../../_static/version_warning_offset.js"></script>
</body>
</html>

View file

@ -0,0 +1,205 @@
<!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>Z-Library &#8212; SearXNG Documentation (2023.8.11+905ce2a6f)</title>
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=4f649999" />
<link rel="stylesheet" type="text/css" href="../../../_static/searxng.css?v=52e4ff28" />
<link rel="stylesheet" type="text/css" href="../../../_static/tabs.css?v=a5c4661c" />
<script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js?v=3c88bde0"></script>
<script src="../../../_static/doctools.js?v=888ff710"></script>
<script src="../../../_static/sphinx_highlight.js?v=4825356b"></script>
<link rel="index" title="Index" href="../../../genindex.html" />
<link rel="search" title="Search" href="../../../search.html" />
<link rel="next" title="Offline Concept" href="../offline_concept.html" />
<link rel="prev" title="Yahoo Engine" href="yahoo.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="../offline_concept.html" title="Offline Concept"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="yahoo.html" title="Yahoo Engine"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">SearXNG Documentation (2023.8.11+905ce2a6f)</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../index.html" >Developer documentation</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="../index.html" accesskey="U">Engine Implementations</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Z-Library</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="z-library">
<span id="zlibrary-engine"></span><h1>Z-Library<a class="headerlink" href="#z-library" title="Permalink to this heading"></a></h1>
<nav class="contents local" id="contents">
<p class="topic-title">Contents</p>
<ul class="simple">
<li><p><a class="reference internal" href="#configuration" id="id2">Configuration</a></p></li>
<li><p><a class="reference internal" href="#implementations" id="id3">Implementations</a></p></li>
</ul>
</nav>
<span class="target" id="module-searx.engines.zlibrary"></span><p><a class="reference external" href="https://zlibrary-global.se/">Z-Library</a> (abbreviated as z-lib, formerly BookFinder) is a shadow library
project for file-sharing access to scholarly journal articles, academic texts
and general-interest books. It began as a mirror of Library Genesis, from which
most of its books originate.</p>
<section id="configuration">
<h2><a class="toc-backref" href="#id2" role="doc-backlink">Configuration</a><a class="headerlink" href="#configuration" title="Permalink to this heading"></a></h2>
<p>The engine has the following additional settings:</p>
<ul class="simple">
<li><p><a class="reference internal" href="#searx.engines.zlibrary.zlib_year_from" title="searx.engines.zlibrary.zlib_year_from"><code class="xref py py-obj docutils literal notranslate"><span class="pre">zlib_year_from</span></code></a></p></li>
<li><p><a class="reference internal" href="#searx.engines.zlibrary.zlib_year_to" title="searx.engines.zlibrary.zlib_year_to"><code class="xref py py-obj docutils literal notranslate"><span class="pre">zlib_year_to</span></code></a></p></li>
<li><p><a class="reference internal" href="#searx.engines.zlibrary.zlib_ext" title="searx.engines.zlibrary.zlib_ext"><code class="xref py py-obj docutils literal notranslate"><span class="pre">zlib_ext</span></code></a></p></li>
</ul>
<p>With this options a SearXNG maintainer is able to configure <strong>additional</strong>
engines for specific searches in Z-Library. For example a engine to search
only for EPUB from 2010 to 2020.</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">z-library 2010s epub</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">zlibrary</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">zlib2010s</span>
<span class="w"> </span><span class="nt">zlib_year_from</span><span class="p">:</span><span class="w"> </span><span class="s">&#39;2010&#39;</span>
<span class="w"> </span><span class="nt">zlib_year_to</span><span class="p">:</span><span class="w"> </span><span class="s">&#39;2020&#39;</span>
<span class="w"> </span><span class="nt">zlib_ext</span><span class="p">:</span><span class="w"> </span><span class="s">&#39;EPUB&#39;</span>
</pre></div>
</div>
</section>
<section id="implementations">
<h2><a class="toc-backref" href="#id3" role="doc-backlink">Implementations</a><a class="headerlink" href="#implementations" title="Permalink to this heading"></a></h2>
</section>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.zlibrary.fetch_traits">
<span class="sig-prename descclassname"><span class="pre">searx.engines.zlibrary.</span></span><span class="sig-name descname"><span class="pre">fetch_traits</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">engine_traits</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="../enginelib.html#searx.enginelib.traits.EngineTraits" title="searx.enginelib.traits.EngineTraits"><span class="pre">EngineTraits</span></a></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.11)"><span class="pre">None</span></a></span></span><a class="reference internal" href="../../../_modules/searx/engines/zlibrary.html#fetch_traits"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.zlibrary.fetch_traits" title="Permalink to this definition"></a></dt>
<dd><p>Fetch languages and other search arguments from zlibrarys search form.</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.zlibrary.init">
<span class="sig-prename descclassname"><span class="pre">searx.engines.zlibrary.</span></span><span class="sig-name descname"><span class="pre">init</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">engine_settings</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.11)"><span class="pre">None</span></a></span></span><a class="reference internal" href="../../../_modules/searx/engines/zlibrary.html#init"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.zlibrary.init" title="Permalink to this definition"></a></dt>
<dd><p>Check of engines settings.</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.zlibrary.zlib_ext">
<span class="sig-prename descclassname"><span class="pre">searx.engines.zlibrary.</span></span><span class="sig-name descname"><span class="pre">zlib_ext</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><span class="pre">str</span></a></em><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">''</span></em><a class="headerlink" href="#searx.engines.zlibrary.zlib_ext" title="Permalink to this definition"></a></dt>
<dd><p>Filter z-librarys results by a file ending. Common filters for example are
<code class="docutils literal notranslate"><span class="pre">PDF</span></code> and <code class="docutils literal notranslate"><span class="pre">EPUB</span></code>.</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.zlibrary.zlib_year_from">
<span class="sig-prename descclassname"><span class="pre">searx.engines.zlibrary.</span></span><span class="sig-name descname"><span class="pre">zlib_year_from</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><span class="pre">str</span></a></em><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">''</span></em><a class="headerlink" href="#searx.engines.zlibrary.zlib_year_from" title="Permalink to this definition"></a></dt>
<dd><p>Filter z-librarys results by year from. E.g 2010.</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.zlibrary.zlib_year_to">
<span class="sig-prename descclassname"><span class="pre">searx.engines.zlibrary.</span></span><span class="sig-name descname"><span class="pre">zlib_year_to</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><span class="pre">str</span></a></em><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">''</span></em><a class="headerlink" href="#searx.engines.zlibrary.zlib_year_to" title="Permalink to this definition"></a></dt>
<dd><p>Filter z-librarys results by year to. E.g. 2010.</p>
</dd></dl>
</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/searxng-wordmark.svg" alt="Logo"/>
</a></p>
<h3><a href="../../../index.html">Table of Contents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../user/index.html">User information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../own-instance.html">Why use a private instance?</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../admin/index.html">Administrator documentation</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../index.html">Developer documentation</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../quickstart.html">Development Quickstart</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../contribution_guide.html">How to contribute</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../index.html">Engine Implementations</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../search_api.html">Search API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../plugins.html">Plugins</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../translation.html">Translation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../lxcdev.html">Developing in Linux Containers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../makefile.html">Makefile &amp; <code class="docutils literal notranslate"><span class="pre">./manage</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../reST.html">reST primer</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../searxng_extra/index.html">Tooling box <code class="docutils literal notranslate"><span class="pre">searxng_extra</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../utils/index.html">DevOps tooling box</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../src/index.html">Source-Code</a></li>
</ul>
<h3>Project Links</h3>
<ul>
<li><a href="https://github.com/searxng/searxng/tree/master">Source</a>
<li><a href="https://github.com/searxng/searxng/wiki">Wiki</a>
<li><a href="https://searx.space">Public instances</a>
<li><a href="https://github.com/searxng/searxng/issues">Issue Tracker</a>
</ul><h3>Navigation</h3>
<ul>
<li><a href="../../../index.html">Overview</a>
<ul>
<li><a href="../../index.html">Developer documentation</a>
<ul>
<li><a href="../index.html">Engine Implementations</a>
<ul>
<li>Previous: <a href="yahoo.html" title="previous chapter">Yahoo Engine</a>
<li>Next: <a href="../offline_concept.html" title="next chapter">Offline Concept</a></ul>
</li></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 role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../../_sources/dev/engines/online/zlibrary.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright SearXNG team.
</div>
<script src="../../../_static/version_warning_offset.js"></script>
</body>
</html>

View file

@ -0,0 +1,215 @@
<!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>Tineye &#8212; SearXNG Documentation (2023.8.11+905ce2a6f)</title>
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=4f649999" />
<link rel="stylesheet" type="text/css" href="../../../_static/searxng.css?v=52e4ff28" />
<link rel="stylesheet" type="text/css" href="../../../_static/tabs.css?v=a5c4661c" />
<script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js?v=3c88bde0"></script>
<script src="../../../_static/doctools.js?v=888ff710"></script>
<script src="../../../_static/sphinx_highlight.js?v=4825356b"></script>
<link rel="index" title="Index" href="../../../genindex.html" />
<link rel="search" title="Search" href="../../../search.html" />
<link rel="next" title="Search API" href="../../search_api.html" />
<link rel="prev" title="SQL Engines" href="../offline/sql-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="../../search_api.html" title="Search API"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="../offline/sql-engines.html" title="SQL Engines"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">SearXNG Documentation (2023.8.11+905ce2a6f)</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../index.html" >Developer documentation</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="../index.html" accesskey="U">Engine Implementations</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Tineye</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="tineye">
<span id="tineye-engine"></span><h1>Tineye<a class="headerlink" href="#tineye" title="Permalink to this heading"></a></h1>
<span class="target" id="module-searx.engines.tineye"></span><p>This engine implements <em>Tineye - reverse image search</em></p>
<p>Using TinEye, you can search by image or perform what we call a reverse image
search. You can do that by uploading an image or searching by URL. You can also
simply drag and drop your images to start your search. TinEye constantly crawls
the web and adds images to its index. Today, the TinEye index is over 50.2
billion images <a class="reference external" href="https://tineye.com/how">[tineye.com]</a>.</p>
<div class="admonition hint">
<p class="admonition-title">Hint</p>
<p>This SearXNG engine only supports <em>searching by URL</em> and it does not use
the official API <a class="reference external" href="https://api.tineye.com/python/docs/">[api.tineye.com]</a>.</p>
</div>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.tineye.parse_tineye_match">
<span class="sig-prename descclassname"><span class="pre">searx.engines.tineye.</span></span><span class="sig-name descname"><span class="pre">parse_tineye_match</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">match_json</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/tineye.html#parse_tineye_match"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.tineye.parse_tineye_match" title="Permalink to this definition"></a></dt>
<dd><p>Takes parsed JSON from the API server and turns it into a <a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.11)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">dict</span></code></a>
object.</p>
<p>Attributes <a class="reference external" href="https://github.com/TinEye/pytineye/blob/main/pytineye/api.py">(class Match)</a></p>
<ul class="simple">
<li><p><cite>image_url</cite>, link to the result image.</p></li>
<li><p><cite>domain</cite>, domain this result was found on.</p></li>
<li><p><cite>score</cite>, a number (0 to 100) that indicates how closely the images match.</p></li>
<li><p><cite>width</cite>, image width in pixels.</p></li>
<li><p><cite>height</cite>, image height in pixels.</p></li>
<li><p><cite>size</cite>, image area in pixels.</p></li>
<li><p><cite>format</cite>, image format.</p></li>
<li><p><cite>filesize</cite>, image size in bytes.</p></li>
<li><p><cite>overlay</cite>, overlay URL.</p></li>
<li><p><cite>tags</cite>, whether this match belongs to a collection or stock domain.</p></li>
<li><p><cite>backlinks</cite>, a list of Backlink objects pointing to the original websites
and image URLs. List items are instances of <a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.11)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">dict</span></code></a>, (<a class="reference external" href="https://github.com/TinEye/pytineye/blob/main/pytineye/api.py">Backlink</a>):</p>
<ul>
<li><p><cite>url</cite>, the image URL to the image.</p></li>
<li><p><cite>backlink</cite>, the original website URL.</p></li>
<li><p><cite>crawl_date</cite>, the date the image was crawled.</p></li>
</ul>
</li>
</ul>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.tineye.request">
<span class="sig-prename descclassname"><span class="pre">searx.engines.tineye.</span></span><span class="sig-name descname"><span class="pre">request</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">query</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">params</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/tineye.html#request"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.tineye.request" title="Permalink to this definition"></a></dt>
<dd><p>Build TinEye HTTP request using <code class="docutils literal notranslate"><span class="pre">search_urls</span></code> of a <a class="reference internal" href="#searx.engines.tineye.engine_type" title="searx.engines.tineye.engine_type"><code class="xref py py-obj docutils literal notranslate"><span class="pre">engine_type</span></code></a>.</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.tineye.response">
<span class="sig-prename descclassname"><span class="pre">searx.engines.tineye.</span></span><span class="sig-name descname"><span class="pre">response</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">resp</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/searx/engines/tineye.html#response"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.tineye.response" title="Permalink to this definition"></a></dt>
<dd><p>Parse HTTP response from TinEye.</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.tineye.DOWNLOAD_ERROR">
<span class="sig-prename descclassname"><span class="pre">searx.engines.tineye.</span></span><span class="sig-name descname"><span class="pre">DOWNLOAD_ERROR</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'The</span> <span class="pre">image</span> <span class="pre">could</span> <span class="pre">not</span> <span class="pre">be</span> <span class="pre">downloaded.'</span></em><a class="headerlink" href="#searx.engines.tineye.DOWNLOAD_ERROR" title="Permalink to this definition"></a></dt>
<dd><p>TinEye error message</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.tineye.FORMAT_NOT_SUPPORTED">
<span class="sig-prename descclassname"><span class="pre">searx.engines.tineye.</span></span><span class="sig-name descname"><span class="pre">FORMAT_NOT_SUPPORTED</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'Could</span> <span class="pre">not</span> <span class="pre">read</span> <span class="pre">that</span> <span class="pre">image</span> <span class="pre">url.</span> <span class="pre">This</span> <span class="pre">may</span> <span class="pre">be</span> <span class="pre">due</span> <span class="pre">to</span> <span class="pre">an</span> <span class="pre">unsupported</span> <span class="pre">file</span> <span class="pre">format.</span> <span class="pre">TinEye</span> <span class="pre">only</span> <span class="pre">supports</span> <span class="pre">images</span> <span class="pre">that</span> <span class="pre">are</span> <span class="pre">JPEG,</span> <span class="pre">PNG,</span> <span class="pre">GIF,</span> <span class="pre">BMP,</span> <span class="pre">TIFF</span> <span class="pre">or</span> <span class="pre">WebP.'</span></em><a class="headerlink" href="#searx.engines.tineye.FORMAT_NOT_SUPPORTED" title="Permalink to this definition"></a></dt>
<dd><p>TinEye error message</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.tineye.NO_SIGNATURE_ERROR">
<span class="sig-prename descclassname"><span class="pre">searx.engines.tineye.</span></span><span class="sig-name descname"><span class="pre">NO_SIGNATURE_ERROR</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'The</span> <span class="pre">image</span> <span class="pre">is</span> <span class="pre">too</span> <span class="pre">simple</span> <span class="pre">to</span> <span class="pre">find</span> <span class="pre">matches.</span> <span class="pre">TinEye</span> <span class="pre">requires</span> <span class="pre">a</span> <span class="pre">basic</span> <span class="pre">level</span> <span class="pre">of</span> <span class="pre">visual</span> <span class="pre">detail</span> <span class="pre">to</span> <span class="pre">successfully</span> <span class="pre">identify</span> <span class="pre">matches.'</span></em><a class="headerlink" href="#searx.engines.tineye.NO_SIGNATURE_ERROR" title="Permalink to this definition"></a></dt>
<dd><p>TinEye error message</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.tineye.engine_type">
<span class="sig-prename descclassname"><span class="pre">searx.engines.tineye.</span></span><span class="sig-name descname"><span class="pre">engine_type</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'online_url_search'</span></em><a class="headerlink" href="#searx.engines.tineye.engine_type" title="Permalink to this definition"></a></dt>
<dd><p><a class="reference internal" href="../../../src/searx.search.processors.html#module-searx.search.processors.online_url_search" title="searx.search.processors.online_url_search"><code class="xref py py-obj docutils literal notranslate"><span class="pre">searx.search.processors.online_url_search</span></code></a></p>
</dd></dl>
</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/searxng-wordmark.svg" alt="Logo"/>
</a></p>
<h3><a href="../../../index.html">Table of Contents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../user/index.html">User information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../own-instance.html">Why use a private instance?</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../admin/index.html">Administrator documentation</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../index.html">Developer documentation</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../quickstart.html">Development Quickstart</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../contribution_guide.html">How to contribute</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../index.html">Engine Implementations</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../search_api.html">Search API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../plugins.html">Plugins</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../translation.html">Translation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../lxcdev.html">Developing in Linux Containers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../makefile.html">Makefile &amp; <code class="docutils literal notranslate"><span class="pre">./manage</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../reST.html">reST primer</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../searxng_extra/index.html">Tooling box <code class="docutils literal notranslate"><span class="pre">searxng_extra</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../utils/index.html">DevOps tooling box</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../src/index.html">Source-Code</a></li>
</ul>
<h3>Project Links</h3>
<ul>
<li><a href="https://github.com/searxng/searxng/tree/master">Source</a>
<li><a href="https://github.com/searxng/searxng/wiki">Wiki</a>
<li><a href="https://searx.space">Public instances</a>
<li><a href="https://github.com/searxng/searxng/issues">Issue Tracker</a>
</ul><h3>Navigation</h3>
<ul>
<li><a href="../../../index.html">Overview</a>
<ul>
<li><a href="../../index.html">Developer documentation</a>
<ul>
<li><a href="../index.html">Engine Implementations</a>
<ul>
<li>Previous: <a href="../offline/sql-engines.html" title="previous chapter">SQL Engines</a>
<li>Next: <a href="../../search_api.html" title="next chapter">Search API</a></ul>
</li></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 role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../../_sources/dev/engines/online_url_search/tineye.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright SearXNG team.
</div>
<script src="../../../_static/version_warning_offset.js"></script>
</body>
</html>

389
dev/engines/xpath.html Normal file
View file

@ -0,0 +1,389 @@
<!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>XPath Engine &#8212; SearXNG Documentation (2023.8.11+905ce2a6f)</title>
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=4f649999" />
<link rel="stylesheet" type="text/css" href="../../_static/searxng.css?v=52e4ff28" />
<link rel="stylesheet" type="text/css" href="../../_static/tabs.css?v=a5c4661c" />
<script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js?v=3c88bde0"></script>
<script src="../../_static/doctools.js?v=888ff710"></script>
<script src="../../_static/sphinx_highlight.js?v=4825356b"></script>
<link rel="index" title="Index" href="../../genindex.html" />
<link rel="search" title="Search" href="../../search.html" />
<link rel="next" title="MediaWiki Engine" href="mediawiki.html" />
<link rel="prev" title="Demo Online Engine" href="demo/demo_online.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="mediawiki.html" title="MediaWiki Engine"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="demo/demo_online.html" title="Demo Online Engine"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../../index.html">SearXNG Documentation (2023.8.11+905ce2a6f)</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../index.html" >Developer documentation</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="index.html" accesskey="U">Engine Implementations</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">XPath Engine</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="xpath-engine">
<span id="id1"></span><h1>XPath Engine<a class="headerlink" href="#xpath-engine" title="Permalink to this heading"></a></h1>
<nav class="contents local" id="contents">
<ul class="simple">
<li><p><a class="reference internal" href="#configuration" id="id2">Configuration</a></p></li>
<li><p><a class="reference internal" href="#example" id="id3">Example</a></p></li>
<li><p><a class="reference internal" href="#implementations" id="id4">Implementations</a></p></li>
</ul>
</nav>
<span class="target" id="module-searx.engines.xpath"></span><p>The XPath engine is a <em>generic</em> engine with which it is possible to configure
engines in the settings.</p>
<section id="configuration">
<h2><a class="toc-backref" href="#id2" role="doc-backlink">Configuration</a><a class="headerlink" href="#configuration" title="Permalink to this heading"></a></h2>
<p>Request:</p>
<ul class="simple">
<li><p><a class="reference internal" href="#searx.engines.xpath.search_url" title="searx.engines.xpath.search_url"><code class="xref py py-obj docutils literal notranslate"><span class="pre">search_url</span></code></a></p></li>
<li><p><a class="reference internal" href="#searx.engines.xpath.lang_all" title="searx.engines.xpath.lang_all"><code class="xref py py-obj docutils literal notranslate"><span class="pre">lang_all</span></code></a></p></li>
<li><p><a class="reference internal" href="#searx.engines.xpath.soft_max_redirects" title="searx.engines.xpath.soft_max_redirects"><code class="xref py py-obj docutils literal notranslate"><span class="pre">soft_max_redirects</span></code></a></p></li>
<li><p><a class="reference internal" href="#searx.engines.xpath.cookies" title="searx.engines.xpath.cookies"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cookies</span></code></a></p></li>
<li><p><a class="reference internal" href="#searx.engines.xpath.headers" title="searx.engines.xpath.headers"><code class="xref py py-obj docutils literal notranslate"><span class="pre">headers</span></code></a></p></li>
</ul>
<p>Paging:</p>
<ul class="simple">
<li><p><a class="reference internal" href="#searx.engines.xpath.paging" title="searx.engines.xpath.paging"><code class="xref py py-obj docutils literal notranslate"><span class="pre">paging</span></code></a></p></li>
<li><p><a class="reference internal" href="#searx.engines.xpath.page_size" title="searx.engines.xpath.page_size"><code class="xref py py-obj docutils literal notranslate"><span class="pre">page_size</span></code></a></p></li>
<li><p><a class="reference internal" href="#searx.engines.xpath.first_page_num" title="searx.engines.xpath.first_page_num"><code class="xref py py-obj docutils literal notranslate"><span class="pre">first_page_num</span></code></a></p></li>
</ul>
<p>Time Range:</p>
<ul class="simple">
<li><p><a class="reference internal" href="#searx.engines.xpath.time_range_support" title="searx.engines.xpath.time_range_support"><code class="xref py py-obj docutils literal notranslate"><span class="pre">time_range_support</span></code></a></p></li>
<li><p><a class="reference internal" href="#searx.engines.xpath.time_range_url" title="searx.engines.xpath.time_range_url"><code class="xref py py-obj docutils literal notranslate"><span class="pre">time_range_url</span></code></a></p></li>
<li><p><a class="reference internal" href="#searx.engines.xpath.time_range_map" title="searx.engines.xpath.time_range_map"><code class="xref py py-obj docutils literal notranslate"><span class="pre">time_range_map</span></code></a></p></li>
</ul>
<p>Safe-Search:</p>
<ul class="simple">
<li><p><a class="reference internal" href="#searx.engines.xpath.safe_search_support" title="searx.engines.xpath.safe_search_support"><code class="xref py py-obj docutils literal notranslate"><span class="pre">safe_search_support</span></code></a></p></li>
<li><p><a class="reference internal" href="#searx.engines.xpath.safe_search_map" title="searx.engines.xpath.safe_search_map"><code class="xref py py-obj docutils literal notranslate"><span class="pre">safe_search_map</span></code></a></p></li>
</ul>
<p>Response:</p>
<ul class="simple">
<li><p><a class="reference internal" href="#searx.engines.xpath.no_result_for_http_status" title="searx.engines.xpath.no_result_for_http_status"><code class="xref py py-obj docutils literal notranslate"><span class="pre">no_result_for_http_status</span></code></a></p></li>
</ul>
<p><a class="reference external" href="https://quickref.me/xpath.html#xpath-selectors">XPath selector</a>:</p>
<ul class="simple">
<li><p><a class="reference internal" href="#searx.engines.xpath.results_xpath" title="searx.engines.xpath.results_xpath"><code class="xref py py-obj docutils literal notranslate"><span class="pre">results_xpath</span></code></a></p></li>
<li><p><a class="reference internal" href="#searx.engines.xpath.url_xpath" title="searx.engines.xpath.url_xpath"><code class="xref py py-obj docutils literal notranslate"><span class="pre">url_xpath</span></code></a></p></li>
<li><p><a class="reference internal" href="#searx.engines.xpath.title_xpath" title="searx.engines.xpath.title_xpath"><code class="xref py py-obj docutils literal notranslate"><span class="pre">title_xpath</span></code></a></p></li>
<li><p><a class="reference internal" href="#searx.engines.xpath.content_xpath" title="searx.engines.xpath.content_xpath"><code class="xref py py-obj docutils literal notranslate"><span class="pre">content_xpath</span></code></a></p></li>
<li><p><a class="reference internal" href="#searx.engines.xpath.thumbnail_xpath" title="searx.engines.xpath.thumbnail_xpath"><code class="xref py py-obj docutils literal notranslate"><span class="pre">thumbnail_xpath</span></code></a></p></li>
<li><p><a class="reference internal" href="#searx.engines.xpath.suggestion_xpath" title="searx.engines.xpath.suggestion_xpath"><code class="xref py py-obj docutils literal notranslate"><span class="pre">suggestion_xpath</span></code></a></p></li>
</ul>
</section>
<section id="example">
<h2><a class="toc-backref" href="#id3" role="doc-backlink">Example</a><a class="headerlink" href="#example" title="Permalink to this heading"></a></h2>
<p>Here is a simple example of a XPath engine configured in the <a class="reference internal" href="../../admin/settings/settings_engine.html#settings-engine"><span class="std std-ref">engine:</span></a> section, further read <a class="reference internal" href="engine_overview.html#engines-dev"><span class="std std-ref">Engine Overview</span></a>.</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">bitbucket</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">xpath</span>
<span class="w"> </span><span class="nt">paging </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="nt">search_url </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https://bitbucket.org/repo/all/{pageno}?name={query}</span>
<span class="w"> </span><span class="nt">url_xpath </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">//article[@class=&quot;repo-summary&quot;]//a[@class=&quot;repo-link&quot;]/@href</span>
<span class="w"> </span><span class="nt">title_xpath </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">//article[@class=&quot;repo-summary&quot;]//a[@class=&quot;repo-link&quot;]</span>
<span class="w"> </span><span class="nt">content_xpath </span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">//article[@class=&quot;repo-summary&quot;]/p</span>
</pre></div>
</div>
</section>
<section id="implementations">
<h2><a class="toc-backref" href="#id4" role="doc-backlink">Implementations</a><a class="headerlink" href="#implementations" title="Permalink to this heading"></a></h2>
</section>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.xpath.request">
<span class="sig-prename descclassname"><span class="pre">searx.engines.xpath.</span></span><span class="sig-name descname"><span class="pre">request</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">query</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">params</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../_modules/searx/engines/xpath.html#request"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.xpath.request" title="Permalink to this definition"></a></dt>
<dd><p>Build request parameters (see <a class="reference internal" href="engine_overview.html#engine-request"><span class="std std-ref">Making a Request</span></a>).</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="searx.engines.xpath.response">
<span class="sig-prename descclassname"><span class="pre">searx.engines.xpath.</span></span><span class="sig-name descname"><span class="pre">response</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">resp</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../_modules/searx/engines/xpath.html#response"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.engines.xpath.response" title="Permalink to this definition"></a></dt>
<dd><p>Scrap <em>results</em> from the response (see <a class="reference internal" href="engine_overview.html#engine-results"><span class="std std-ref">Result Types (template)</span></a>).</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.xpath.content_xpath">
<span class="sig-prename descclassname"><span class="pre">searx.engines.xpath.</span></span><span class="sig-name descname"><span class="pre">content_xpath</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">None</span></em><a class="headerlink" href="#searx.engines.xpath.content_xpath" title="Permalink to this definition"></a></dt>
<dd><p><a class="reference external" href="https://quickref.me/xpath.html#xpath-selectors">XPath selector</a> of results <code class="docutils literal notranslate"><span class="pre">content</span></code>.</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.xpath.cookies">
<span class="sig-prename descclassname"><span class="pre">searx.engines.xpath.</span></span><span class="sig-name descname"><span class="pre">cookies</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">{}</span></em><a class="headerlink" href="#searx.engines.xpath.cookies" title="Permalink to this definition"></a></dt>
<dd><p>Some engines might offer different result based on cookies.
Possible use-case: To set safesearch cookie.</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.xpath.first_page_num">
<span class="sig-prename descclassname"><span class="pre">searx.engines.xpath.</span></span><span class="sig-name descname"><span class="pre">first_page_num</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">1</span></em><a class="headerlink" href="#searx.engines.xpath.first_page_num" title="Permalink to this definition"></a></dt>
<dd><p>Number of the first page (usually 0 or 1).</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.xpath.headers">
<span class="sig-prename descclassname"><span class="pre">searx.engines.xpath.</span></span><span class="sig-name descname"><span class="pre">headers</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">{}</span></em><a class="headerlink" href="#searx.engines.xpath.headers" title="Permalink to this definition"></a></dt>
<dd><p>Some engines might offer different result based headers. Possible use-case:
To set header to moderate.</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.xpath.lang_all">
<span class="sig-prename descclassname"><span class="pre">searx.engines.xpath.</span></span><span class="sig-name descname"><span class="pre">lang_all</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'en'</span></em><a class="headerlink" href="#searx.engines.xpath.lang_all" title="Permalink to this definition"></a></dt>
<dd><p>Replacement <code class="docutils literal notranslate"><span class="pre">{lang}</span></code> in <a class="reference internal" href="#searx.engines.xpath.search_url" title="searx.engines.xpath.search_url"><code class="xref py py-obj docutils literal notranslate"><span class="pre">search_url</span></code></a> if language <code class="docutils literal notranslate"><span class="pre">all</span></code> is
selected.</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.xpath.no_result_for_http_status">
<span class="sig-prename descclassname"><span class="pre">searx.engines.xpath.</span></span><span class="sig-name descname"><span class="pre">no_result_for_http_status</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">[]</span></em><a class="headerlink" href="#searx.engines.xpath.no_result_for_http_status" title="Permalink to this definition"></a></dt>
<dd><p>Return empty result for these HTTP status codes instead of throwing an error.</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="nt">no_result_for_http_status</span><span class="p">:</span><span class="w"> </span><span class="p p-Indicator">[]</span>
</pre></div>
</div>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.xpath.page_size">
<span class="sig-prename descclassname"><span class="pre">searx.engines.xpath.</span></span><span class="sig-name descname"><span class="pre">page_size</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">1</span></em><a class="headerlink" href="#searx.engines.xpath.page_size" title="Permalink to this definition"></a></dt>
<dd><p>Number of results on each page. Only needed if the site requires not a page
number, but an offset.</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.xpath.paging">
<span class="sig-prename descclassname"><span class="pre">searx.engines.xpath.</span></span><span class="sig-name descname"><span class="pre">paging</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">False</span></em><a class="headerlink" href="#searx.engines.xpath.paging" title="Permalink to this definition"></a></dt>
<dd><p>Engine supports paging [True or False].</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.xpath.results_xpath">
<span class="sig-prename descclassname"><span class="pre">searx.engines.xpath.</span></span><span class="sig-name descname"><span class="pre">results_xpath</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">''</span></em><a class="headerlink" href="#searx.engines.xpath.results_xpath" title="Permalink to this definition"></a></dt>
<dd><p><a class="reference external" href="https://quickref.me/xpath.html#xpath-selectors">XPath selector</a> for the list of result items</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.xpath.safe_search_map">
<span class="sig-prename descclassname"><span class="pre">searx.engines.xpath.</span></span><span class="sig-name descname"><span class="pre">safe_search_map</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">{0:</span> <span class="pre">'&amp;filter=none',</span> <span class="pre">1:</span> <span class="pre">'&amp;filter=moderate',</span> <span class="pre">2:</span> <span class="pre">'&amp;filter=strict'}</span></em><a class="headerlink" href="#searx.engines.xpath.safe_search_map" title="Permalink to this definition"></a></dt>
<dd><p>Maps safe-search value to <code class="docutils literal notranslate"><span class="pre">{safe_search}</span></code> in <a class="reference internal" href="#searx.engines.xpath.search_url" title="searx.engines.xpath.search_url"><code class="xref py py-obj docutils literal notranslate"><span class="pre">search_url</span></code></a>.</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="nt">safesearch</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span>
<span class="nt">safes_search_map</span><span class="p">:</span>
<span class="w"> </span><span class="nt">0</span><span class="p">:</span><span class="w"> </span><span class="s">&#39;&amp;filter=none&#39;</span>
<span class="w"> </span><span class="nt">1</span><span class="p">:</span><span class="w"> </span><span class="s">&#39;&amp;filter=moderate&#39;</span>
<span class="w"> </span><span class="nt">2</span><span class="p">:</span><span class="w"> </span><span class="s">&#39;&amp;filter=strict&#39;</span>
</pre></div>
</div>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.xpath.safe_search_support">
<span class="sig-prename descclassname"><span class="pre">searx.engines.xpath.</span></span><span class="sig-name descname"><span class="pre">safe_search_support</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">False</span></em><a class="headerlink" href="#searx.engines.xpath.safe_search_support" title="Permalink to this definition"></a></dt>
<dd><p>Engine supports safe-search.</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.xpath.search_url">
<span class="sig-prename descclassname"><span class="pre">searx.engines.xpath.</span></span><span class="sig-name descname"><span class="pre">search_url</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">None</span></em><a class="headerlink" href="#searx.engines.xpath.search_url" title="Permalink to this definition"></a></dt>
<dd><p>Search URL of the engine. Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>https://example.org/?search={query}&amp;page={pageno}{time_range}{safe_search}
</pre></div>
</div>
<p>Replacements are:</p>
<dl>
<dt><code class="docutils literal notranslate"><span class="pre">{query}</span></code>:</dt><dd><p>Search terms from user.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">{pageno}</span></code>:</dt><dd><p>Page number if engine supports pagging <a class="reference internal" href="#searx.engines.xpath.paging" title="searx.engines.xpath.paging"><code class="xref py py-obj docutils literal notranslate"><span class="pre">paging</span></code></a></p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">{lang}</span></code>:</dt><dd><p>ISO 639-1 language code (en, de, fr ..)</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">{time_range}</span></code>:</dt><dd><p><a class="reference internal" href="#searx.engines.xpath.time_range_url" title="searx.engines.xpath.time_range_url"><code class="xref py py-obj docutils literal notranslate"><span class="pre">URL</span> <span class="pre">parameter</span></code></a> if engine <a class="reference internal" href="#searx.engines.xpath.time_range_support" title="searx.engines.xpath.time_range_support"><code class="xref py py-obj docutils literal notranslate"><span class="pre">supports</span> <span class="pre">time</span>
<span class="pre">range</span></code></a>. The value for the parameter is taken from
<a class="reference internal" href="#searx.engines.xpath.time_range_map" title="searx.engines.xpath.time_range_map"><code class="xref py py-obj docutils literal notranslate"><span class="pre">time_range_map</span></code></a>.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">{safe_search}</span></code>:</dt><dd><p>Safe-search <a class="reference internal" href="#searx.engines.xpath.safe_search_map" title="searx.engines.xpath.safe_search_map"><code class="xref py py-obj docutils literal notranslate"><span class="pre">URL</span> <span class="pre">parameter</span></code></a> if engine
<a class="reference internal" href="#searx.engines.xpath.safe_search_support" title="searx.engines.xpath.safe_search_support"><code class="xref py py-obj docutils literal notranslate"><span class="pre">supports</span> <span class="pre">safe-search</span></code></a>. The <code class="docutils literal notranslate"><span class="pre">{safe_search}</span></code>
replacement is taken from the <code class="xref py py-obj docutils literal notranslate"><span class="pre">safes_search_map</span></code>. Filter results:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="mi">0</span><span class="p">:</span> <span class="n">none</span><span class="p">,</span> <span class="mi">1</span><span class="p">:</span> <span class="n">moderate</span><span class="p">,</span> <span class="mi">2</span><span class="p">:</span><span class="n">strict</span>
</pre></div>
</div>
<p>If not supported, the URL parameter is an empty string.</p>
</dd>
</dl>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.xpath.soft_max_redirects">
<span class="sig-prename descclassname"><span class="pre">searx.engines.xpath.</span></span><span class="sig-name descname"><span class="pre">soft_max_redirects</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">0</span></em><a class="headerlink" href="#searx.engines.xpath.soft_max_redirects" title="Permalink to this definition"></a></dt>
<dd><p>Maximum redirects, soft limit. Record an error but dont stop the engine</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.xpath.suggestion_xpath">
<span class="sig-prename descclassname"><span class="pre">searx.engines.xpath.</span></span><span class="sig-name descname"><span class="pre">suggestion_xpath</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">''</span></em><a class="headerlink" href="#searx.engines.xpath.suggestion_xpath" title="Permalink to this definition"></a></dt>
<dd><p><a class="reference external" href="https://quickref.me/xpath.html#xpath-selectors">XPath selector</a> of results <code class="docutils literal notranslate"><span class="pre">suggestion</span></code>.</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.xpath.thumbnail_xpath">
<span class="sig-prename descclassname"><span class="pre">searx.engines.xpath.</span></span><span class="sig-name descname"><span class="pre">thumbnail_xpath</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">False</span></em><a class="headerlink" href="#searx.engines.xpath.thumbnail_xpath" title="Permalink to this definition"></a></dt>
<dd><p><a class="reference external" href="https://quickref.me/xpath.html#xpath-selectors">XPath selector</a> of results <code class="docutils literal notranslate"><span class="pre">img_src</span></code>.</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.xpath.time_range_map">
<span class="sig-prename descclassname"><span class="pre">searx.engines.xpath.</span></span><span class="sig-name descname"><span class="pre">time_range_map</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">{'day':</span> <span class="pre">24,</span> <span class="pre">'month':</span> <span class="pre">720,</span> <span class="pre">'week':</span> <span class="pre">168,</span> <span class="pre">'year':</span> <span class="pre">8760}</span></em><a class="headerlink" href="#searx.engines.xpath.time_range_map" title="Permalink to this definition"></a></dt>
<dd><p>Maps time range value from user to <code class="docutils literal notranslate"><span class="pre">{time_range_val}</span></code> in
<a class="reference internal" href="#searx.engines.xpath.time_range_url" title="searx.engines.xpath.time_range_url"><code class="xref py py-obj docutils literal notranslate"><span class="pre">time_range_url</span></code></a>.</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="nt">time_range_map</span><span class="p">:</span>
<span class="w"> </span><span class="nt">day</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">1</span>
<span class="w"> </span><span class="nt">week</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">7</span>
<span class="w"> </span><span class="nt">month</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">30</span>
<span class="w"> </span><span class="nt">year</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">365</span>
</pre></div>
</div>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.xpath.time_range_support">
<span class="sig-prename descclassname"><span class="pre">searx.engines.xpath.</span></span><span class="sig-name descname"><span class="pre">time_range_support</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">False</span></em><a class="headerlink" href="#searx.engines.xpath.time_range_support" title="Permalink to this definition"></a></dt>
<dd><p>Engine supports search time range.</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.xpath.time_range_url">
<span class="sig-prename descclassname"><span class="pre">searx.engines.xpath.</span></span><span class="sig-name descname"><span class="pre">time_range_url</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'&amp;hours={time_range_val}'</span></em><a class="headerlink" href="#searx.engines.xpath.time_range_url" title="Permalink to this definition"></a></dt>
<dd><p>Time range URL parameter in the in <a class="reference internal" href="#searx.engines.xpath.search_url" title="searx.engines.xpath.search_url"><code class="xref py py-obj docutils literal notranslate"><span class="pre">search_url</span></code></a>. If no time range is
requested by the user, the URL parameter is an empty string. The
<code class="docutils literal notranslate"><span class="pre">{time_range_val}</span></code> replacement is taken from the <a class="reference internal" href="#searx.engines.xpath.time_range_map" title="searx.engines.xpath.time_range_map"><code class="xref py py-obj docutils literal notranslate"><span class="pre">time_range_map</span></code></a>.</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="nt">time_range_url </span><span class="p">:</span><span class="w"> </span><span class="s">&#39;&amp;days={time_range_val}&#39;</span>
</pre></div>
</div>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.xpath.title_xpath">
<span class="sig-prename descclassname"><span class="pre">searx.engines.xpath.</span></span><span class="sig-name descname"><span class="pre">title_xpath</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">None</span></em><a class="headerlink" href="#searx.engines.xpath.title_xpath" title="Permalink to this definition"></a></dt>
<dd><p><a class="reference external" href="https://quickref.me/xpath.html#xpath-selectors">XPath selector</a> of results <code class="docutils literal notranslate"><span class="pre">title</span></code>.</p>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="searx.engines.xpath.url_xpath">
<span class="sig-prename descclassname"><span class="pre">searx.engines.xpath.</span></span><span class="sig-name descname"><span class="pre">url_xpath</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">None</span></em><a class="headerlink" href="#searx.engines.xpath.url_xpath" title="Permalink to this definition"></a></dt>
<dd><p><a class="reference external" href="https://quickref.me/xpath.html#xpath-selectors">XPath selector</a> of results <code class="docutils literal notranslate"><span class="pre">url</span></code>.</p>
</dd></dl>
</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/searxng-wordmark.svg" alt="Logo"/>
</a></p>
<h3><a href="../../index.html">Table of Contents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../user/index.html">User information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../own-instance.html">Why use a private instance?</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../admin/index.html">Administrator documentation</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../index.html">Developer documentation</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../quickstart.html">Development Quickstart</a></li>
<li class="toctree-l2"><a class="reference internal" href="../contribution_guide.html">How to contribute</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="index.html">Engine Implementations</a></li>
<li class="toctree-l2"><a class="reference internal" href="../search_api.html">Search API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../plugins.html">Plugins</a></li>
<li class="toctree-l2"><a class="reference internal" href="../translation.html">Translation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../lxcdev.html">Developing in Linux Containers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../makefile.html">Makefile &amp; <code class="docutils literal notranslate"><span class="pre">./manage</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../reST.html">reST primer</a></li>
<li class="toctree-l2"><a class="reference internal" href="../searxng_extra/index.html">Tooling box <code class="docutils literal notranslate"><span class="pre">searxng_extra</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../utils/index.html">DevOps tooling box</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../src/index.html">Source-Code</a></li>
</ul>
<h3>Project Links</h3>
<ul>
<li><a href="https://github.com/searxng/searxng/tree/master">Source</a>
<li><a href="https://github.com/searxng/searxng/wiki">Wiki</a>
<li><a href="https://searx.space">Public instances</a>
<li><a href="https://github.com/searxng/searxng/issues">Issue Tracker</a>
</ul><h3>Navigation</h3>
<ul>
<li><a href="../../index.html">Overview</a>
<ul>
<li><a href="../index.html">Developer documentation</a>
<ul>
<li><a href="index.html">Engine Implementations</a>
<ul>
<li>Previous: <a href="demo/demo_online.html" title="previous chapter">Demo Online Engine</a>
<li>Next: <a href="mediawiki.html" title="next chapter">MediaWiki Engine</a></ul>
</li></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 role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../_sources/dev/engines/xpath.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright SearXNG team.
</div>
<script src="../../_static/version_warning_offset.js"></script>
</body>
</html>