Merge pull request #679 from kvch/gh-pages

docs: time_range search param, embed
This commit is contained in:
Adam Tauber 2016-09-10 15:21:58 +02:00 committed by GitHub
commit e3f5fcb14c
6 changed files with 88 additions and 34 deletions

View File

@ -76,3 +76,19 @@ Sample response
],
"safe_search": 0
}
Embed search bar
----------------
The search bar can be embedded into websites. Just paste the example into the HTML of the site.
URL of the searx instance and values are customizable.
.. code:: html
<form method="post" action="https://searx.me/">
<!-- search query --> <input type="text" name="q" />
<!-- categories --> <input type="hidden" name="categories" value="general,social media" />
<!-- language --> <input type="hidden" name="lang" value="all" />
<!-- locale --> <input type="hidden" name="locale" value="en" />
<!-- date filter --> <input type="hidden" name="time_range" value="month" />
</form>

View File

@ -1,7 +1,7 @@
Search API
==========
The search supports both ``GET`` and ``POST``. However, using ``GET`` the parameters of the request remain hidden. So it is advised to use ``GET`` for querying.
The search supports both ``GET`` and ``POST``.
Furthermore, two enpoints ``/`` and ``/search`` are available for querying.
@ -16,16 +16,18 @@ Furthermore, two enpoints ``/`` and ``/search`` are available for querying.
Parameters
``````````
+------------------+----------------------------------------------------------------------------------------------------+-----------------------------+
| Name | Description | |
+==================+====================================================================================================+=============================+
| ``q`` | The search query, see :doc:`/user/search_syntax` | required |
+------------------+----------------------------------------------------------------------------------------------------+-----------------------------+
| ``categories`` | Comma separated list, specifies the active search categories | optional |
+------------------+----------------------------------------------------------------------------------------------------+-----------------------------+
| ``engines`` | Comma separated list, specifies the active search engines | optional |
+------------------+----------------------------------------------------------------------------------------------------+-----------------------------+
| ``lang`` | Code of the language | optional (default: ``all``) |
+------------------+----------------------------------------------------------------------------------------------------+-----------------------------+
| ``pageno`` | Search page number | optional (default: ``1``) |
+------------------+----------------------------------------------------------------------------------------------------+-----------------------------+
+------------------+----------------------------------------------------------------------------------------------------+--------------------------------------------------+
| Name | Description | |
+==================+====================================================================================================+==================================================+
| ``q`` | The search query, see :doc:`/user/search_syntax` | required |
+------------------+----------------------------------------------------------------------------------------------------+--------------------------------------------------+
| ``categories`` | Comma separated list, specifies the active search categories | optional |
+------------------+----------------------------------------------------------------------------------------------------+--------------------------------------------------+
| ``engines`` | Comma separated list, specifies the active search engines | optional |
+------------------+----------------------------------------------------------------------------------------------------+--------------------------------------------------+
| ``lang`` | Code of the language | optional (default: ``all``) |
+------------------+----------------------------------------------------------------------------------------------------+--------------------------------------------------+
| ``pageno`` | Search page number | optional (default: ``1``) |
+------------------+----------------------------------------------------------------------------------------------------+--------------------------------------------------+
| ``time_range`` | Time range of search | optional (possible: ``day``, ``month``, ``year``)|
+------------------+----------------------------------------------------------------------------------------------------+--------------------------------------------------+

View File

@ -113,6 +113,20 @@
</div>
</div>
</div>
</div>
<div class="section" id="embed-search-bar">
<h1>Embed search bar<a class="headerlink" href="#embed-search-bar" title="Permalink to this headline"></a></h1>
<p>The search bar can be embedded into websites. Just paste the example into the HTML of the site.
URL of the searx instance and values are customizable.</p>
<div class="code html highlight-default"><div class="highlight"><pre><span></span>&lt;form method=&quot;post&quot; action=&quot;https://searx.me/&quot;&gt;
&lt;!-- search query --&gt; &lt;input type=&quot;text&quot; name=&quot;q&quot; /&gt;
&lt;!-- categories --&gt; &lt;input type=&quot;hidden&quot; name=&quot;categories&quot; value=&quot;general,social media&quot; /&gt;
&lt;!-- language --&gt; &lt;input type=&quot;hidden&quot; name=&quot;lang&quot; value=&quot;all&quot; /&gt;
&lt;!-- locale --&gt; &lt;input type=&quot;hidden&quot; name=&quot;locale&quot; value=&quot;en&quot; /&gt;
&lt;!-- date filter --&gt; &lt;input type=&quot;hidden&quot; name=&quot;time_range&quot; value=&quot;month&quot; /&gt;
&lt;/form&gt;
</pre></div>
</div>
</div>

View File

@ -41,21 +41,21 @@
<div class="section" id="search-api">
<h1>Search API<a class="headerlink" href="#search-api" title="Permalink to this headline"></a></h1>
<p>The search supports both <code class="docutils literal"><span class="pre">GET</span></code> and <code class="docutils literal"><span class="pre">POST</span></code>. However, using <code class="docutils literal"><span class="pre">GET</span></code> the parameters of the request remain hidden. So it is advised to use <code class="docutils literal"><span class="pre">GET</span></code> for querying.</p>
<p>The search supports both <code class="docutils literal"><span class="pre">GET</span></code> and <code class="docutils literal"><span class="pre">POST</span></code>.</p>
<p>Furthermore, two enpoints <code class="docutils literal"><span class="pre">/</span></code> and <code class="docutils literal"><span class="pre">/search</span></code> are available for querying.</p>
<div class="code sh highlight-default"><div class="highlight"><pre><span class="n">GET</span> <span class="o">/</span>
<div class="code sh highlight-default"><div class="highlight"><pre><span></span><span class="n">GET</span> <span class="o">/</span>
</pre></div>
</div>
<div class="code sh highlight-default"><div class="highlight"><pre><span class="n">GET</span> <span class="o">/</span><span class="n">search</span>
<div class="code sh highlight-default"><div class="highlight"><pre><span></span><span class="n">GET</span> <span class="o">/</span><span class="n">search</span>
</pre></div>
</div>
<div class="section" id="parameters">
<h2>Parameters<a class="headerlink" href="#parameters" title="Permalink to this headline"></a></h2>
<table border="1" class="docutils">
<colgroup>
<col width="12%" />
<col width="68%" />
<col width="20%" />
<col width="11%" />
<col width="60%" />
<col width="30%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Name</th>
@ -84,6 +84,10 @@
<td>Search page number</td>
<td>optional (default: <code class="docutils literal"><span class="pre">1</span></code>)</td>
</tr>
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">time_range</span></code></td>
<td>Time range of search</td>
<td>optional (possible: <code class="docutils literal"><span class="pre">day</span></code>, <code class="docutils literal"><span class="pre">month</span></code>, <code class="docutils literal"><span class="pre">year</span></code>)</td>
</tr>
</tbody>
</table>
</div>

View File

@ -76,3 +76,19 @@ Sample response
],
"safe_search": 0
}
Embed search bar
----------------
The search bar can be embedded into websites. Just paste the example into the HTML of the site.
URL of the searx instance and values are customizable.
.. code:: html
<form method="post" action="https://searx.me/">
<!-- search query --> <input type="text" name="q" />
<!-- categories --> <input type="hidden" name="categories" value="general,social media" />
<!-- language --> <input type="hidden" name="lang" value="all" />
<!-- locale --> <input type="hidden" name="locale" value="en" />
<!-- date filter --> <input type="hidden" name="time_range" value="month" />
</form>

View File

@ -1,7 +1,7 @@
Search API
==========
The search supports both ``GET`` and ``POST``. However, using ``GET`` the parameters of the request remain hidden. So it is advised to use ``GET`` for querying.
The search supports both ``GET`` and ``POST``.
Furthermore, two enpoints ``/`` and ``/search`` are available for querying.
@ -16,16 +16,18 @@ Furthermore, two enpoints ``/`` and ``/search`` are available for querying.
Parameters
``````````
+------------------+----------------------------------------------------------------------------------------------------+-----------------------------+
| Name | Description | |
+==================+====================================================================================================+=============================+
| ``q`` | The search query, see :doc:`/user/search_syntax` | required |
+------------------+----------------------------------------------------------------------------------------------------+-----------------------------+
| ``categories`` | Comma separated list, specifies the active search categories | optional |
+------------------+----------------------------------------------------------------------------------------------------+-----------------------------+
| ``engines`` | Comma separated list, specifies the active search engines | optional |
+------------------+----------------------------------------------------------------------------------------------------+-----------------------------+
| ``lang`` | Code of the language | optional (default: ``all``) |
+------------------+----------------------------------------------------------------------------------------------------+-----------------------------+
| ``pageno`` | Search page number | optional (default: ``1``) |
+------------------+----------------------------------------------------------------------------------------------------+-----------------------------+
+------------------+----------------------------------------------------------------------------------------------------+--------------------------------------------------+
| Name | Description | |
+==================+====================================================================================================+==================================================+
| ``q`` | The search query, see :doc:`/user/search_syntax` | required |
+------------------+----------------------------------------------------------------------------------------------------+--------------------------------------------------+
| ``categories`` | Comma separated list, specifies the active search categories | optional |
+------------------+----------------------------------------------------------------------------------------------------+--------------------------------------------------+
| ``engines`` | Comma separated list, specifies the active search engines | optional |
+------------------+----------------------------------------------------------------------------------------------------+--------------------------------------------------+
| ``lang`` | Code of the language | optional (default: ``all``) |
+------------------+----------------------------------------------------------------------------------------------------+--------------------------------------------------+
| ``pageno`` | Search page number | optional (default: ``1``) |
+------------------+----------------------------------------------------------------------------------------------------+--------------------------------------------------+
| ``time_range`` | Time range of search | optional (possible: ``day``, ``month``, ``year``)|
+------------------+----------------------------------------------------------------------------------------------------+--------------------------------------------------+