.oO SearXNG Developer Documentation Oo.
|
Functions | |
iterate (iterable) | |
is_iterable (obj) | |
parse (query) | |
do_query (data, q) | |
query (data, query_string) | |
request (query, params) | |
identity (arg) | |
extract_response_info (result) | |
response (resp) | |
Variables | |
search_url = None | |
str | lang_all = 'en' |
list | no_result_for_http_status = [] |
int | soft_max_redirects = 0 |
str | method = 'GET' |
str | request_body = '' |
dict | cookies = {} |
dict | headers = {} |
bool | paging = False |
int | page_size = 1 |
int | first_page_num = 1 |
str | results_query = '' |
url_query = None | |
str | url_prefix = "" |
title_query = None | |
content_query = None | |
bool | thumbnail_query = False |
str | thumbnail_prefix = '' |
str | suggestion_query = '' |
bool | title_html_to_text = False |
bool | content_html_to_text = False |
bool | time_range_support = False |
str | time_range_url = '&hours={time_range_val}' |
dict | time_range_map |
bool | safe_search_support = False |
dict | safe_search_map = {0: '&filter=none', 1: '&filter=moderate', 2: '&filter=strict'} |
The JSON engine is a *generic* engine with which it is possible to configure engines in the settings. Configuration ============= Request: - :py:obj:`search_url` - :py:obj:`lang_all` - :py:obj:`soft_max_redirects` - :py:obj:`method` - :py:obj:`request_body` - :py:obj:`cookies` - :py:obj:`headers` Paging: - :py:obj:`paging` - :py:obj:`page_size` - :py:obj:`first_page_num` Time Range: - :py:obj:`time_range_support` - :py:obj:`time_range_url` - :py:obj:`time_range_map` Safe-Search: - :py:obj:`safe_search_support` - :py:obj:`safe_search_map` Response: - :py:obj:`title_html_to_text` - :py:obj:`content_html_to_text` - :py:obj:`no_result_for_http_status` JSON query: - :py:obj:`results_query` - :py:obj:`url_query` - :py:obj:`url_prefix` - :py:obj:`title_query` - :py:obj:`content_query` - :py:obj:`thumbnail_query` - :py:obj:`thumbnail_prefix` - :py:obj:`suggestion_query` Example ======= Here is a simple example of a JSON engine configure in the :ref:`settings engine` section, further read :ref:`engines-dev`. .. code:: yaml - name : mdn engine : json_engine paging : True search_url : https://developer.mozilla.org/api/v1/search?q={query}&page={pageno} results_query : documents url_query : mdn_url url_prefix : https://developer.mozilla.org title_query : title content_query : summary Implementations ===============
searx.engines.json_engine.do_query | ( | data, | |
q ) |
Definition at line 281 of file json_engine.py.
References searx.engines.json_engine.do_query(), searx.engines.json_engine.is_iterable(), and searx.engines.json_engine.iterate().
Referenced by searx.engines.json_engine.do_query(), and searx.engines.json_engine.query().
searx.engines.json_engine.extract_response_info | ( | result | ) |
Definition at line 355 of file json_engine.py.
Referenced by searx.engines.json_engine.response().
searx.engines.json_engine.identity | ( | arg | ) |
Definition at line 351 of file json_engine.py.
searx.engines.json_engine.is_iterable | ( | obj | ) |
Definition at line 266 of file json_engine.py.
Referenced by searx.engines.json_engine.do_query().
searx.engines.json_engine.iterate | ( | iterable | ) |
Definition at line 256 of file json_engine.py.
Referenced by searx.engines.json_engine.do_query().
searx.engines.json_engine.parse | ( | query | ) |
Definition at line 272 of file json_engine.py.
searx.engines.json_engine.query | ( | data, | |
query_string ) |
Definition at line 305 of file json_engine.py.
References searx.engines.json_engine.do_query().
searx.engines.json_engine.request | ( | query, | |
params ) |
Build request parameters (see :ref:`engine request`).
Definition at line 311 of file json_engine.py.
searx.engines.json_engine.response | ( | resp | ) |
Scrap *results* from the response (see :ref:`engine results`).
Definition at line 386 of file json_engine.py.
References searx.engines.json_engine.extract_response_info().
bool searx.engines.json_engine.content_html_to_text = False |
Definition at line 205 of file json_engine.py.
searx.engines.json_engine.content_query = None |
Definition at line 190 of file json_engine.py.
dict searx.engines.json_engine.cookies = {} |
Definition at line 154 of file json_engine.py.
int searx.engines.json_engine.first_page_num = 1 |
Definition at line 169 of file json_engine.py.
dict searx.engines.json_engine.headers = {} |
Definition at line 158 of file json_engine.py.
str searx.engines.json_engine.lang_all = 'en' |
Definition at line 115 of file json_engine.py.
str searx.engines.json_engine.method = 'GET' |
Definition at line 131 of file json_engine.py.
list searx.engines.json_engine.no_result_for_http_status = [] |
Definition at line 120 of file json_engine.py.
int searx.engines.json_engine.page_size = 1 |
Definition at line 165 of file json_engine.py.
bool searx.engines.json_engine.paging = False |
Definition at line 162 of file json_engine.py.
str searx.engines.json_engine.request_body = '' |
Definition at line 134 of file json_engine.py.
str searx.engines.json_engine.results_query = '' |
Definition at line 172 of file json_engine.py.
dict searx.engines.json_engine.safe_search_map = {0: '&filter=none', 1: '&filter=moderate', 2: '&filter=strict'} |
Definition at line 242 of file json_engine.py.
bool searx.engines.json_engine.safe_search_support = False |
Definition at line 239 of file json_engine.py.
searx.engines.json_engine.search_url = None |
Definition at line 82 of file json_engine.py.
int searx.engines.json_engine.soft_max_redirects = 0 |
Definition at line 128 of file json_engine.py.
str searx.engines.json_engine.suggestion_query = '' |
Definition at line 199 of file json_engine.py.
str searx.engines.json_engine.thumbnail_prefix = '' |
Definition at line 196 of file json_engine.py.
bool searx.engines.json_engine.thumbnail_query = False |
Definition at line 193 of file json_engine.py.
dict searx.engines.json_engine.time_range_map |
Definition at line 221 of file json_engine.py.
bool searx.engines.json_engine.time_range_support = False |
Definition at line 208 of file json_engine.py.
str searx.engines.json_engine.time_range_url = '&hours={time_range_val}' |
Definition at line 211 of file json_engine.py.
bool searx.engines.json_engine.title_html_to_text = False |
Definition at line 202 of file json_engine.py.
searx.engines.json_engine.title_query = None |
Definition at line 187 of file json_engine.py.
str searx.engines.json_engine.url_prefix = "" |
Definition at line 184 of file json_engine.py.
searx.engines.json_engine.url_query = None |
Definition at line 181 of file json_engine.py.