summaryrefslogtreecommitdiff
path: root/searx/webadapter.py
AgeCommit message (Collapse)Author
2024-11-24[chore] *: fix typos detected by typos-cliBnyro
2024-03-11[mod] pylint all files with one profile / drop PYLINT_SEARXNG_DISABLE_OPTIONMarkus Heiser
In the past, some files were tested with the standard profile, others with a profile in which most of the messages were switched off ... some files were not checked at all. - ``PYLINT_SEARXNG_DISABLE_OPTION`` has been abolished - the distinction ``# lint: pylint`` is no longer necessary - the pylint tasks have been reduced from three to two 1. ./searx/engines -> lint engines with additional builtins 2. ./searx ./searxng_extra ./tests -> lint all other python files Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2023-11-01Revert "[fix] limit maximum page number of a search query to page 50." (#2979)Markus Heiser
This reverts commit 7e2e335dd1e06ea20496028abe58b3ad8b255662.
2023-10-29[fix] limit maximum page number of a search query to page 50.Markus Heiser
To test this PR run a local instance and try to query page 51: http://127.0.0.1:8888/search?q=foo&pageno=51 A parameter exception will be raised: searx.exceptions.SearxParameterException: Invalid value "51" for parameter pageno And the client will receive a HTTP 400 (Bad request). Closes https://github.com/searxng/searxng/issues/2972 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2023-09-19[feat] implement feeling lucky featureBnyro
2023-04-15[mod] move language recognition to get_search_query_from_webappMarkus Heiser
To set the language from language recognition and hold the value selected by the client, the previous implementation creates a copy of the SearchQuery object and manipulates the SearchQuery object by calling function replace_auto_language(). This patch tries to implement a similar functionality in a more central place, in function get_search_query_from_webapp() when the SearchQuery object is build up. Additional this patch uses the language preferred by the client, if language recognition does not have a match / the existing implementation does not care about client preferences and uses 'all' in case of no match. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2023-02-17Add "Auto-detected" as a language.Alexandre Flament
When the user choose "Auto-detected", the choice remains on the following queries. The detected language is displayed. For example "Auto-detected (en)": * the next query language is going to be auto detected * for the current query, the detected language is English. This replace the autodetect_search_language plugin.
2022-09-27[fix] typos / reported by @kianmeng in searx PR-3366Markus Heiser
[PR-3366] https://github.com/searx/searx/pull/3366 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-01-03[fix] disabling all engines in a category makes the bang search in generalAlexandre Flament
with this commit, there is no result
2021-12-27[format.python] initial formatting of the python codeMarkus Heiser
This patch was generated by black [1]:: make format.python [1] https://github.com/psf/black Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-09-04[fix] typo in searx.webadapter.parse_langMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-03-06[enh] add ability to send engine data to subsequent requestsAdam Tauber
2020-12-20[fix] pylint: use "raise ... from ..."Alexandre Flament
2020-12-18[mod] searx.search.EngineRef: remove from_bang parameterAlexandre Flament
from_bang is True when the user query contains a bang. In this case the category is also set to 'none'. from_bang only usage was in searx.webadapter.parse_specific : if from_bang is True, then the EngineRef category is ignored and force to 'none'. This commit also removes the searx.webadapter.parse_sepecific function.
2020-12-18[mod] searx.search.SearchQuery: remove categories parameterAlexandre Flament
The categories parameter is useless in the constructor: it is always the categories from the EngineRef. The categories becomes a property.
2020-11-03[fix] webadapter: fix locked categoriesAlexandre Flament
2020-10-25Let admins lock user preferencesNoémi Ványi
2020-10-06[fix] fix searx.webadapterAlexandre Flament
* Fix "?q=test&engines=wikipedia": fix exception * Fix "?q=test&engines=wikipedia&categories=images": now the engines from images category are included. * Fix parse_timeout: make sure a value is always returned * Various typing fixes (searx.webadapter, searx.search.SearchQuery)
2020-10-01[mod] preferences.py: check language setting with a regex instead of ↵Alexandre Flament
match_language
2020-09-24[mod] more typingAlexandre Flament
2020-09-22[mod] add typing and __slots__Alexandre Flament
2020-09-22[mod] searx/webadapter.py: add get_selected_categories share common code ↵Alexandre Flament
with get_search_query_from_webapp Update searx/webapp.py to use get_selected_categories Close #2142
2020-09-22[mod] searx/webadapter.py: each web parameter has a dedicated function ↵Alexandre Flament
(parse_pageno, page_lang,....).
2020-09-22[mod] check the engine tokens in searx/webadapter.py instead of searx/search.pyAlexandre Flament
2020-09-22[mod] check time_range parameter in searx/webadapter.pyAlexandre Flament
2020-09-22[mod] add searx.search.EngineRefAlexandre Flament
was previously a Dict with two or three keys: name, category, from_bang make clear that this is a engine reference (see tests/unit/test_search.py for example) all variables using this class are renamed accordingly.
2020-09-22[mod] add searx/webadapter.pyAlexandre Flament
* move searx.search.get_search_query_from_webapp to searx.webadapter * move searx.query.SearchQuery to searx.search