Commit Graph

123 Commits (678699beaf97184a9059b0c6514b1a51c7e6dfd0)

Author SHA1 Message Date
Alexandre Flament 691d12726b [mod] check the engine tokens in searx/webadapter.py instead of searx/search.py 4 years ago
Alexandre Flament eecfff2689 [mod] check time_range parameter in searx/webadapter.py 4 years ago
Alexandre Flament 2929495112 [mod] add searx.search.EngineRef
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.
4 years ago
Alexandre Flament 2dbc0de0cd [mod] add searx/webadapter.py
* move searx.search.get_search_query_from_webapp to searx.webadapter
* move searx.query.SearchQuery to searx.search
4 years ago
Alexandre Flament e8df5d3f7f [mod] searx.search: change function declaration: online then offline then utility functions. 4 years ago
Alexandre Flament 50e717c452 [mod] searx.search: remove unused global variable number_of_searches 4 years ago
Alexandre Flament edd8dccd07 [mod] searx.query.RawTextQuery: getSearchQuery and changeSearchQuery rename to getQuery and changeQuery
getSearchQuery is confusing, the method returns a str not a SearchQuery object
4 years ago
Alexandre Flament c4067a9d02 [mod] searx.search.Search: split the search method into different methods 4 years ago
Alexandre Flament df12ed6e55 [mod] searx.RawTextQuery: the constructor call parse_query 4 years ago
Dalf 7888377743 Drop Python 2 (3/n): objects 4 years ago
Dalf 1022228d95 Drop Python 2 (1/n): remove unicode string and url_utils 4 years ago
Adam Tauber 4a913247b2 [enh] add option to configure proxies per engine - closes #1827 4 years ago
asht 3b8bd0770b
Change isAlive() to is_alive() as isAlive() is unsupported in newer Python versions 4 years ago
Lukas van den Berk 4829a76aae
Created new plugin type custom_results. Added new plugin bang_redirect (#2027)
* Made first attempt at the bangs redirects plugin.

* It redirects. But in a messy way via javascript.

* First version with custom plugin

* Added a help page and a operator to see all the bangs available.

* Changed to .format because of support

* Changed to .format because of support

* Removed : in params

* Fixed path to json file and changed bang operator

* Changed bang operator back to &

* Made first attempt at the bangs redirects plugin.

* It redirects. But in a messy way via javascript.

* First version with custom plugin

* Added a help page and a operator to see all the bangs available.

* Changed to .format because of support

* Changed to .format because of support

* Removed : in params

* Fixed path to json file and changed bang operator

* Changed bang operator back to &

* Refactored getting search query. Also changed bang operator to ! and is now working.

* Removed prints

* Removed temporary bangs_redirect.js file. Updated plugin documentation

* Added unit test for the bangs plugin

* Fixed a unit test and added 2 more for bangs plugin

* Changed back to default settings.yml

* Added myself to AUTHORS.rst

* Refacored working of custom plugin.

* Refactored _get_bangs_data from list to dict to improve search speed.

* Decoupled bangs plugin from webserver with redirect_url

* Refactored bangs unit tests

* Fixed unit test bangs. Removed dubbel parsing in bangs.py

* Removed a dumb print statement

* Refactored bangs plugin to core engine.

* Removed bangs plugin.

* Refactored external bangs unit tests from plugin to core.

* Removed custom_results/bangs documentation from plugins.rst

* Added newline in settings.yml so the PR stays clean.

* Changed searx/plugins/__init__.py back to the old file

* Removed newline search.py

* Refactored get_external_bang_operator from utils to external_bang.py

* Removed unnecessary import form test_plugins.py

* Removed _parseExternalBang and _isExternalBang from query.py

* Removed get_external_bang_operator since it was not necessary

* Simplified external_bang.py

* Simplified external_bang.py

* Moved external_bangs unit tests to test_webapp.py. Fixed return in search with external_bang

* Refactored query parsing to unicode to support python2

* Refactored query parsing to unicode to support python2

* Refactored bangs plugin to core engine.

* Refactored search parameter to search_query in external_bang.py
4 years ago
Noémi Ványi bce3830b8d [fix] translate engine errors to Occitan when configured 4 years ago
Noémi Ványi 99435381a8 [enh] introduce private engines
This PR adds a new setting to engines named `tokens`.
It expects a list of tokens which lets searx validate
if the request should be accepted or not.
4 years ago
Noémi Ványi 5796dc60c9 fix pep 8 check 5 years ago
Noémi Ványi a6f20caf32 add initial support for offline engines && command engine 5 years ago
Dalf ba80a0ba38 [fix] fix paging for the oscar theme after PR #1640 5 years ago
Alexandre Flament 72029d27de
[enh] Add timeout limit per request (#1640)
The new url parameter "timeout_limit" set timeout limit defined in second.
Example "timeout_limit=1.5" means the timeout limit is 1.5 seconds.

In addition, the query can start with <[number] to set the timeout limit.

For number between 0 and 99, the unit is the second :
Example: "<30 searx" means the timeout limit is 3 seconds

For number above 100, the unit is the millisecond:
Example: "<850 searx" means the timeout is 850 milliseconds.

In addition, there is a new optional setting: outgoing.max_request_timeout.
If not set, the user timeout can't go above searx configuration (as before: the max timeout of selected engine for a query).

If the value is set, the user can set a timeout between 0 and max_request_timeout using
<[number] or timeout_limit query parameter.

Related to #1077
Updated version of PR #1413 from @isj-privacore
5 years ago
Dalf 7d8000d965 [fix] "!wp !wp test" send only one request to wikipedia.
Note that "!general !wp test" is not fixed because the category for "!wp" is "none".
5 years ago
Alexandre Flament 554a21e1d0
[enh] Add Server-Timing header (#1637)
Server Timing specification: https://www.w3.org/TR/server-timing/

In the browser Dev Tools, focus on the main request, there are the responses per engine in the Timing tab.
5 years ago
Dalf c7220b40ea Suggestions: use RawTextQuery to make the suggestions URLs. Update all themes accordingly. 5 years ago
Noémi Ványi 36790168a1 add again accidentally removed import to search.py 6 years ago
Noémi Ványi b63d645a52 Revert "remove 'all' option from search languages"
This reverts commit 4d1770398a.
6 years ago
Adam Tauber c5c812899f [fix] pep8 6 years ago
Adam Tauber f7bb45e891 [enh] admin configurable suspend time of errored engines - closes #1266 6 years ago
Noémi Ványi 8cc529e9a3 forward category to engine without highlighting on the ui 6 years ago
marc 4d1770398a remove 'all' option from search languages 7 years ago
Adam Tauber 1435ae7e96 [enh] display engine error messages 7 years ago
Alexandre Flament c1cfe97851 [enh] timeout and total HTTP time are managed by searx.poolrequests 7 years ago
Noémi Ványi 80331cc8e6 add timeout errors in search_multiple_requests 7 years ago
Noémi Ványi 243d3e4298 show engine errors in infobox && add new error alert 7 years ago
Adam Tauber 52e615dede [enh] py3 compatibility 7 years ago
marc fd65c12921 make search language handling less strict
languages.py can change, so users may query on a language that is not
on the list anymore, even if it is still recognized by a few engines.

also made no and nb the same because they seem to return the same,
though most engines will only support one or the other.
7 years ago
Alexandre Flament e67dfaaac7 Merge branch 'master' into flask_perimeter 8 years ago
Adam Tauber e7aa98902f [fix] correct search parameter check 8 years ago
Adam Tauber 2522254fb2 [fix] search time range value check 8 years ago
Alexandre Flament 15eef0ebdb [enh] validate input and raise an exception inside search.py. The exception message is output in json and rss format. 8 years ago
Alexandre Flament 84a2c97a65 [mod] searx uses flask framework only in webapp.py. Make migration to another framework easier. 8 years ago
Alexandre Flament 5a9551925d [fix] fix bugs introduced by commit 0a2fde19d0 from dalf/searchpy4 8 years ago
Alexandre Flament 28d51fd063 [mod] timeout in log are readable (the timeouts are compare to the start_time of the request). 8 years ago
Alexandre Flament 3a8ab5880a [mod] result_container.extend sets result['engine'] = engine_name for each result 8 years ago
Alexandre Flament 0a2fde19d0 [mod] add a search_one_request_safe function wrapper to call search_one_request. All exceptions are catched in this wrapper. 8 years ago
marc 7fba3d1179 Merge branch 'master' into languages 8 years ago
Adam Tauber cf5c7d050a [fix] engine setting if no categories specified 8 years ago
marc 1b46ecd21a [fix] broken language selector 8 years ago
Adam Tauber 75aa46a6b3 [fix] remove unused variable 8 years ago
Adam Tauber 0205838f25 [enh] handle engine response crashes 8 years ago
Alexandre Flament e48f07a367 Merge branch 'master' into searchpy2 8 years ago