better API docs && more features in list

This commit is contained in:
Noemi Vanyi 2016-07-09 22:31:21 +02:00
parent 9f7cb4359c
commit 2ad8715b32
4 changed files with 123 additions and 29 deletions

78
docs/admin/api.rst Normal file
View file

@ -0,0 +1,78 @@
.. _adminapi:
Administration API
------------------
Get configuration data
~~~~~~~~~~~~~~~~~~~~~~
.. code:: sh
GET /config
Sample response
```````````````
.. code:: sh
{
"autocomplete": "",
"categories": [
"map",
"it",
"images",
],
"default_locale": "",
"default_theme": "oscar",
"engines": [
{
"categories": [
"map"
],
"enabled": true,
"name": "openstreetmap",
"shortcut": "osm"
},
{
"categories": [
"it"
],
"enabled": true,
"name": "arch linux wiki",
"shortcut": "al"
},
{
"categories": [
"images"
],
"enabled": true,
"name": "google images",
"shortcut": "goi"
},
{
"categories": [
"it"
],
"enabled": false,
"name": "bitbucket",
"shortcut": "bb"
},
],
"instance_name": "searx",
"locales": {
"de": "Deutsch (German)",
"en": "English",
"eo": "Esperanto (Esperanto)",
},
"plugins": [
{
"enabled": true,
"name": "HTTPS rewrite"
},
{
"enabled": false,
"name": "Vim-like hotkeys"
}
],
"safe_search": 0
}

View file

@ -1,11 +1,11 @@
Plugins Plugins
------- -------
Plugins can extend/replace functionality of various components inside Plugins can extend or replace functionality of various components of
searx. searx.
example\_plugin.py Example plugin
~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~
.. code:: python .. code:: python
@ -24,22 +24,22 @@ example\_plugin.py
ctx['search'].suggestions.add('example') ctx['search'].suggestions.add('example')
return True return True
Currently implemented plugin entry points (a.k.a hooks) Plugin entry points
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
- Pre search hook (``pre_search``) 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.
- Post search hook (``post_search``)
- Result hook (``on_result``) (is called if a new result is added (see
https\_rewrite plugin))
Feel free to add more hooks to the code if it is required by a plugin. Pre search hook
```````````````
TODO Runs BEFORE the search request. Function to implement: ``pre_search``
~~~~
- Better documentation Post search hook
- More hooks ````````````````
- search hook (is called while searx is requesting results (for
example: things like math-solver), the different hooks are running
parallel)
Runs AFTER the search request. Function to implement: ``post_search``
Result hook
```````````
Runs when a new result is added to the result list. Function to implement: ``on_result``

View file

@ -1,13 +1,20 @@
Search API Search API
========== ==========
Search API endpoints: ``/``, ``/search`` 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.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Endpoints have equivalent functionality. Furthermore, two enpoints ``/`` and ``/search`` are available for querying.
.. code:: sh
GET /
.. code:: sh
GET /search
Parameters Parameters
^^^^^^^^^^ ``````````
+------------------+----------------------------------------------------------------------------------------------------+-----------------------------+ +------------------+----------------------------------------------------------------------------------------------------+-----------------------------+
| Name | Description | | | Name | Description | |
@ -18,7 +25,7 @@ Parameters
+------------------+----------------------------------------------------------------------------------------------------+-----------------------------+ +------------------+----------------------------------------------------------------------------------------------------+-----------------------------+
| ``engines`` | Comma separated list, specifies the active search engines | 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``) | | ``pageno`` | Search page number | optional (default: ``1``) |
+------------------+----------------------------------------------------------------------------------------------------+-----------------------------+ +------------------+----------------------------------------------------------------------------------------------------+-----------------------------+
Both ``GET`` and ``POST`` methods are supported.

View file

@ -1,7 +1,7 @@
Privacy-respecting free metasearch engine Welcome to searx
========================================= ================
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. 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.
Features Features
@ -15,16 +15,26 @@ Features
- Does not collect its users data - Does not collect its users data
- Offers secure, encrypted connections (HTTPS/SSL) - Offers secure, encrypted connections (HTTPS/SSL)
- Hosted by organisations, such as La Quadrature du Net, which promote digital rights - Hosted by organisations, such as La Quadrature du Net, which promote digital rights
- About 70 supported search engines
- Easy intergration with any search engine
Further reading User documentation
--------------- ------------------
.. toctree:: .. toctree::
:maxdepth: 1 :maxdepth: 1
user/search_syntax user/search_syntax
Administrator documentation
---------------------------
.. toctree::
:maxdepth: 1
dev/install/installation
admin/api
Developer documentation Developer documentation
----------------------- -----------------------
@ -34,7 +44,6 @@ Developer documentation
dev/quickstart dev/quickstart
dev/contribution_guide dev/contribution_guide
dev/install/installation
dev/engine_overview dev/engine_overview
dev/search_api dev/search_api
dev/plugins dev/plugins