searxngRebrandZaclys/dev/engines/online/brave.html
2023-08-11 10:34:02 +00:00

265 lines
20 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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>