on master help sign in
Merge pull request #679 from kvch/gh-pages

docs: time_range search param, embed

commite3f5fcb14c929f65840de2cf25f966f638556be9 authorAdam Tauber <asciimoo@gmail.com> dateSat 10 Sep 2016, 15:21 (10 years ago) parent9beaeaee2ce068
6 files changed+88−34
_sources/admin/api.txt+16 _sources/dev/search_api.txt+16−14 admin/api.html+14 dev/search_api.html+10−6 docs/admin/api.rst+16 docs/dev/search_api.rst+16−14
_sources/admin/api.txt+16
@@ -76,3 +76,19 @@ Sample response
7676 ],
7777 "safe_search": 0
7878 }
79+
80+Embed search bar
81+----------------
82+
83+The search bar can be embedded into websites. Just paste the example into the HTML of the site.
84+URL of the searx instance and values are customizable.
85+
86+.. code:: html
87+
88+ <form method="post" action="https://searx.me/">
89+ <!-- search query --> <input type="text" name="q" />
90+ <!-- categories --> <input type="hidden" name="categories" value="general,social media" />
91+ <!-- language --> <input type="hidden" name="lang" value="all" />
92+ <!-- locale --> <input type="hidden" name="locale" value="en" />
93+ <!-- date filter --> <input type="hidden" name="time_range" value="month" />
94+ </form>
_sources/dev/search_api.txt+16−14
@@ -1,7 +1,7 @@
11Search API
22==========
33
4−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.
4+The search supports both ``GET`` and ``POST``.
55
66Furthermore, two enpoints ``/`` and ``/search`` are available for querying.
77
@@ -16,16 +16,18 @@ Furthermore, two enpoints ``/`` and ``/search`` are available for querying.
1616Parameters
1717``````````
1818
19−+------------------+----------------------------------------------------------------------------------------------------+-----------------------------+
20−| Name | Description | |
21−+==================+====================================================================================================+=============================+
22−| ``q`` | The search query, see :doc:`/user/search_syntax` | required |
23−+------------------+----------------------------------------------------------------------------------------------------+-----------------------------+
24−| ``categories`` | Comma separated list, specifies the active search categories | optional |
25−+------------------+----------------------------------------------------------------------------------------------------+-----------------------------+
26−| ``engines`` | Comma separated list, specifies the active search engines | optional |
27−+------------------+----------------------------------------------------------------------------------------------------+-----------------------------+
28−| ``lang`` | Code of the language | optional (default: ``all``) |
29−+------------------+----------------------------------------------------------------------------------------------------+-----------------------------+
30−| ``pageno`` | Search page number | optional (default: ``1``) |
31−+------------------+----------------------------------------------------------------------------------------------------+-----------------------------+
19++------------------+----------------------------------------------------------------------------------------------------+--------------------------------------------------+
20+| Name | Description | |
21++==================+====================================================================================================+==================================================+
22+| ``q`` | The search query, see :doc:`/user/search_syntax` | required |
23++------------------+----------------------------------------------------------------------------------------------------+--------------------------------------------------+
24+| ``categories`` | Comma separated list, specifies the active search categories | optional |
25++------------------+----------------------------------------------------------------------------------------------------+--------------------------------------------------+
26+| ``engines`` | Comma separated list, specifies the active search engines | optional |
27++------------------+----------------------------------------------------------------------------------------------------+--------------------------------------------------+
28+| ``lang`` | Code of the language | optional (default: ``all``) |
29++------------------+----------------------------------------------------------------------------------------------------+--------------------------------------------------+
30+| ``pageno`` | Search page number | optional (default: ``1``) |
31++------------------+----------------------------------------------------------------------------------------------------+--------------------------------------------------+
32+| ``time_range`` | Time range of search | optional (possible: ``day``, ``month``, ``year``)|
33++------------------+----------------------------------------------------------------------------------------------------+--------------------------------------------------+
admin/api.html+14
@@ -113,6 +113,20 @@
113113</div>
114114</div>
115115</div>
116+</div>
117+<div class="section" id="embed-search-bar">
118+<h1>Embed search bar<a class="headerlink" href="#embed-search-bar" title="Permalink to this headline">¶</a></h1>
119+<p>The search bar can be embedded into websites. Just paste the example into the HTML of the site.
120+URL of the searx instance and values are customizable.</p>
121+<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;
122+ &lt;!-- search query --&gt; &lt;input type=&quot;text&quot; name=&quot;q&quot; /&gt;
123+ &lt;!-- categories --&gt; &lt;input type=&quot;hidden&quot; name=&quot;categories&quot; value=&quot;general,social media&quot; /&gt;
124+ &lt;!-- language --&gt; &lt;input type=&quot;hidden&quot; name=&quot;lang&quot; value=&quot;all&quot; /&gt;
125+ &lt;!-- locale --&gt; &lt;input type=&quot;hidden&quot; name=&quot;locale&quot; value=&quot;en&quot; /&gt;
126+ &lt;!-- date filter --&gt; &lt;input type=&quot;hidden&quot; name=&quot;time_range&quot; value=&quot;month&quot; /&gt;
127+&lt;/form&gt;
128+</pre></div>
129+</div>
116130</div>
117131
118132
dev/search_api.html+10−6
@@ -41,21 +41,21 @@
4141
4242 <div class="section" id="search-api">
4343<h1>Search API<a class="headerlink" href="#search-api" title="Permalink to this headline">¶</a></h1>
44−<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>
44+<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>
4545<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>
46−<div class="code sh highlight-default"><div class="highlight"><pre><span class="n">GET</span> <span class="o">/</span>
46+<div class="code sh highlight-default"><div class="highlight"><pre><span></span><span class="n">GET</span> <span class="o">/</span>
4747</pre></div>
4848</div>
49−<div class="code sh highlight-default"><div class="highlight"><pre><span class="n">GET</span> <span class="o">/</span><span class="n">search</span>
49+<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>
5050</pre></div>
5151</div>
5252<div class="section" id="parameters">
5353<h2>Parameters<a class="headerlink" href="#parameters" title="Permalink to this headline">¶</a></h2>
5454<table border="1" class="docutils">
5555<colgroup>
56−<col width="12%" />
57−<col width="68%" />
58−<col width="20%" />
56+<col width="11%" />
57+<col width="60%" />
58+<col width="30%" />
5959</colgroup>
6060<thead valign="bottom">
6161<tr class="row-odd"><th class="head">Name</th>
@@ -84,6 +84,10 @@
8484<td>Search page number</td>
8585<td>optional (default: <code class="docutils literal"><span class="pre">1</span></code>)</td>
8686</tr>
87+<tr class="row-odd"><td><code class="docutils literal"><span class="pre">time_range</span></code></td>
88+<td>Time range of search</td>
89+<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>
90+</tr>
8791</tbody>
8892</table>
8993</div>
docs/admin/api.rst+16
@@ -76,3 +76,19 @@ Sample response
7676 ],
7777 "safe_search": 0
7878 }
79+
80+Embed search bar
81+----------------
82+
83+The search bar can be embedded into websites. Just paste the example into the HTML of the site.
84+URL of the searx instance and values are customizable.
85+
86+.. code:: html
87+
88+ <form method="post" action="https://searx.me/">
89+ <!-- search query --> <input type="text" name="q" />
90+ <!-- categories --> <input type="hidden" name="categories" value="general,social media" />
91+ <!-- language --> <input type="hidden" name="lang" value="all" />
92+ <!-- locale --> <input type="hidden" name="locale" value="en" />
93+ <!-- date filter --> <input type="hidden" name="time_range" value="month" />
94+ </form>
docs/dev/search_api.rst+16−14
@@ -1,7 +1,7 @@
11Search API
22==========
33
4−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.
4+The search supports both ``GET`` and ``POST``.
55
66Furthermore, two enpoints ``/`` and ``/search`` are available for querying.
77
@@ -16,16 +16,18 @@ Furthermore, two enpoints ``/`` and ``/search`` are available for querying.
1616Parameters
1717``````````
1818
19−+------------------+----------------------------------------------------------------------------------------------------+-----------------------------+
20−| Name | Description | |
21−+==================+====================================================================================================+=============================+
22−| ``q`` | The search query, see :doc:`/user/search_syntax` | required |
23−+------------------+----------------------------------------------------------------------------------------------------+-----------------------------+
24−| ``categories`` | Comma separated list, specifies the active search categories | optional |
25−+------------------+----------------------------------------------------------------------------------------------------+-----------------------------+
26−| ``engines`` | Comma separated list, specifies the active search engines | optional |
27−+------------------+----------------------------------------------------------------------------------------------------+-----------------------------+
28−| ``lang`` | Code of the language | optional (default: ``all``) |
29−+------------------+----------------------------------------------------------------------------------------------------+-----------------------------+
30−| ``pageno`` | Search page number | optional (default: ``1``) |
31−+------------------+----------------------------------------------------------------------------------------------------+-----------------------------+
19++------------------+----------------------------------------------------------------------------------------------------+--------------------------------------------------+
20+| Name | Description | |
21++==================+====================================================================================================+==================================================+
22+| ``q`` | The search query, see :doc:`/user/search_syntax` | required |
23++------------------+----------------------------------------------------------------------------------------------------+--------------------------------------------------+
24+| ``categories`` | Comma separated list, specifies the active search categories | optional |
25++------------------+----------------------------------------------------------------------------------------------------+--------------------------------------------------+
26+| ``engines`` | Comma separated list, specifies the active search engines | optional |
27++------------------+----------------------------------------------------------------------------------------------------+--------------------------------------------------+
28+| ``lang`` | Code of the language | optional (default: ``all``) |
29++------------------+----------------------------------------------------------------------------------------------------+--------------------------------------------------+
30+| ``pageno`` | Search page number | optional (default: ``1``) |
31++------------------+----------------------------------------------------------------------------------------------------+--------------------------------------------------+
32+| ``time_range`` | Time range of search | optional (possible: ``day``, ``month``, ``year``)|
33++------------------+----------------------------------------------------------------------------------------------------+--------------------------------------------------+