on master help sign in
better API docs && more features in list
commit2ad8715b3282557d39da21721487ff85683b1219 authorNoemi Vanyi <sitbackandwait@gmail.com> dateSat 9 Jul 2016, 22:31 (10 years ago) parent9f7cb43
4 files changed+123−29
docs/admin/api.rst+78 docs/dev/plugins.rst+17−17 docs/dev/search_api.rst+13−6 docs/index.rst+15−6
docs/admin/api.rstnew file+78
@@ -0,0 +1,78 @@
1+.. _adminapi:
2+
3+Administration API
4+------------------
5+
6+Get configuration data
7+~~~~~~~~~~~~~~~~~~~~~~
8+
9+.. code:: sh
10+
11+ GET /config
12+
13+Sample response
14+```````````````
15+
16+.. code:: sh
17+
18+ {
19+ "autocomplete": "",
20+ "categories": [
21+ "map",
22+ "it",
23+ "images",
24+ ],
25+ "default_locale": "",
26+ "default_theme": "oscar",
27+ "engines": [
28+ {
29+ "categories": [
30+ "map"
31+ ],
32+ "enabled": true,
33+ "name": "openstreetmap",
34+ "shortcut": "osm"
35+ },
36+ {
37+ "categories": [
38+ "it"
39+ ],
40+ "enabled": true,
41+ "name": "arch linux wiki",
42+ "shortcut": "al"
43+ },
44+ {
45+ "categories": [
46+ "images"
47+ ],
48+ "enabled": true,
49+ "name": "google images",
50+ "shortcut": "goi"
51+ },
52+ {
53+ "categories": [
54+ "it"
55+ ],
56+ "enabled": false,
57+ "name": "bitbucket",
58+ "shortcut": "bb"
59+ },
60+ ],
61+ "instance_name": "searx",
62+ "locales": {
63+ "de": "Deutsch (German)",
64+ "en": "English",
65+ "eo": "Esperanto (Esperanto)",
66+ },
67+ "plugins": [
68+ {
69+ "enabled": true,
70+ "name": "HTTPS rewrite"
71+ },
72+ {
73+ "enabled": false,
74+ "name": "Vim-like hotkeys"
75+ }
76+ ],
77+ "safe_search": 0
78+ }
docs/dev/plugins.rst+17−17
@@ -1,11 +1,11 @@
11Plugins
22-------
33
4−Plugins can extend/replace functionality of various components inside
4+Plugins can extend or replace functionality of various components of
55searx.
66
7−example\_plugin.py
8−~~~~~~~~~~~~~~~~~~
7+Example plugin
8+~~~~~~~~~~~~~~
99
1010.. code:: python
1111
@@ -24,22 +24,22 @@ example\_plugin.py
2424 ctx['search'].suggestions.add('example')
2525 return True
2626
27−Currently implemented plugin entry points (a.k.a hooks)
28−~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
27+Plugin entry points
28+~~~~~~~~~~~~~~~~~~~
2929
30−- Pre search hook (``pre_search``)
31−- Post search hook (``post_search``)
32−- Result hook (``on_result``) (is called if a new result is added (see
33− https\_rewrite plugin))
30+Entry points (hooks) define when a plugin runs. Right now only three hooks are implemented. So feel free to implement a hook if it fits the behaviour of your plugin.
3431
35−Feel free to add more hooks to the code if it is required by a plugin.
32+Pre search hook
33+```````````````
3634
37−TODO
38−~~~~
35+Runs BEFORE the search request. Function to implement: ``pre_search``
3936
40−- Better documentation
41−- More hooks
42−- search hook (is called while searx is requesting results (for
43− example: things like math-solver), the different hooks are running
44− parallel)
37+Post search hook
38+````````````````
4539
40+Runs AFTER the search request. Function to implement: ``post_search``
41+
42+Result hook
43+```````````
44+
45+Runs when a new result is added to the result list. Function to implement: ``on_result``
docs/dev/search_api.rst+13−6
@@ -1,13 +1,20 @@
11Search API
22==========
33
4−Search API endpoints: ``/``, ``/search``
5−^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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.
65
7−Endpoints have equivalent functionality.
6+Furthermore, two enpoints ``/`` and ``/search`` are available for querying.
7+
8+.. code:: sh
9+
10+ GET /
11+
12+.. code:: sh
13+
14+ GET /search
815
916Parameters
10−^^^^^^^^^^
17+``````````
1118
1219+------------------+----------------------------------------------------------------------------------------------------+-----------------------------+
1320| Name | Description | |
@@ -18,7 +25,7 @@ Parameters
1825+------------------+----------------------------------------------------------------------------------------------------+-----------------------------+
1926| ``engines`` | Comma separated list, specifies the active search engines | optional |
2027+------------------+----------------------------------------------------------------------------------------------------+-----------------------------+
28+| ``lang`` | Code of the language | optional (default: ``all``) |
29++------------------+----------------------------------------------------------------------------------------------------+-----------------------------+
2130| ``pageno`` | Search page number | optional (default: ``1``) |
2231+------------------+----------------------------------------------------------------------------------------------------+-----------------------------+
23−
24−Both ``GET`` and ``POST`` methods are supported.
docs/index.rst+15−6
@@ -1,7 +1,7 @@
1−Privacy-respecting free metasearch engine
2−=========================================
1+Welcome to searx
2+================
33
4−Searx is a free software internet metasearch engine which aggregates results from other search engines, while not storing information about its users. Searx does not track or profile its users, nor does it share its users' data with third parties. Additionally, searx can be used over Tor for online anonymity.
4+Searx is a free software internet metasearch engine which aggregates results from more than 70 engines, while not storing information about its users. Searx does not track or profile its users, nor does it share its users' data with third parties. Additionally, searx can be used over Tor for online anonymity.
55
66
77Features
@@ -15,16 +15,26 @@ Features
1515 - Does not collect its users data
1616 - Offers secure, encrypted connections (HTTPS/SSL)
1717 - Hosted by organisations, such as La Quadrature du Net, which promote digital rights
18+ - About 70 supported search engines
19+ - Easy intergration with any search engine
1820
1921
20−Further reading
21−---------------
22+User documentation
23+------------------
2224
2325.. toctree::
2426 :maxdepth: 1
2527
2628 user/search_syntax
2729
30+Administrator documentation
31+---------------------------
32+
33+.. toctree::
34+ :maxdepth: 1
35+
36+ dev/install/installation
37+ admin/api
2838
2939Developer documentation
3040-----------------------
@@ -34,7 +44,6 @@ Developer documentation
3444
3545 dev/quickstart
3646 dev/contribution_guide
37− dev/install/installation
3847 dev/engine_overview
3948 dev/search_api
4049 dev/plugins