index.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  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>Result Types &#8212; SearXNG Documentation (2025.4.30+fd33559cf)</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=b12b0e12"></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.4.30+fd33559cf" 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="Result" href="base_result.html" />
  17. <link rel="prev" title="Tineye" href="../engines/online_url_search/tineye.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="base_result.html" title="Result"
  30. accesskey="N">next</a> |</li>
  31. <li class="right" >
  32. <a href="../engines/online_url_search/tineye.html" title="Tineye"
  33. accesskey="P">previous</a> |</li>
  34. <li class="nav-item nav-item-0"><a href="../../index.html">SearXNG Documentation (2025.4.30+fd33559cf)</a> &#187;</li>
  35. <li class="nav-item nav-item-1"><a href="../index.html" accesskey="U">Developer documentation</a> &#187;</li>
  36. <li class="nav-item nav-item-this"><a href="">Result Types</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="result-types">
  44. <span id="id1"></span><h1>Result Types<a class="headerlink" href="#result-types" title="Link to this heading">¶</a></h1>
  45. <p>To understand the typification of the results, let’s take a brief look at the
  46. structure of SearXNG .. At its core, SearXNG is nothing more than an aggregator
  47. that aggregates the results from various sources, renders them via templates and
  48. displays them to the user.</p>
  49. <p>The <strong>sources</strong> can be:</p>
  50. <ol class="arabic simple">
  51. <li><p><a class="reference internal" href="../engines/index.html#engine-implementations"><span class="std std-ref">engines</span></a></p></li>
  52. <li><p><a class="reference internal" href="../plugins/development.html#dev-plugin"><span class="std std-ref">plugins</span></a></p></li>
  53. <li><p><a class="reference internal" href="../answerers/development.html#dev-answerers"><span class="std std-ref">answerers</span></a></p></li>
  54. </ol>
  55. <p>The sources provide the results, which are displayed in different <strong>areas</strong>
  56. depending on the type of result. The areas are:</p>
  57. <dl class="simple" id="area-main-results">
  58. <dt><a class="reference internal" href="main_result.html#main-search-results"><span class="std std-ref">area main results</span></a></dt><dd><p>It is the main area in which – as is typical for search engines – the
  59. results that a search engine has found for the search term are displayed.</p>
  60. </dd>
  61. </dl>
  62. <dl class="simple" id="area-answer-results">
  63. <dt><a class="reference internal" href="answer.html#result-types-answer"><span class="std std-ref">area answers</span></a></dt><dd><p>This area displays short answers that could be found for the search term.</p>
  64. </dd>
  65. </dl>
  66. <dl class="simple" id="area-info-box">
  67. <dt><a class="reference internal" href="infobox.html#result-types-infobox"><span class="std std-ref">area info box</span></a></dt><dd><p>An area in which additional information can be displayed, e.g. excerpts from
  68. wikipedia or other sources such as maps.</p>
  69. </dd>
  70. </dl>
  71. <dl class="simple" id="area-suggestions-results">
  72. <dt><a class="reference internal" href="suggestion.html#result-types-suggestion"><span class="std std-ref">area suggestions</span></a></dt><dd><p>Suggestions for alternative search terms can be found in this area. These can
  73. be clicked on and a search is carried out with these search terms.</p>
  74. </dd>
  75. </dl>
  76. <dl class="simple" id="area-corrections-results">
  77. <dt><a class="reference internal" href="correction.html#result-types-corrections"><span class="std std-ref">area corrections</span></a></dt><dd><p>Results in this area are like the suggestion of alternative search terms,
  78. which usually result from spelling corrections</p>
  79. </dd>
  80. </dl>
  81. <p>At this point it is important to note that all <strong>sources</strong> can contribute
  82. results to all of the areas mentioned above.</p>
  83. <p>In most cases, however, the <a class="reference internal" href="../engines/index.html#engine-implementations"><span class="std std-ref">engines</span></a> will fill
  84. the <em>main results</em> and the <a class="reference internal" href="../answerers/development.html#dev-answerers"><span class="std std-ref">answerers</span></a> will generally
  85. provide the contributions for the <em>answer</em> area. Not necessary to mention here
  86. but for a better understanding: the plugins can also filter out or change
  87. results from the main results area (e.g. the URL of the link).</p>
  88. <p>The result items are organized in the <code class="xref py py-obj docutils literal notranslate"><span class="pre">results.ResultContainer</span></code> and
  89. after all sources have delivered their results, this container is passed to the
  90. templating to build a HTML output. The output is usually HTML, but it is also
  91. possible to output the result lists as JSON or RSS feed. Thats quite all we need
  92. to know before we dive into typification of result items.</p>
  93. <div class="admonition hint">
  94. <p class="admonition-title">Hint</p>
  95. <p>Typification of result items: we are at the very first beginng!</p>
  96. </div>
  97. <p>The first thing we have to realize is that there is no typification of the
  98. result items so far, we have to build it up first .. and that is quite a big
  99. task, which we will only be able to accomplish gradually.</p>
  100. <p>The foundation for the typeless results was laid back in 2013 in the very first
  101. commit <a class="reference external" href="https://github.com/searxng/searxng/commit/ae9fb1d7d">&#64;ae9fb1d</a>, and the principle has not changed since then. At
  102. the time, the approach was perfectly adequate, but we have since evolved and the
  103. demands on SearXNG increase with every feature request.</p>
  104. <p><strong>Motivation:</strong> in the meantime, it has become very difficult to develop new
  105. features that require structural changes and it is especially hard for newcomers
  106. to find their way in this typeless world. As long as the results are only
  107. simple key/value dictionaries, it is not even possible for the IDEs to support
  108. the application developer in his work.</p>
  109. <p><strong>Planning:</strong> The procedure for subsequent typing will have to be based on the
  110. circumstances ..</p>
  111. <div class="admonition attention">
  112. <p class="admonition-title">Attention</p>
  113. <p>As long as there is no type defined for a kind of result the HTML template
  114. specify what the properties of a type are.</p>
  115. <p>In this sense, you will either find a type definition here in the
  116. documentation or, if this does not yet exist, a description of the HTML
  117. template.</p>
  118. </div>
  119. <div class="toctree-wrapper compound">
  120. <ul>
  121. <li class="toctree-l1"><a class="reference internal" href="base_result.html">Result</a><ul>
  122. <li class="toctree-l2"><a class="reference internal" href="base_result.html#searx.result_types._base.Result"><code class="docutils literal notranslate"><span class="pre">Result</span></code></a></li>
  123. <li class="toctree-l2"><a class="reference internal" href="base_result.html#searx.result_types._base.LegacyResult"><code class="docutils literal notranslate"><span class="pre">LegacyResult</span></code></a></li>
  124. </ul>
  125. </li>
  126. <li class="toctree-l1"><a class="reference internal" href="main_result.html">Main Search Results</a><ul>
  127. <li class="toctree-l2"><a class="reference internal" href="main/mainresult.html"><code class="docutils literal notranslate"><span class="pre">MainResult</span></code></a></li>
  128. <li class="toctree-l2"><a class="reference internal" href="main/keyvalue.html">Key-Value Results</a></li>
  129. </ul>
  130. </li>
  131. <li class="toctree-l1"><a class="reference internal" href="answer.html">Answer Results</a><ul>
  132. <li class="toctree-l2"><a class="reference internal" href="answer.html#searx.result_types.answer.BaseAnswer"><code class="docutils literal notranslate"><span class="pre">BaseAnswer</span></code></a></li>
  133. <li class="toctree-l2"><a class="reference internal" href="answer.html#searx.result_types.answer.Answer"><code class="docutils literal notranslate"><span class="pre">Answer</span></code></a></li>
  134. <li class="toctree-l2"><a class="reference internal" href="answer.html#searx.result_types.answer.Translations"><code class="docutils literal notranslate"><span class="pre">Translations</span></code></a></li>
  135. <li class="toctree-l2"><a class="reference internal" href="answer.html#searx.result_types.answer.AnswerSet"><code class="docutils literal notranslate"><span class="pre">AnswerSet</span></code></a></li>
  136. </ul>
  137. </li>
  138. <li class="toctree-l1"><a class="reference internal" href="correction.html">Correction Results</a></li>
  139. <li class="toctree-l1"><a class="reference internal" href="suggestion.html">Suggestion Results</a></li>
  140. <li class="toctree-l1"><a class="reference internal" href="infobox.html">Infobox Results</a></li>
  141. </ul>
  142. </div>
  143. </section>
  144. <div class="clearer"></div>
  145. </div>
  146. </div>
  147. </div>
  148. <span id="sidebar-top"></span>
  149. <div class="sphinxsidebar" role="navigation" aria-label="Main">
  150. <div class="sphinxsidebarwrapper">
  151. <p class="logo"><a href="../../index.html">
  152. <img class="logo" src="../../_static/searxng-wordmark.svg" alt="Logo of SearXNG"/>
  153. </a></p>
  154. <h3><a href="../../index.html">Table of Contents</a></h3>
  155. <ul class="current">
  156. <li class="toctree-l1"><a class="reference internal" href="../../user/index.html">User information</a></li>
  157. <li class="toctree-l1"><a class="reference internal" href="../../own-instance.html">Why use a private instance?</a></li>
  158. <li class="toctree-l1"><a class="reference internal" href="../../admin/index.html">Administrator documentation</a></li>
  159. <li class="toctree-l1 current"><a class="reference internal" href="../index.html">Developer documentation</a><ul class="current">
  160. <li class="toctree-l2"><a class="reference internal" href="../quickstart.html">Development Quickstart</a></li>
  161. <li class="toctree-l2"><a class="reference internal" href="../rtm_asdf.html">Runtime Management</a></li>
  162. <li class="toctree-l2"><a class="reference internal" href="../contribution_guide.html">How to contribute</a></li>
  163. <li class="toctree-l2"><a class="reference internal" href="../extended_types.html">Extended Types</a></li>
  164. <li class="toctree-l2"><a class="reference internal" href="../engines/index.html">Engine Implementations</a></li>
  165. <li class="toctree-l2 current"><a class="current reference internal" href="#">Result Types</a><ul>
  166. <li class="toctree-l3"><a class="reference internal" href="base_result.html">Result</a></li>
  167. <li class="toctree-l3"><a class="reference internal" href="main_result.html">Main Search Results</a></li>
  168. <li class="toctree-l3"><a class="reference internal" href="answer.html">Answer Results</a></li>
  169. <li class="toctree-l3"><a class="reference internal" href="correction.html">Correction Results</a></li>
  170. <li class="toctree-l3"><a class="reference internal" href="suggestion.html">Suggestion Results</a></li>
  171. <li class="toctree-l3"><a class="reference internal" href="infobox.html">Infobox Results</a></li>
  172. </ul>
  173. </li>
  174. <li class="toctree-l2"><a class="reference internal" href="../templates.html">Simple Theme Templates</a></li>
  175. <li class="toctree-l2"><a class="reference internal" href="../search_api.html">Search API</a></li>
  176. <li class="toctree-l2"><a class="reference internal" href="../plugins/index.html">Plugins</a></li>
  177. <li class="toctree-l2"><a class="reference internal" href="../answerers/index.html">Answerers</a></li>
  178. <li class="toctree-l2"><a class="reference internal" href="../translation.html">Translation</a></li>
  179. <li class="toctree-l2"><a class="reference internal" href="../lxcdev.html">Developing in Linux Containers</a></li>
  180. <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>
  181. <li class="toctree-l2"><a class="reference internal" href="../reST.html">reST primer</a></li>
  182. <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>
  183. </ul>
  184. </li>
  185. <li class="toctree-l1"><a class="reference internal" href="../../utils/index.html">DevOps tooling box</a></li>
  186. <li class="toctree-l1"><a class="reference internal" href="../../src/index.html">Source-Code</a></li>
  187. </ul>
  188. <h3>Project Links</h3>
  189. <ul>
  190. <li><a href="https://github.com/searxng/searxng/tree/master">Source</a>
  191. <li><a href="https://github.com/searxng/searxng/wiki">Wiki</a>
  192. <li><a href="https://searx.space">Public instances</a>
  193. <li><a href="https://github.com/searxng/searxng/issues">Issue Tracker</a>
  194. </ul><h3>Navigation</h3>
  195. <ul>
  196. <li><a href="../../index.html">Overview</a>
  197. <ul>
  198. <li><a href="../index.html">Developer documentation</a>
  199. <ul>
  200. <li>Previous: <a href="../engines/online_url_search/tineye.html" title="previous chapter">Tineye</a>
  201. <li>Next: <a href="base_result.html" title="next chapter">Result</a></ul>
  202. </li>
  203. </ul>
  204. </li>
  205. </ul>
  206. <search id="searchbox" style="display: none" role="search">
  207. <h3 id="searchlabel">Quick search</h3>
  208. <div class="searchformwrapper">
  209. <form class="search" action="../../search.html" method="get">
  210. <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
  211. <input type="submit" value="Go" />
  212. </form>
  213. </div>
  214. </search>
  215. <script>document.getElementById('searchbox').style.display = "block"</script>
  216. <div role="note" aria-label="source link">
  217. <h3>This Page</h3>
  218. <ul class="this-page-menu">
  219. <li><a href="../../_sources/dev/result_types/index.rst.txt"
  220. rel="nofollow">Show Source</a></li>
  221. </ul>
  222. </div>
  223. </div>
  224. </div>
  225. <div class="clearer"></div>
  226. </div>
  227. <div class="footer" role="contentinfo">
  228. &#169; Copyright SearXNG team.
  229. </div>
  230. </body>
  231. </html>