engine_overview.html 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687
  1. <!DOCTYPE html>
  2. <html lang="en">
  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>Engine overview &#8212; Searx Documentation (Searx-1.1.0.tex)</title>
  8. <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
  9. <link rel="stylesheet" type="text/css" href="../_static/searx.css" />
  10. <link rel="stylesheet" type="text/css" href="../_static/tabs.css" />
  11. <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
  12. <script src="../_static/jquery.js"></script>
  13. <script src="../_static/underscore.js"></script>
  14. <script src="../_static/_sphinx_javascript_frameworks_compat.js"></script>
  15. <script src="../_static/doctools.js"></script>
  16. <script src="../_static/sphinx_highlight.js"></script>
  17. <link rel="index" title="Index" href="../genindex.html" />
  18. <link rel="search" title="Search" href="../search.html" />
  19. <link rel="next" title="Search API" href="search_api.html" />
  20. <link rel="prev" title="How to contribute" href="contribution_guide.html" />
  21. </head><body>
  22. <div class="related" role="navigation" aria-label="related navigation">
  23. <h3>Navigation</h3>
  24. <ul>
  25. <li class="right" style="margin-right: 10px">
  26. <a href="../genindex.html" title="General Index"
  27. accesskey="I">index</a></li>
  28. <li class="right" >
  29. <a href="../py-modindex.html" title="Python Module Index"
  30. >modules</a> |</li>
  31. <li class="right" >
  32. <a href="search_api.html" title="Search API"
  33. accesskey="N">next</a> |</li>
  34. <li class="right" >
  35. <a href="contribution_guide.html" title="How to contribute"
  36. accesskey="P">previous</a> |</li>
  37. <li class="nav-item nav-item-0"><a href="../index.html">Searx Documentation (Searx-1.1.0.tex)</a> &#187;</li>
  38. <li class="nav-item nav-item-1"><a href="index.html" accesskey="U">Developer documentation</a> &#187;</li>
  39. <li class="nav-item nav-item-this"><a href="">Engine overview</a></li>
  40. </ul>
  41. </div>
  42. <div class="document">
  43. <div class="documentwrapper">
  44. <div class="bodywrapper">
  45. <div class="body" role="main">
  46. <section id="engine-overview">
  47. <span id="engines-dev"></span><h1><a class="toc-backref" href="#id4" role="doc-backlink">Engine overview</a><a class="headerlink" href="#engine-overview" title="Permalink to this heading">¶</a></h1>
  48. <p>searx 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
  49. better results.</p>
  50. <p>Because there is no general search API which could be used for every search
  51. engine, an adapter has to be built between searx and the external search
  52. engines. Adapters are stored under the folder <a class="reference external" href="https://github.com/searx/searx/blob/master/searx/engines">Origin: searx/engines</a>.</p>
  53. <nav class="contents" id="contents">
  54. <p class="topic-title">Contents</p>
  55. <ul class="simple">
  56. <li><p><a class="reference internal" href="#engine-overview" id="id4">Engine overview</a></p>
  57. <ul>
  58. <li><p><a class="reference internal" href="#general-engine-configuration" id="id5">general engine configuration</a></p>
  59. <ul>
  60. <li><p><a class="reference internal" href="#engine-file" id="id6">engine file</a></p></li>
  61. <li><p><a class="reference internal" href="#settings-yml" id="id7">settings.yml</a></p></li>
  62. <li><p><a class="reference internal" href="#overrides" id="id8">overrides</a></p></li>
  63. <li><p><a class="reference internal" href="#example-code" id="id9">example code</a></p></li>
  64. </ul>
  65. </li>
  66. <li><p><a class="reference internal" href="#making-a-request" id="id10">making a request</a></p>
  67. <ul>
  68. <li><p><a class="reference internal" href="#passed-arguments" id="id11">passed arguments</a></p></li>
  69. <li><p><a class="reference internal" href="#parsed-arguments" id="id12">parsed arguments</a></p></li>
  70. <li><p><a class="reference internal" href="#id3" id="id13">example code</a></p></li>
  71. </ul>
  72. </li>
  73. <li><p><a class="reference internal" href="#returned-results" id="id14">returned results</a></p>
  74. <ul>
  75. <li><p><a class="reference internal" href="#default" id="id15">default</a></p></li>
  76. <li><p><a class="reference internal" href="#images" id="id16">images</a></p></li>
  77. <li><p><a class="reference internal" href="#videos" id="id17">videos</a></p></li>
  78. <li><p><a class="reference internal" href="#torrent" id="id18">torrent</a></p></li>
  79. <li><p><a class="reference internal" href="#map" id="id19">map</a></p></li>
  80. </ul>
  81. </li>
  82. </ul>
  83. </li>
  84. </ul>
  85. </nav>
  86. <section id="general-engine-configuration">
  87. <span id="id1"></span><h2><a class="toc-backref" href="#id5" role="doc-backlink">general engine configuration</a><a class="headerlink" href="#general-engine-configuration" title="Permalink to this heading">¶</a></h2>
  88. <p>It is required to tell searx the type of results the engine provides. The
  89. arguments can be set in the engine file or in the settings file
  90. (normally <code class="docutils literal notranslate"><span class="pre">settings.yml</span></code>). The arguments in the settings file override
  91. the ones in the engine file.</p>
  92. <p>It does not matter if an option is stored in the engine file or in the
  93. settings. However, the standard way is the following:</p>
  94. <section id="engine-file">
  95. <span id="id2"></span><h3><a class="toc-backref" href="#id6" role="doc-backlink">engine file</a><a class="headerlink" href="#engine-file" title="Permalink to this heading">¶</a></h3>
  96. <table class="docutils align-default">
  97. <thead>
  98. <tr class="row-odd"><th class="head"><p>argument</p></th>
  99. <th class="head"><p>type</p></th>
  100. <th class="head"><p>information</p></th>
  101. </tr>
  102. </thead>
  103. <tbody>
  104. <tr class="row-even"><td><p>categories</p></td>
  105. <td><p>list</p></td>
  106. <td><p>pages, in which the engine is working</p></td>
  107. </tr>
  108. <tr class="row-odd"><td><p>paging</p></td>
  109. <td><p>boolean</p></td>
  110. <td><p>support multiple pages</p></td>
  111. </tr>
  112. <tr class="row-even"><td><p>time_range_support</p></td>
  113. <td><p>boolean</p></td>
  114. <td><p>support search time range</p></td>
  115. </tr>
  116. <tr class="row-odd"><td><p>engine_type</p></td>
  117. <td><p>str</p></td>
  118. <td><p><code class="docutils literal notranslate"><span class="pre">online</span></code> by default, other possibles values are
  119. <code class="docutils literal notranslate"><span class="pre">offline</span></code>, <code class="docutils literal notranslate"><span class="pre">online_dictionary</span></code>, <code class="docutils literal notranslate"><span class="pre">online_currency</span></code></p></td>
  120. </tr>
  121. </tbody>
  122. </table>
  123. </section>
  124. <section id="settings-yml">
  125. <span id="engine-settings"></span><h3><a class="toc-backref" href="#id7" role="doc-backlink">settings.yml</a><a class="headerlink" href="#settings-yml" title="Permalink to this heading">¶</a></h3>
  126. <table class="docutils align-default">
  127. <thead>
  128. <tr class="row-odd"><th class="head"><p>argument</p></th>
  129. <th class="head"><p>type</p></th>
  130. <th class="head"><p>information</p></th>
  131. </tr>
  132. </thead>
  133. <tbody>
  134. <tr class="row-even"><td><p>name</p></td>
  135. <td><p>string</p></td>
  136. <td><p>name of search-engine</p></td>
  137. </tr>
  138. <tr class="row-odd"><td><p>engine</p></td>
  139. <td><p>string</p></td>
  140. <td><p>name of searx-engine
  141. (filename without <code class="docutils literal notranslate"><span class="pre">.py</span></code>)</p></td>
  142. </tr>
  143. <tr class="row-even"><td><p>enable_http</p></td>
  144. <td><p>bool</p></td>
  145. <td><p>enable HTTP
  146. (by default only HTTPS is enabled).</p></td>
  147. </tr>
  148. <tr class="row-odd"><td><p>shortcut</p></td>
  149. <td><p>string</p></td>
  150. <td><p>shortcut of search-engine</p></td>
  151. </tr>
  152. <tr class="row-even"><td><p>timeout</p></td>
  153. <td><p>string</p></td>
  154. <td><p>specific timeout for search-engine</p></td>
  155. </tr>
  156. <tr class="row-odd"><td><p>display_error_messages</p></td>
  157. <td><p>boolean</p></td>
  158. <td><p>display error messages on the web UI</p></td>
  159. </tr>
  160. <tr class="row-even"><td><p>proxies</p></td>
  161. <td><p>dict</p></td>
  162. <td><p>set proxies for a specific engine
  163. (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>
  164. <span class="pre">https:</span> <span class="pre">socks5://proxy:port}</span></code>)</p></td>
  165. </tr>
  166. </tbody>
  167. </table>
  168. </section>
  169. <section id="overrides">
  170. <h3><a class="toc-backref" href="#id8" role="doc-backlink">overrides</a><a class="headerlink" href="#overrides" title="Permalink to this heading">¶</a></h3>
  171. <p>A few of the options have default values in the engine, but are often
  172. overwritten by the settings. If <code class="docutils literal notranslate"><span class="pre">None</span></code> is assigned to an option in the engine
  173. file, it has to be redefined in the settings, otherwise searx will not start
  174. with that engine.</p>
  175. <p>The naming of overrides is arbitrary. But the recommended overrides are the
  176. following:</p>
  177. <table class="docutils align-default">
  178. <thead>
  179. <tr class="row-odd"><th class="head"><p>argument</p></th>
  180. <th class="head"><p>type</p></th>
  181. <th class="head"><p>information</p></th>
  182. </tr>
  183. </thead>
  184. <tbody>
  185. <tr class="row-even"><td><p>base_url</p></td>
  186. <td><p>string</p></td>
  187. <td><p>base-url, can be overwritten to use same
  188. engine on other URL</p></td>
  189. </tr>
  190. <tr class="row-odd"><td><p>number_of_results</p></td>
  191. <td><p>int</p></td>
  192. <td><p>maximum number of results per request</p></td>
  193. </tr>
  194. <tr class="row-even"><td><p>language</p></td>
  195. <td><p>string</p></td>
  196. <td><p>ISO code of language and country like en_US</p></td>
  197. </tr>
  198. <tr class="row-odd"><td><p>api_key</p></td>
  199. <td><p>string</p></td>
  200. <td><p>api-key if required by engine</p></td>
  201. </tr>
  202. </tbody>
  203. </table>
  204. </section>
  205. <section id="example-code">
  206. <h3><a class="toc-backref" href="#id9" role="doc-backlink">example code</a><a class="headerlink" href="#example-code" title="Permalink to this heading">¶</a></h3>
  207. <div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1"># engine dependent config</span>
  208. <span class="n">categories</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;general&#39;</span><span class="p">]</span>
  209. <span class="n">paging</span> <span class="o">=</span> <span class="kc">True</span>
  210. </pre></div>
  211. </div>
  212. </section>
  213. </section>
  214. <section id="making-a-request">
  215. <h2><a class="toc-backref" href="#id10" role="doc-backlink">making a request</a><a class="headerlink" href="#making-a-request" title="Permalink to this heading">¶</a></h2>
  216. <p>To perform a search an URL have to be specified. In addition to specifying an
  217. URL, arguments can be passed to the query.</p>
  218. <section id="passed-arguments">
  219. <h3><a class="toc-backref" href="#id11" role="doc-backlink">passed arguments</a><a class="headerlink" href="#passed-arguments" title="Permalink to this heading">¶</a></h3>
  220. <p>These arguments can be used to construct the search query. Furthermore,
  221. parameters with default value can be redefined for special purposes.</p>
  222. <p>If the <code class="docutils literal notranslate"><span class="pre">engine_type</span></code> is <code class="docutils literal notranslate"><span class="pre">online`</span></code>:</p>
  223. <table class="docutils align-default">
  224. <thead>
  225. <tr class="row-odd"><th class="head"><p>argument</p></th>
  226. <th class="head"><p>type</p></th>
  227. <th class="head"><p>default-value, information</p></th>
  228. </tr>
  229. </thead>
  230. <tbody>
  231. <tr class="row-even"><td><p>url</p></td>
  232. <td><p>str</p></td>
  233. <td><p><code class="docutils literal notranslate"><span class="pre">''</span></code></p></td>
  234. </tr>
  235. <tr class="row-odd"><td><p>method</p></td>
  236. <td><p>str</p></td>
  237. <td><p><code class="docutils literal notranslate"><span class="pre">'GET'</span></code></p></td>
  238. </tr>
  239. <tr class="row-even"><td><p>headers</p></td>
  240. <td><p>set</p></td>
  241. <td><p><code class="docutils literal notranslate"><span class="pre">{}</span></code></p></td>
  242. </tr>
  243. <tr class="row-odd"><td><p>data</p></td>
  244. <td><p>set</p></td>
  245. <td><p><code class="docutils literal notranslate"><span class="pre">{}</span></code></p></td>
  246. </tr>
  247. <tr class="row-even"><td><p>cookies</p></td>
  248. <td><p>set</p></td>
  249. <td><p><code class="docutils literal notranslate"><span class="pre">{}</span></code></p></td>
  250. </tr>
  251. <tr class="row-odd"><td><p>verify</p></td>
  252. <td><p>bool</p></td>
  253. <td><p><code class="docutils literal notranslate"><span class="pre">True</span></code></p></td>
  254. </tr>
  255. <tr class="row-even"><td><p>headers.User-Agent</p></td>
  256. <td><p>str</p></td>
  257. <td><p>a random User-Agent</p></td>
  258. </tr>
  259. <tr class="row-odd"><td><p>category</p></td>
  260. <td><p>str</p></td>
  261. <td><p>current category, like <code class="docutils literal notranslate"><span class="pre">'general'</span></code></p></td>
  262. </tr>
  263. <tr class="row-even"><td><p>safesearch</p></td>
  264. <td><p>int</p></td>
  265. <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>
  266. </tr>
  267. <tr class="row-odd"><td><p>time_range</p></td>
  268. <td><p>Optional[str]</p></td>
  269. <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>
  270. </tr>
  271. <tr class="row-even"><td><p>pageno</p></td>
  272. <td><p>int</p></td>
  273. <td><p>current pagenumber</p></td>
  274. </tr>
  275. <tr class="row-odd"><td><p>language</p></td>
  276. <td><p>str</p></td>
  277. <td><p>specific language code like <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>
  278. </tr>
  279. </tbody>
  280. </table>
  281. <p>If the <code class="docutils literal notranslate"><span class="pre">engine_type</span></code> is <code class="docutils literal notranslate"><span class="pre">online_dictionary`</span></code>, in addition to the <code class="docutils literal notranslate"><span class="pre">online</span></code> arguments:</p>
  282. <table class="docutils align-default">
  283. <thead>
  284. <tr class="row-odd"><th class="head"><p>argument</p></th>
  285. <th class="head"><p>type</p></th>
  286. <th class="head"><p>default-value, information</p></th>
  287. </tr>
  288. </thead>
  289. <tbody>
  290. <tr class="row-even"><td><p>from_lang</p></td>
  291. <td><p>str</p></td>
  292. <td><p>specific language code like <code class="docutils literal notranslate"><span class="pre">'en_US'</span></code></p></td>
  293. </tr>
  294. <tr class="row-odd"><td><p>to_lang</p></td>
  295. <td><p>str</p></td>
  296. <td><p>specific language code like <code class="docutils literal notranslate"><span class="pre">'en_US'</span></code></p></td>
  297. </tr>
  298. <tr class="row-even"><td><p>query</p></td>
  299. <td><p>str</p></td>
  300. <td><p>the text query without the languages</p></td>
  301. </tr>
  302. </tbody>
  303. </table>
  304. <p>If the <code class="docutils literal notranslate"><span class="pre">engine_type</span></code> is <code class="docutils literal notranslate"><span class="pre">online_currency`</span></code>, in addition to the <code class="docutils literal notranslate"><span class="pre">online</span></code> arguments:</p>
  305. <table class="docutils align-default">
  306. <thead>
  307. <tr class="row-odd"><th class="head"><p>argument</p></th>
  308. <th class="head"><p>type</p></th>
  309. <th class="head"><p>default-value, information</p></th>
  310. </tr>
  311. </thead>
  312. <tbody>
  313. <tr class="row-even"><td><p>amount</p></td>
  314. <td><p>float</p></td>
  315. <td><p>the amount to convert</p></td>
  316. </tr>
  317. <tr class="row-odd"><td><p>from</p></td>
  318. <td><p>str</p></td>
  319. <td><p>ISO 4217 code</p></td>
  320. </tr>
  321. <tr class="row-even"><td><p>to</p></td>
  322. <td><p>str</p></td>
  323. <td><p>ISO 4217 code</p></td>
  324. </tr>
  325. <tr class="row-odd"><td><p>from_name</p></td>
  326. <td><p>str</p></td>
  327. <td><p>currency name</p></td>
  328. </tr>
  329. <tr class="row-even"><td><p>to_name</p></td>
  330. <td><p>str</p></td>
  331. <td><p>currency name</p></td>
  332. </tr>
  333. </tbody>
  334. </table>
  335. </section>
  336. <section id="parsed-arguments">
  337. <h3><a class="toc-backref" href="#id12" role="doc-backlink">parsed arguments</a><a class="headerlink" href="#parsed-arguments" title="Permalink to this heading">¶</a></h3>
  338. <p>The function <code class="docutils literal notranslate"><span class="pre">def</span> <span class="pre">request(query,</span> <span class="pre">params):</span></code> always returns the <code class="docutils literal notranslate"><span class="pre">params</span></code>
  339. variable. Inside searx, the following parameters can be used to specify a search
  340. request:</p>
  341. <table class="docutils align-default">
  342. <thead>
  343. <tr class="row-odd"><th class="head"><p>argument</p></th>
  344. <th class="head"><p>type</p></th>
  345. <th class="head"><p>information</p></th>
  346. </tr>
  347. </thead>
  348. <tbody>
  349. <tr class="row-even"><td><p>url</p></td>
  350. <td><p>str</p></td>
  351. <td><p>requested url</p></td>
  352. </tr>
  353. <tr class="row-odd"><td><p>method</p></td>
  354. <td><p>str</p></td>
  355. <td><p>HTTP request method</p></td>
  356. </tr>
  357. <tr class="row-even"><td><p>headers</p></td>
  358. <td><p>set</p></td>
  359. <td><p>HTTP header information</p></td>
  360. </tr>
  361. <tr class="row-odd"><td><p>data</p></td>
  362. <td><p>set</p></td>
  363. <td><p>HTTP data information</p></td>
  364. </tr>
  365. <tr class="row-even"><td><p>cookies</p></td>
  366. <td><p>set</p></td>
  367. <td><p>HTTP cookies</p></td>
  368. </tr>
  369. <tr class="row-odd"><td><p>verify</p></td>
  370. <td><p>bool</p></td>
  371. <td><p>Performing SSL-Validity check</p></td>
  372. </tr>
  373. <tr class="row-even"><td><p>follow_redirects</p></td>
  374. <td><p>bool</p></td>
  375. <td><p>Follow redirects</p></td>
  376. </tr>
  377. <tr class="row-odd"><td><p>max_redirects</p></td>
  378. <td><p>int</p></td>
  379. <td><p>maximum redirects, hard limit</p></td>
  380. </tr>
  381. <tr class="row-even"><td><p>soft_max_redirects</p></td>
  382. <td><p>int</p></td>
  383. <td><p>maximum redirects, soft limit. Record an error but don’t stop the engine</p></td>
  384. </tr>
  385. <tr class="row-odd"><td><p>raise_for_httperror</p></td>
  386. <td><p>bool</p></td>
  387. <td><p>True by default: raise an exception if the HTTP code of response is &gt;= 300</p></td>
  388. </tr>
  389. </tbody>
  390. </table>
  391. </section>
  392. <section id="id3">
  393. <h3><a class="toc-backref" href="#id13" role="doc-backlink">example code</a><a class="headerlink" href="#id3" title="Permalink to this heading">¶</a></h3>
  394. <div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1"># search-url</span>
  395. <span class="n">base_url</span> <span class="o">=</span> <span class="s1">&#39;https://example.com/&#39;</span>
  396. <span class="n">search_string</span> <span class="o">=</span> <span class="s1">&#39;search?</span><span class="si">{query}</span><span class="s1">&amp;page=</span><span class="si">{page}</span><span class="s1">&#39;</span>
  397. <span class="c1"># do search-request</span>
  398. <span class="k">def</span> <span class="nf">request</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">params</span><span class="p">):</span>
  399. <span class="n">search_path</span> <span class="o">=</span> <span class="n">search_string</span><span class="o">.</span><span class="n">format</span><span class="p">(</span>
  400. <span class="n">query</span><span class="o">=</span><span class="n">urlencode</span><span class="p">({</span><span class="s1">&#39;q&#39;</span><span class="p">:</span> <span class="n">query</span><span class="p">}),</span>
  401. <span class="n">page</span><span class="o">=</span><span class="n">params</span><span class="p">[</span><span class="s1">&#39;pageno&#39;</span><span class="p">])</span>
  402. <span class="n">params</span><span class="p">[</span><span class="s1">&#39;url&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">base_url</span> <span class="o">+</span> <span class="n">search_path</span>
  403. <span class="k">return</span> <span class="n">params</span>
  404. </pre></div>
  405. </div>
  406. </section>
  407. </section>
  408. <section id="returned-results">
  409. <h2><a class="toc-backref" href="#id14" role="doc-backlink">returned results</a><a class="headerlink" href="#returned-results" title="Permalink to this heading">¶</a></h2>
  410. <p>Searx is able to return results of different media-types. Currently the
  411. following media-types are supported:</p>
  412. <ul class="simple">
  413. <li><p><a class="reference internal" href="#default">default</a></p></li>
  414. <li><p><a class="reference internal" href="#images">images</a></p></li>
  415. <li><p><a class="reference internal" href="#videos">videos</a></p></li>
  416. <li><p><a class="reference internal" href="#torrent">torrent</a></p></li>
  417. <li><p><a class="reference internal" href="#map">map</a></p></li>
  418. </ul>
  419. <p>To set another media-type as default, the parameter <code class="docutils literal notranslate"><span class="pre">template</span></code> must be set to
  420. the desired type.</p>
  421. <section id="default">
  422. <h3><a class="toc-backref" href="#id15" role="doc-backlink">default</a><a class="headerlink" href="#default" title="Permalink to this heading">¶</a></h3>
  423. <table class="docutils align-default">
  424. <thead>
  425. <tr class="row-odd"><th class="head"><p>result-parameter</p></th>
  426. <th class="head"><p>information</p></th>
  427. </tr>
  428. </thead>
  429. <tbody>
  430. <tr class="row-even"><td><p>url</p></td>
  431. <td><p>string, url of the result</p></td>
  432. </tr>
  433. <tr class="row-odd"><td><p>title</p></td>
  434. <td><p>string, title of the result</p></td>
  435. </tr>
  436. <tr class="row-even"><td><p>content</p></td>
  437. <td><p>string, general result-text</p></td>
  438. </tr>
  439. <tr class="row-odd"><td><p>publishedDate</p></td>
  440. <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>
  441. </tr>
  442. </tbody>
  443. </table>
  444. </section>
  445. <section id="images">
  446. <h3><a class="toc-backref" href="#id16" role="doc-backlink">images</a><a class="headerlink" href="#images" title="Permalink to this heading">¶</a></h3>
  447. <p>To use this template, the parameter:</p>
  448. <table class="docutils align-default">
  449. <thead>
  450. <tr class="row-odd"><th class="head"><p>result-parameter</p></th>
  451. <th class="head"><p>information</p></th>
  452. </tr>
  453. </thead>
  454. <tbody>
  455. <tr class="row-even"><td><p>template</p></td>
  456. <td><p>is set to <code class="docutils literal notranslate"><span class="pre">images.html</span></code></p></td>
  457. </tr>
  458. <tr class="row-odd"><td><p>url</p></td>
  459. <td><p>string, url to the result site</p></td>
  460. </tr>
  461. <tr class="row-even"><td><p>title</p></td>
  462. <td><p>string, title of the result <em>(partly implemented)</em></p></td>
  463. </tr>
  464. <tr class="row-odd"><td><p>content</p></td>
  465. <td><p><em>(partly implemented)</em></p></td>
  466. </tr>
  467. <tr class="row-even"><td><p>publishedDate</p></td>
  468. <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>,
  469. time of publish <em>(partly implemented)</em></p></td>
  470. </tr>
  471. <tr class="row-odd"><td><p>img_src</p></td>
  472. <td><p>string, url to the result image</p></td>
  473. </tr>
  474. <tr class="row-even"><td><p>thumbnail_src</p></td>
  475. <td><p>string, url to a small-preview image</p></td>
  476. </tr>
  477. </tbody>
  478. </table>
  479. </section>
  480. <section id="videos">
  481. <h3><a class="toc-backref" href="#id17" role="doc-backlink">videos</a><a class="headerlink" href="#videos" title="Permalink to this heading">¶</a></h3>
  482. <table class="docutils align-default">
  483. <thead>
  484. <tr class="row-odd"><th class="head"><p>result-parameter</p></th>
  485. <th class="head"><p>information</p></th>
  486. </tr>
  487. </thead>
  488. <tbody>
  489. <tr class="row-even"><td><p>template</p></td>
  490. <td><p>is set to <code class="docutils literal notranslate"><span class="pre">videos.html</span></code></p></td>
  491. </tr>
  492. <tr class="row-odd"><td><p>url</p></td>
  493. <td><p>string, url of the result</p></td>
  494. </tr>
  495. <tr class="row-even"><td><p>title</p></td>
  496. <td><p>string, title of the result</p></td>
  497. </tr>
  498. <tr class="row-odd"><td><p>content</p></td>
  499. <td><p><em>(not implemented yet)</em></p></td>
  500. </tr>
  501. <tr class="row-even"><td><p>publishedDate</p></td>
  502. <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>
  503. </tr>
  504. <tr class="row-odd"><td><p>thumbnail</p></td>
  505. <td><p>string, url to a small-preview image</p></td>
  506. </tr>
  507. </tbody>
  508. </table>
  509. </section>
  510. <section id="torrent">
  511. <h3><a class="toc-backref" href="#id18" role="doc-backlink">torrent</a><a class="headerlink" href="#torrent" title="Permalink to this heading">¶</a></h3>
  512. <table class="docutils align-default">
  513. <thead>
  514. <tr class="row-odd"><th class="head"><p>result-parameter</p></th>
  515. <th class="head"><p>information</p></th>
  516. </tr>
  517. </thead>
  518. <tbody>
  519. <tr class="row-even"><td><p>template</p></td>
  520. <td><p>is set to <code class="docutils literal notranslate"><span class="pre">torrent.html</span></code></p></td>
  521. </tr>
  522. <tr class="row-odd"><td><p>url</p></td>
  523. <td><p>string, url of the result</p></td>
  524. </tr>
  525. <tr class="row-even"><td><p>title</p></td>
  526. <td><p>string, title of the result</p></td>
  527. </tr>
  528. <tr class="row-odd"><td><p>content</p></td>
  529. <td><p>string, general result-text</p></td>
  530. </tr>
  531. <tr class="row-even"><td><p>publishedDate</p></td>
  532. <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>,
  533. time of publish <em>(not implemented yet)</em></p></td>
  534. </tr>
  535. <tr class="row-odd"><td><p>seed</p></td>
  536. <td><p>int, number of seeder</p></td>
  537. </tr>
  538. <tr class="row-even"><td><p>leech</p></td>
  539. <td><p>int, number of leecher</p></td>
  540. </tr>
  541. <tr class="row-odd"><td><p>filesize</p></td>
  542. <td><p>int, size of file in bytes</p></td>
  543. </tr>
  544. <tr class="row-even"><td><p>files</p></td>
  545. <td><p>int, number of files</p></td>
  546. </tr>
  547. <tr class="row-odd"><td><p>magnetlink</p></td>
  548. <td><p>string, <a class="reference external" href="https://en.wikipedia.org/wiki/Magnet_URI_scheme">magnetlink</a> of the result</p></td>
  549. </tr>
  550. <tr class="row-even"><td><p>torrentfile</p></td>
  551. <td><p>string, torrentfile of the result</p></td>
  552. </tr>
  553. </tbody>
  554. </table>
  555. </section>
  556. <section id="map">
  557. <h3><a class="toc-backref" href="#id19" role="doc-backlink">map</a><a class="headerlink" href="#map" title="Permalink to this heading">¶</a></h3>
  558. <table class="docutils align-default">
  559. <thead>
  560. <tr class="row-odd"><th class="head"><p>result-parameter</p></th>
  561. <th class="head"><p>information</p></th>
  562. </tr>
  563. </thead>
  564. <tbody>
  565. <tr class="row-even"><td><p>url</p></td>
  566. <td><p>string, url of the result</p></td>
  567. </tr>
  568. <tr class="row-odd"><td><p>title</p></td>
  569. <td><p>string, title of the result</p></td>
  570. </tr>
  571. <tr class="row-even"><td><p>content</p></td>
  572. <td><p>string, general result-text</p></td>
  573. </tr>
  574. <tr class="row-odd"><td><p>publishedDate</p></td>
  575. <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>
  576. </tr>
  577. <tr class="row-even"><td><p>latitude</p></td>
  578. <td><p>latitude of result (in decimal format)</p></td>
  579. </tr>
  580. <tr class="row-odd"><td><p>longitude</p></td>
  581. <td><p>longitude of result (in decimal format)</p></td>
  582. </tr>
  583. <tr class="row-even"><td><p>boundingbox</p></td>
  584. <td><p>boundingbox of result (array of 4. values
  585. <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>
  586. </tr>
  587. <tr class="row-odd"><td><p>geojson</p></td>
  588. <td><p>geojson of result (<a class="reference external" href="https://geojson.org/">https://geojson.org/</a>)</p></td>
  589. </tr>
  590. <tr class="row-even"><td><p>osm.type</p></td>
  591. <td><p>type of osm-object (if OSM-Result)</p></td>
  592. </tr>
  593. <tr class="row-odd"><td><p>osm.id</p></td>
  594. <td><p>id of osm-object (if OSM-Result)</p></td>
  595. </tr>
  596. <tr class="row-even"><td><p>address.name</p></td>
  597. <td><p>name of object</p></td>
  598. </tr>
  599. <tr class="row-odd"><td><p>address.road</p></td>
  600. <td><p>street name of object</p></td>
  601. </tr>
  602. <tr class="row-even"><td><p>address.house_number</p></td>
  603. <td><p>house number of object</p></td>
  604. </tr>
  605. <tr class="row-odd"><td><p>address.locality</p></td>
  606. <td><p>city, place of object</p></td>
  607. </tr>
  608. <tr class="row-even"><td><p>address.postcode</p></td>
  609. <td><p>postcode of object</p></td>
  610. </tr>
  611. <tr class="row-odd"><td><p>address.country</p></td>
  612. <td><p>country of object</p></td>
  613. </tr>
  614. </tbody>
  615. </table>
  616. </section>
  617. </section>
  618. </section>
  619. <div class="clearer"></div>
  620. </div>
  621. </div>
  622. </div>
  623. <span id="sidebar-top"></span>
  624. <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
  625. <div class="sphinxsidebarwrapper">
  626. <p class="logo"><a href="../index.html">
  627. <img class="logo" src="../_static/searx_logo_small.png" alt="Logo"/>
  628. </a></p>
  629. <h3>Project Links</h3>
  630. <ul>
  631. <li><a href="https://searx.github.io/searx/blog/index.html">Blog</a>
  632. <li><a href="https://github.com/searx/searx">Source</a>
  633. <li><a href="https://github.com/searx/searx/wiki">Wiki</a>
  634. <li><a href="https://twitter.com/Searx_engine">Twitter</a>
  635. <li><a href="https://github.com/searx/searx/issues">Issue Tracker</a>
  636. </ul><h3>Navigation</h3>
  637. <ul>
  638. <li><a href="../index.html">Overview</a>
  639. <ul>
  640. <li><a href="index.html">Developer documentation</a>
  641. <ul>
  642. <li>Previous: <a href="contribution_guide.html" title="previous chapter">How to contribute</a>
  643. <li>Next: <a href="search_api.html" title="next chapter">Search API</a></ul>
  644. </li>
  645. </ul>
  646. </li>
  647. </ul>
  648. <div id="searchbox" style="display: none" role="search">
  649. <h3 id="searchlabel">Quick search</h3>
  650. <div class="searchformwrapper">
  651. <form class="search" action="../search.html" method="get">
  652. <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
  653. <input type="submit" value="Go" />
  654. </form>
  655. </div>
  656. </div>
  657. <script>document.getElementById('searchbox').style.display = "block"</script>
  658. </div>
  659. </div>
  660. <div class="clearer"></div>
  661. </div>
  662. <div class="footer" role="contentinfo">
  663. &#169; Copyright 2015-2022, Adam Tauber, Noémi Ványi.
  664. Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 5.3.0.
  665. </div>
  666. <script src="../_static/version_warning_offset.js"></script>
  667. </body>
  668. </html>