searx.redislib.html 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. <!DOCTYPE html>
  2. <html lang="en" data-content_root="../">
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <title>Redis Library &#8212; SearXNG Documentation (2025.7.4+01be2612a)</title>
  8. <link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=6625fa76" />
  9. <link rel="stylesheet" type="text/css" href="../_static/searxng.css?v=52e4ff28" />
  10. <script src="../_static/documentation_options.js?v=657a83fe"></script>
  11. <script src="../_static/doctools.js?v=9a2dae69"></script>
  12. <script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
  13. <script data-project="searxng" data-version="2025.7.4+01be2612a" src="../_static/describe_version.js?v=fa7f30d0"></script>
  14. <link rel="index" title="Index" href="../genindex.html" />
  15. <link rel="search" title="Search" href="../search.html" />
  16. <link rel="next" title="Search" href="searx.search.html" />
  17. <link rel="prev" title="Redis DB" href="searx.redisdb.html" />
  18. </head><body>
  19. <div class="related" role="navigation" aria-label="Related">
  20. <h3>Navigation</h3>
  21. <ul>
  22. <li class="right" style="margin-right: 10px">
  23. <a href="../genindex.html" title="General Index"
  24. accesskey="I">index</a></li>
  25. <li class="right" >
  26. <a href="../py-modindex.html" title="Python Module Index"
  27. >modules</a> |</li>
  28. <li class="right" >
  29. <a href="searx.search.html" title="Search"
  30. accesskey="N">next</a> |</li>
  31. <li class="right" >
  32. <a href="searx.redisdb.html" title="Redis DB"
  33. accesskey="P">previous</a> |</li>
  34. <li class="nav-item nav-item-0"><a href="../index.html">SearXNG Documentation (2025.7.4+01be2612a)</a> &#187;</li>
  35. <li class="nav-item nav-item-1"><a href="index.html" accesskey="U">Source-Code</a> &#187;</li>
  36. <li class="nav-item nav-item-this"><a href="">Redis Library</a></li>
  37. </ul>
  38. </div>
  39. <div class="document">
  40. <div class="documentwrapper">
  41. <div class="bodywrapper">
  42. <div class="body" role="main">
  43. <section id="module-searx.redislib">
  44. <span id="redis-library"></span><span id="searx-redis"></span><h1>Redis Library<a class="headerlink" href="#module-searx.redislib" title="Link to this heading">¶</a></h1>
  45. <p>A collection of convenient functions and redis/lua scripts.</p>
  46. <p>This code was partial inspired by the <a class="reference external" href="https://redis.com/blog/bullet-proofing-lua-scripts-in-redispy/">Bullet-Proofing Lua Scripts in RedisPy</a>
  47. article.</p>
  48. <dl class="py data">
  49. <dt class="sig sig-object py" id="searx.redislib.LUA_SCRIPT_STORAGE">
  50. <span class="sig-prename descclassname"><span class="pre">searx.redislib.</span></span><span class="sig-name descname"><span class="pre">LUA_SCRIPT_STORAGE</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.redislib.LUA_SCRIPT_STORAGE" title="Link to this definition">¶</a></dt>
  51. <dd><p>A global dictionary to cache client’s <code class="docutils literal notranslate"><span class="pre">Script</span></code> objects, used by
  52. <a class="reference internal" href="#searx.redislib.lua_script_storage" title="searx.redislib.lua_script_storage"><code class="xref py py-obj docutils literal notranslate"><span class="pre">lua_script_storage</span></code></a></p>
  53. </dd></dl>
  54. <dl class="py function">
  55. <dt class="sig sig-object py" id="searx.redislib.lua_script_storage">
  56. <span class="sig-prename descclassname"><span class="pre">searx.redislib.</span></span><span class="sig-name descname"><span class="pre">lua_script_storage</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">client</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">script</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/searx/redislib.html#lua_script_storage"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.redislib.lua_script_storage" title="Link to this definition">¶</a></dt>
  57. <dd><p>Returns a redis <a class="reference external" href="https://redis.readthedocs.io/en/stable/commands.html#redis.commands.core.CoreCommands.register_script" title="(in redis-py v6.2.0)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Script</span></code></a> instance.</p>
  58. <p>Due to performance reason the <code class="docutils literal notranslate"><span class="pre">Script</span></code> object is instantiated only once
  59. for a client (<code class="docutils literal notranslate"><span class="pre">client.register_script(..)</span></code>) and is cached in
  60. <a class="reference internal" href="#searx.redislib.LUA_SCRIPT_STORAGE" title="searx.redislib.LUA_SCRIPT_STORAGE"><code class="xref py py-obj docutils literal notranslate"><span class="pre">LUA_SCRIPT_STORAGE</span></code></a>.</p>
  61. </dd></dl>
  62. <dl class="py function">
  63. <dt class="sig sig-object py" id="searx.redislib.purge_by_prefix">
  64. <span class="sig-prename descclassname"><span class="pre">searx.redislib.</span></span><span class="sig-name descname"><span class="pre">purge_by_prefix</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">client</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">prefix</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.13)"><span class="pre">str</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">'SearXNG_'</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/searx/redislib.html#purge_by_prefix"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.redislib.purge_by_prefix" title="Link to this definition">¶</a></dt>
  65. <dd><p>Purge all keys with <code class="docutils literal notranslate"><span class="pre">prefix</span></code> from database.</p>
  66. <p>Queries all keys in the database by the given prefix and set expire time to
  67. zero. The default prefix will drop all keys which has been set by SearXNG
  68. (drops SearXNG schema entirely from database).</p>
  69. <p>The implementation is the lua script from string <code class="xref py py-obj docutils literal notranslate"><span class="pre">PURGE_BY_PREFIX</span></code>.
  70. The lua script uses <a class="reference external" href="https://redis.io/commands/expire/">EXPIRE</a> instead of <a class="reference external" href="https://redis.io/commands/del/">DEL</a>: if there are a lot keys to
  71. delete and/or their values are big, <cite>DEL</cite> could take more time and blocks
  72. the command loop while <cite>EXPIRE</cite> turns back immediate.</p>
  73. <dl class="field-list simple">
  74. <dt class="field-odd">Parameters<span class="colon">:</span></dt>
  75. <dd class="field-odd"><p><strong>prefix</strong> – prefix of the key to delete (default: <code class="docutils literal notranslate"><span class="pre">SearXNG_</span></code>)</p>
  76. </dd>
  77. </dl>
  78. </dd></dl>
  79. <dl class="py function">
  80. <dt class="sig sig-object py" id="searx.redislib.secret_hash">
  81. <span class="sig-prename descclassname"><span class="pre">searx.redislib.</span></span><span class="sig-name descname"><span class="pre">secret_hash</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">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.13)"><span class="pre">str</span></a></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/searx/redislib.html#secret_hash"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.redislib.secret_hash" title="Link to this definition">¶</a></dt>
  82. <dd><p>Creates a hash of the <code class="docutils literal notranslate"><span class="pre">name</span></code>.</p>
  83. <p>Combines argument <code class="docutils literal notranslate"><span class="pre">name</span></code> with the <code class="docutils literal notranslate"><span class="pre">secret_key</span></code> from <a class="reference internal" href="../admin/settings/settings_server.html#settings-server"><span class="std std-ref">server:</span></a>. This function can be used to get a more anonymized name of a Redis
  84. KEY.</p>
  85. <dl class="field-list simple">
  86. <dt class="field-odd">Parameters<span class="colon">:</span></dt>
  87. <dd class="field-odd"><p><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.13)"><em>str</em></a>) – the name to create a secret hash for</p>
  88. </dd>
  89. </dl>
  90. </dd></dl>
  91. <dl class="py function">
  92. <dt class="sig sig-object py" id="searx.redislib.incr_counter">
  93. <span class="sig-prename descclassname"><span class="pre">searx.redislib.</span></span><span class="sig-name descname"><span class="pre">incr_counter</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">client</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">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.13)"><span class="pre">str</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">limit</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#int" title="(in Python v3.13)"><span class="pre">int</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">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">expire</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#int" title="(in Python v3.13)"><span class="pre">int</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">0</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/searx/redislib.html#incr_counter"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.redislib.incr_counter" title="Link to this definition">¶</a></dt>
  94. <dd><p>Increment a counter and return the new value.</p>
  95. <p>If counter with redis key <code class="docutils literal notranslate"><span class="pre">SearXNG_counter_&lt;name&gt;</span></code> does not exists it is
  96. created with initial value 1 returned. The replacement <code class="docutils literal notranslate"><span class="pre">&lt;name&gt;</span></code> is a
  97. <em>secret hash</em> of the value from argument <code class="docutils literal notranslate"><span class="pre">name</span></code> (see
  98. <a class="reference internal" href="#searx.redislib.secret_hash" title="searx.redislib.secret_hash"><code class="xref py py-func docutils literal notranslate"><span class="pre">secret_hash()</span></code></a>).</p>
  99. <p>The implementation of the redis counter is the lua script from string
  100. <code class="xref py py-obj docutils literal notranslate"><span class="pre">INCR_COUNTER</span></code>.</p>
  101. <dl class="field-list simple">
  102. <dt class="field-odd">Parameters<span class="colon">:</span></dt>
  103. <dd class="field-odd"><ul class="simple">
  104. <li><p><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.13)"><em>str</em></a>) – name of the counter</p></li>
  105. <li><p><strong>expire</strong> (int / see <a class="reference external" href="https://redis.io/commands/expire/">EXPIRE</a>) – live-time of the counter in seconds (default <code class="docutils literal notranslate"><span class="pre">None</span></code> means
  106. infinite).</p></li>
  107. <li><p><strong>limit</strong> (int / limit is 2^64 see <a class="reference external" href="https://redis.io/commands/incr/">INCR</a>) – limit where the counter stops to increment (default <code class="docutils literal notranslate"><span class="pre">None</span></code>)</p></li>
  108. </ul>
  109. </dd>
  110. <dt class="field-even">Returns<span class="colon">:</span></dt>
  111. <dd class="field-even"><p>value of the incremented counter</p>
  112. </dd>
  113. </dl>
  114. <p>A simple demo of a counter with expire time and limit:</p>
  115. <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">6</span><span class="p">):</span>
  116. <span class="gp">... </span> <span class="n">i</span><span class="p">,</span> <span class="n">incr_counter</span><span class="p">(</span><span class="n">client</span><span class="p">,</span> <span class="s2">&quot;foo&quot;</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span> <span class="c1"># max 3, duration 5 sec</span>
  117. <span class="gp">... </span> <span class="n">time</span><span class="o">.</span><span class="n">sleep</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="c1"># from the third call on max has been reached</span>
  118. <span class="gp">...</span>
  119. <span class="go">(0, 1)</span>
  120. <span class="go">(1, 2)</span>
  121. <span class="go">(2, 3)</span>
  122. <span class="go">(3, 3)</span>
  123. <span class="go">(4, 3)</span>
  124. <span class="go">(5, 1)</span>
  125. </pre></div>
  126. </div>
  127. </dd></dl>
  128. <dl class="py function">
  129. <dt class="sig sig-object py" id="searx.redislib.drop_counter">
  130. <span class="sig-prename descclassname"><span class="pre">searx.redislib.</span></span><span class="sig-name descname"><span class="pre">drop_counter</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">client</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">name</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/searx/redislib.html#drop_counter"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.redislib.drop_counter" title="Link to this definition">¶</a></dt>
  131. <dd><p>Drop counter with redis key <code class="docutils literal notranslate"><span class="pre">SearXNG_counter_&lt;name&gt;</span></code></p>
  132. <p>The replacement <code class="docutils literal notranslate"><span class="pre">&lt;name&gt;</span></code> is a <em>secret hash</em> of the value from argument
  133. <code class="docutils literal notranslate"><span class="pre">name</span></code> (see <a class="reference internal" href="#searx.redislib.incr_counter" title="searx.redislib.incr_counter"><code class="xref py py-func docutils literal notranslate"><span class="pre">incr_counter()</span></code></a> and <a class="reference internal" href="#searx.redislib.incr_sliding_window" title="searx.redislib.incr_sliding_window"><code class="xref py py-func docutils literal notranslate"><span class="pre">incr_sliding_window()</span></code></a>).</p>
  134. </dd></dl>
  135. <dl class="py function">
  136. <dt class="sig sig-object py" id="searx.redislib.incr_sliding_window">
  137. <span class="sig-prename descclassname"><span class="pre">searx.redislib.</span></span><span class="sig-name descname"><span class="pre">incr_sliding_window</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">client</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">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.13)"><span class="pre">str</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">duration</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#int" title="(in Python v3.13)"><span class="pre">int</span></a></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/searx/redislib.html#incr_sliding_window"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.redislib.incr_sliding_window" title="Link to this definition">¶</a></dt>
  138. <dd><p>Increment a sliding-window counter and return the new value.</p>
  139. <p>If counter with redis key <code class="docutils literal notranslate"><span class="pre">SearXNG_counter_&lt;name&gt;</span></code> does not exists it is
  140. created with initial value 1 returned. The replacement <code class="docutils literal notranslate"><span class="pre">&lt;name&gt;</span></code> is a
  141. <em>secret hash</em> of the value from argument <code class="docutils literal notranslate"><span class="pre">name</span></code> (see
  142. <a class="reference internal" href="#searx.redislib.secret_hash" title="searx.redislib.secret_hash"><code class="xref py py-func docutils literal notranslate"><span class="pre">secret_hash()</span></code></a>).</p>
  143. <dl class="field-list simple">
  144. <dt class="field-odd">Parameters<span class="colon">:</span></dt>
  145. <dd class="field-odd"><ul class="simple">
  146. <li><p><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.13)"><em>str</em></a>) – name of the counter</p></li>
  147. <li><p><strong>duration</strong> – live-time of the sliding window in seconds</p></li>
  148. </ul>
  149. </dd>
  150. <dt class="field-even">Typeduration<span class="colon">:</span></dt>
  151. <dd class="field-even"><p>int</p>
  152. </dd>
  153. <dt class="field-odd">Returns<span class="colon">:</span></dt>
  154. <dd class="field-odd"><p>value of the incremented counter</p>
  155. </dd>
  156. </dl>
  157. <p>The implementation of the redis counter is the lua script from string
  158. <code class="xref py py-obj docutils literal notranslate"><span class="pre">INCR_SLIDING_WINDOW</span></code>. The lua script uses <a class="reference external" href="https://redis.com/ebook/part-1-getting-started/chapter-1-getting-to-know-redis/1-2-what-redis-data-structures-look-like/1-2-5-sorted-sets-in-redis/">sorted sets in Redis</a>
  159. to implement a sliding window for the redis key <code class="docutils literal notranslate"><span class="pre">SearXNG_counter_&lt;name&gt;</span></code>
  160. (<a class="reference external" href="https://redis.io/commands/zadd/">ZADD</a>). The current <a class="reference external" href="https://redis.io/commands/time/">TIME</a> is used to score the items in the sorted set and
  161. the time window is moved by removing items with a score lower current time
  162. minus <em>duration</em> time (<a class="reference external" href="https://redis.io/commands/zremrangebyscore/">ZREMRANGEBYSCORE</a>).</p>
  163. <p>The <a class="reference external" href="https://redis.io/commands/expire/">EXPIRE</a> time (the duration of the sliding window) is refreshed on each
  164. call (increment) and if there is no call in this duration, the sorted
  165. set expires from the redis DB.</p>
  166. <p>The return value is the amount of items in the sorted set (<a class="reference external" href="https://redis.io/commands/zcount/">ZCOUNT</a>), what
  167. means the number of calls in the sliding window.</p>
  168. <p>A simple demo of the sliding window:</p>
  169. <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">5</span><span class="p">):</span>
  170. <span class="gp">... </span> <span class="n">incr_sliding_window</span><span class="p">(</span><span class="n">client</span><span class="p">,</span> <span class="s2">&quot;foo&quot;</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span> <span class="c1"># duration 3 sec</span>
  171. <span class="gp">... </span> <span class="n">time</span><span class="o">.</span><span class="n">sleep</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="c1"># from the third call (second) on the window is moved</span>
  172. <span class="gp">...</span>
  173. <span class="go">1</span>
  174. <span class="go">2</span>
  175. <span class="go">3</span>
  176. <span class="go">3</span>
  177. <span class="go">3</span>
  178. <span class="gp">&gt;&gt;&gt; </span><span class="n">time</span><span class="o">.</span><span class="n">sleep</span><span class="p">(</span><span class="mi">3</span><span class="p">)</span> <span class="c1"># wait until expire</span>
  179. <span class="gp">&gt;&gt;&gt; </span><span class="n">incr_sliding_window</span><span class="p">(</span><span class="n">client</span><span class="p">,</span> <span class="s2">&quot;foo&quot;</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
  180. <span class="go">1</span>
  181. </pre></div>
  182. </div>
  183. </dd></dl>
  184. </section>
  185. <div class="clearer"></div>
  186. </div>
  187. </div>
  188. </div>
  189. <span id="sidebar-top"></span>
  190. <div class="sphinxsidebar" role="navigation" aria-label="Main">
  191. <div class="sphinxsidebarwrapper">
  192. <p class="logo"><a href="../index.html">
  193. <img class="logo" src="../_static/searxng-wordmark.svg" alt="Logo of SearXNG"/>
  194. </a></p>
  195. <h3><a href="../index.html">Table of Contents</a></h3>
  196. <ul class="current">
  197. <li class="toctree-l1"><a class="reference internal" href="../user/index.html">User information</a></li>
  198. <li class="toctree-l1"><a class="reference internal" href="../own-instance.html">Why use a private instance?</a></li>
  199. <li class="toctree-l1"><a class="reference internal" href="../admin/index.html">Administrator documentation</a></li>
  200. <li class="toctree-l1"><a class="reference internal" href="../dev/index.html">Developer documentation</a></li>
  201. <li class="toctree-l1"><a class="reference internal" href="../utils/index.html">DevOps tooling box</a></li>
  202. <li class="toctree-l1 current"><a class="reference internal" href="index.html">Source-Code</a><ul class="current">
  203. <li class="toctree-l2"><a class="reference internal" href="searx.babel_extract.html">Custom message extractor (i18n)</a></li>
  204. <li class="toctree-l2"><a class="reference internal" href="searx.botdetection.html">Bot Detection</a></li>
  205. <li class="toctree-l2"><a class="reference internal" href="searx.cache.html">Caches</a></li>
  206. <li class="toctree-l2"><a class="reference internal" href="searx.exceptions.html">SearXNG Exceptions</a></li>
  207. <li class="toctree-l2"><a class="reference internal" href="searx.favicons.html">Favicons (source)</a></li>
  208. <li class="toctree-l2"><a class="reference internal" href="searx.infopage.html">Online <code class="docutils literal notranslate"><span class="pre">/info</span></code></a></li>
  209. <li class="toctree-l2"><a class="reference internal" href="searx.locales.html">Locales</a></li>
  210. <li class="toctree-l2"><a class="reference internal" href="searx.redisdb.html">Redis DB</a></li>
  211. <li class="toctree-l2 current"><a class="current reference internal" href="#">Redis Library</a><ul>
  212. <li class="toctree-l3"><a class="reference internal" href="#searx.redislib.LUA_SCRIPT_STORAGE"><code class="docutils literal notranslate"><span class="pre">LUA_SCRIPT_STORAGE</span></code></a></li>
  213. <li class="toctree-l3"><a class="reference internal" href="#searx.redislib.lua_script_storage"><code class="docutils literal notranslate"><span class="pre">lua_script_storage()</span></code></a></li>
  214. <li class="toctree-l3"><a class="reference internal" href="#searx.redislib.purge_by_prefix"><code class="docutils literal notranslate"><span class="pre">purge_by_prefix()</span></code></a></li>
  215. <li class="toctree-l3"><a class="reference internal" href="#searx.redislib.secret_hash"><code class="docutils literal notranslate"><span class="pre">secret_hash()</span></code></a></li>
  216. <li class="toctree-l3"><a class="reference internal" href="#searx.redislib.incr_counter"><code class="docutils literal notranslate"><span class="pre">incr_counter()</span></code></a></li>
  217. <li class="toctree-l3"><a class="reference internal" href="#searx.redislib.drop_counter"><code class="docutils literal notranslate"><span class="pre">drop_counter()</span></code></a></li>
  218. <li class="toctree-l3"><a class="reference internal" href="#searx.redislib.incr_sliding_window"><code class="docutils literal notranslate"><span class="pre">incr_sliding_window()</span></code></a></li>
  219. </ul>
  220. </li>
  221. <li class="toctree-l2"><a class="reference internal" href="searx.search.html">Search</a></li>
  222. <li class="toctree-l2"><a class="reference internal" href="searx.search.processors.html">Search processors</a></li>
  223. <li class="toctree-l2"><a class="reference internal" href="searx.settings.html">Settings Loader</a></li>
  224. <li class="toctree-l2"><a class="reference internal" href="searx.sqlitedb.html">SQLite DB</a></li>
  225. <li class="toctree-l2"><a class="reference internal" href="searx.utils.html">Utility functions for the engines</a></li>
  226. <li class="toctree-l2"><a class="reference internal" href="searx.weather.html">Weather</a></li>
  227. </ul>
  228. </li>
  229. </ul>
  230. <h3>Project Links</h3>
  231. <ul>
  232. <li><a href="https://github.com/searxng/searxng/tree/master">Source</a>
  233. <li><a href="https://github.com/searxng/searxng/wiki">Wiki</a>
  234. <li><a href="https://searx.space">Public instances</a>
  235. <li><a href="https://github.com/searxng/searxng/issues">Issue Tracker</a>
  236. </ul><h3>Navigation</h3>
  237. <ul>
  238. <li><a href="../index.html">Overview</a>
  239. <ul>
  240. <li><a href="index.html">Source-Code</a>
  241. <ul>
  242. <li>Previous: <a href="searx.redisdb.html" title="previous chapter">Redis DB</a>
  243. <li>Next: <a href="searx.search.html" title="next chapter">Search</a></ul>
  244. </li>
  245. </ul>
  246. </li>
  247. </ul>
  248. <search id="searchbox" style="display: none" role="search">
  249. <h3 id="searchlabel">Quick search</h3>
  250. <div class="searchformwrapper">
  251. <form class="search" action="../search.html" method="get">
  252. <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
  253. <input type="submit" value="Go" />
  254. </form>
  255. </div>
  256. </search>
  257. <script>document.getElementById('searchbox').style.display = "block"</script>
  258. <div role="note" aria-label="source link">
  259. <h3>This Page</h3>
  260. <ul class="this-page-menu">
  261. <li><a href="../_sources/src/searx.redislib.rst.txt"
  262. rel="nofollow">Show Source</a></li>
  263. </ul>
  264. </div>
  265. </div>
  266. </div>
  267. <div class="clearer"></div>
  268. </div>
  269. <div class="footer" role="contentinfo">
  270. &#169; Copyright SearXNG team.
  271. </div>
  272. </body>
  273. </html>