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

docs: time_range search param, embed

commit34039ab85f31a72ff087b607a774c04272dfceb9 authorAdam Tauber <asciimoo@gmail.com> dateSat 10 Sep 2016, 15:21 (10 years ago) parentb60dd8b93052da
2 files changed+32−14
docs/admin/api.rst+16 docs/dev/search_api.rst+16−14
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++------------------+----------------------------------------------------------------------------------------------------+--------------------------------------------------+