Преглед изворни кода

Merge pull request #679 from kvch/gh-pages

docs: time_range search param, embed
Adam Tauber пре 8 година
родитељ
комит
e3f5fcb14c
6 измењених фајлова са 88 додато и 34 уклоњено
  1. 16
    0
      _sources/admin/api.txt
  2. 16
    14
      _sources/dev/search_api.txt
  3. 14
    0
      admin/api.html
  4. 10
    6
      dev/search_api.html
  5. 16
    0
      docs/admin/api.rst
  6. 16
    14
      docs/dev/search_api.rst

+ 16
- 0
_sources/admin/api.txt Прегледај датотеку

@@ -76,3 +76,19 @@ Sample response
76 76
       ], 
77 77
       "safe_search": 0
78 78
     }
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>

+ 16
- 14
_sources/dev/search_api.txt Прегледај датотеку

@@ -1,7 +1,7 @@
1 1
 Search API
2 2
 ==========
3 3
 
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``.
5 5
 
6 6
 Furthermore, two enpoints ``/`` and ``/search`` are available for querying.
7 7
 
@@ -16,16 +16,18 @@ Furthermore, two enpoints ``/`` and ``/search`` are available for querying.
16 16
 Parameters
17 17
 ``````````
18 18
 
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
++------------------+----------------------------------------------------------------------------------------------------+--------------------------------------------------+

+ 14
- 0
admin/api.html Прегледај датотеку

@@ -114,6 +114,20 @@
114 114
 </div>
115 115
 </div>
116 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>
130
+</div>
117 131
 
118 132
 
119 133
           </div>

+ 10
- 6
dev/search_api.html Прегледај датотеку

@@ -41,21 +41,21 @@
41 41
             
42 42
   <div class="section" id="search-api">
43 43
 <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>
45 45
 <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>
47 47
 </pre></div>
48 48
 </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>
50 50
 </pre></div>
51 51
 </div>
52 52
 <div class="section" id="parameters">
53 53
 <h2>Parameters<a class="headerlink" href="#parameters" title="Permalink to this headline">¶</a></h2>
54 54
 <table border="1" class="docutils">
55 55
 <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%" />
59 59
 </colgroup>
60 60
 <thead valign="bottom">
61 61
 <tr class="row-odd"><th class="head">Name</th>
@@ -84,6 +84,10 @@
84 84
 <td>Search page number</td>
85 85
 <td>optional (default: <code class="docutils literal"><span class="pre">1</span></code>)</td>
86 86
 </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>
87 91
 </tbody>
88 92
 </table>
89 93
 </div>

+ 16
- 0
docs/admin/api.rst Прегледај датотеку

@@ -76,3 +76,19 @@ Sample response
76 76
       ], 
77 77
       "safe_search": 0
78 78
     }
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>

+ 16
- 14
docs/dev/search_api.rst Прегледај датотеку

@@ -1,7 +1,7 @@
1 1
 Search API
2 2
 ==========
3 3
 
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``.
5 5
 
6 6
 Furthermore, two enpoints ``/`` and ``/search`` are available for querying.
7 7
 
@@ -16,16 +16,18 @@ Furthermore, two enpoints ``/`` and ``/search`` are available for querying.
16 16
 Parameters
17 17
 ``````````
18 18
 
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
++------------------+----------------------------------------------------------------------------------------------------+--------------------------------------------------+