.oO SearXNG Developer Documentation Oo.
|
Functions | |
List[EngineRef] | deduplicate_engineref_list (List[EngineRef] engineref_list) |
Tuple[List[EngineRef], List[EngineRef], List[EngineRef]] | validate_engineref_list (List[EngineRef] engineref_list, Preferences preferences) |
int | parse_pageno (Dict[str, str] form) |
str | parse_lang (Preferences preferences, Dict[str, str] form, RawTextQuery raw_text_query) |
int | parse_safesearch (Preferences preferences, Dict[str, str] form) |
Optional[str] | parse_time_range (Dict[str, str] form) |
Optional[float] | parse_timeout (Dict[str, str] form, RawTextQuery raw_text_query) |
None | parse_category_form (List[str] query_categories, str name, str value) |
List[str] | get_selected_categories (Preferences preferences, Optional[Dict[str, str]] form) |
List[EngineRef] | get_engineref_from_category_list (List[str] category_list, List[str] disabled_engines) |
List[EngineRef] | parse_generic (Preferences preferences, Dict[str, str] form, List[str] disabled_engines) |
parse_engine_data (form) | |
Tuple[SearchQuery, RawTextQuery, List[EngineRef], List[EngineRef], str] | get_search_query_from_webapp (Preferences preferences, Dict[str, str] form) |
Definition at line 17 of file webadapter.py.
Referenced by searx.webadapter.get_search_query_from_webapp().
List[EngineRef] searx.webadapter.get_engineref_from_category_list | ( | List[str] | category_list, |
List[str] | disabled_engines ) |
Definition at line 159 of file webadapter.py.
Referenced by searx.webadapter.parse_generic().
Tuple[SearchQuery, RawTextQuery, List[EngineRef], List[EngineRef], str] searx.webadapter.get_search_query_from_webapp | ( | Preferences | preferences, |
Dict[str, str] | form ) |
Assemble data from preferences and request.form (from the HTML form) needed in a search query. The returned tuple consits of: 1. instance of :py:obj:`searx.search.SearchQuery` 2. instance of :py:obj:`searx.query.RawTextQuery` 3. list of :py:obj:`searx.search.EngineRef` instances 4. string with the *selected locale* of the query About language/locale: if the client selects the alias ``auto`` the ``SearchQuery`` object is build up by the :py:obj:`detected language <searx.utils.detect_language>`. If language recognition does not have a match the language preferred by the :py:obj:`Preferences.client` is used. If client does not have a preference, the default ``all`` is used. The *selected locale* in the tuple always represents the selected language/locale and might differ from the language recognition.
Definition at line 222 of file webadapter.py.
References searx.webadapter.deduplicate_engineref_list(), searx.webadapter.parse_engine_data(), searx.webadapter.parse_generic(), searx.webadapter.parse_pageno(), searx.webadapter.parse_safesearch(), searx.webadapter.parse_time_range(), searx.webadapter.parse_timeout(), and searx.webadapter.validate_engineref_list().
List[str] searx.webadapter.get_selected_categories | ( | Preferences | preferences, |
Optional[Dict[str, str]] | form ) |
Definition at line 136 of file webadapter.py.
References searx.webadapter.parse_category_form().
None searx.webadapter.parse_category_form | ( | List[str] | query_categories, |
str | name, | ||
str | value ) |
Definition at line 118 of file webadapter.py.
Referenced by searx.webadapter.get_selected_categories(), and searx.webadapter.parse_generic().
searx.webadapter.parse_engine_data | ( | form | ) |
Definition at line 213 of file webadapter.py.
Referenced by searx.webadapter.get_search_query_from_webapp().
List[EngineRef] searx.webadapter.parse_generic | ( | Preferences | preferences, |
Dict[str, str] | form, | ||
List[str] | disabled_engines ) |
Definition at line 173 of file webadapter.py.
References searx.webadapter.get_engineref_from_category_list(), and searx.webadapter.parse_category_form().
Referenced by searx.webadapter.get_search_query_from_webapp().
str searx.webadapter.parse_lang | ( | Preferences | preferences, |
Dict[str, str] | form, | ||
RawTextQuery | raw_text_query ) |
Definition at line 56 of file webadapter.py.
int searx.webadapter.parse_pageno | ( | Dict[str, str] | form | ) |
Definition at line 49 of file webadapter.py.
Referenced by searx.webadapter.get_search_query_from_webapp().
int searx.webadapter.parse_safesearch | ( | Preferences | preferences, |
Dict[str, str] | form ) |
Definition at line 76 of file webadapter.py.
Referenced by searx.webadapter.get_search_query_from_webapp().
Optional[str] searx.webadapter.parse_time_range | ( | Dict[str, str] | form | ) |
Definition at line 96 of file webadapter.py.
Referenced by searx.webadapter.get_search_query_from_webapp().
Optional[float] searx.webadapter.parse_timeout | ( | Dict[str, str] | form, |
RawTextQuery | raw_text_query ) |
Definition at line 105 of file webadapter.py.
Referenced by searx.webadapter.get_search_query_from_webapp().
Tuple[List[EngineRef], List[EngineRef], List[EngineRef]] searx.webadapter.validate_engineref_list | ( | List[EngineRef] | engineref_list, |
Preferences | preferences ) |
Validate query_engines according to the preferences Returns: List[EngineRef]: list of existing engines with a validated token List[EngineRef]: list of unknown engine List[EngineRef]: list of engine with invalid token according to the preferences
Definition at line 22 of file webadapter.py.
Referenced by searx.webadapter.get_search_query_from_webapp().