summaryrefslogtreecommitdiff
path: root/searx/search.py
AgeCommit message (Collapse)Author
2020-04-17[fix] translate engine errors to Occitan when configuredNoémi Ványi
2020-02-08[enh] introduce private enginesNoémi Ványi
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.
2019-10-16fix pep 8 checkNoémi Ványi
2019-10-16add initial support for offline engines && command engineNoémi Ványi
2019-08-02[fix] fix paging for the oscar theme after PR #1640Dalf
2019-08-02[enh] Add timeout limit per request (#1640)Alexandre Flament
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
2019-07-27[fix] "!wp !wp test" send only one request to wikipedia.Dalf
Note that "!general !wp test" is not fixed because the category for "!wp" is "none".
2019-07-17[enh] Add Server-Timing header (#1637)Alexandre Flament
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.
2019-07-17Suggestions: use RawTextQuery to make the suggestions URLs. Update all ↵Dalf
themes accordingly.
2019-01-25add again accidentally removed import to search.pyNoémi Ványi
2019-01-07Revert "remove 'all' option from search languages"Noémi Ványi
This reverts commit 4d1770398a6af8902e75c0bd885781584d39e796.
2018-08-19[fix] pep8Adam Tauber
2018-08-19[enh] admin configurable suspend time of errored engines - closes #1266Adam Tauber
2018-03-22forward category to engine without highlighting on the uiNoémi Ványi
2017-12-06remove 'all' option from search languagesmarc
2017-12-05[enh] display engine error messagesAdam Tauber
2017-11-22[enh] timeout and total HTTP time are managed by searx.poolrequestsAlexandre Flament
2017-07-20add timeout errors in search_multiple_requestsNoémi Ványi
2017-07-12show engine errors in infobox && add new error alertNoémi Ványi
2017-05-15[enh] py3 compatibilityAdam Tauber
2017-03-18make search language handling less strictmarc
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.
2017-01-27Merge branch 'master' into flask_perimeterAlexandre Flament
2017-01-21[fix] correct search parameter checkAdam Tauber
2017-01-21[fix] search time range value checkAdam Tauber
2017-01-20[enh] validate input and raise an exception inside search.py. The exception ↵Alexandre Flament
message is output in json and rss format.
2017-01-02[mod] searx uses flask framework only in webapp.py. Make migration to ↵Alexandre Flament
another framework easier.
2016-12-30[fix] fix bugs introduced by commit 0a2fde19d031acef80ce5991bc6b41528dbfbf5b ↵Alexandre Flament
from dalf/searchpy4
2016-12-30[mod] timeout in log are readable (the timeouts are compare to the ↵Alexandre Flament
start_time of the request).
2016-12-30[mod] result_container.extend sets result['engine'] = engine_name for each ↵Alexandre Flament
result
2016-12-30[mod] add a search_one_request_safe function wrapper to call ↵Alexandre Flament
search_one_request. All exceptions are catched in this wrapper.
2016-12-16Merge branch 'master' into languagesmarc
2016-12-15[fix] engine setting if no categories specifiedAdam Tauber
2016-12-13[fix] broken language selectormarc
2016-12-10[fix] remove unused variableAdam Tauber
2016-12-10[enh] handle engine response crashesAdam Tauber
2016-12-09Merge branch 'master' into searchpy2Alexandre Flament
2016-11-19[enh] add quick answer functionality with an example answererAdam Tauber
2016-11-06Merge branch 'master' into searchpy2Alexandre Flament
2016-11-06[fix] suspend end time checkAdam Tauber
2016-11-05Simplify search.py, basically updated PR #518Alexandre Flament
The timeouts in settings.yml is about the total time (not only the HTTP request but also the prepare the request and parsing the response) It was more or less the case before since the threaded_requests function ignores the thread after the timeout even the HTTP request is ended. New / changed stats : * page_load_time : record the HTTP request time * page_load_count: the number of HTTP request * engine_time : the execution total time of an engine * engine_time_count : the number of "engine_time" measure The avg response times in the preferences are the engine response time (engine_load_time / engine_load_count) To sum up : * Search.search() filters the engines that can't process the request * Search.search() call search_multiple_requests function * search_multiple_requests creates one thread per engine, each thread runs the search_one_request function * search_one_request calls the request function, make the HTTP request, calls the response function, extends the result_container * search_multiple_requests waits for the the thread to finish (or timeout)
2016-11-02[mod] replace references request.request_data (GET or POST parameters) by ↵Alexandre Flament
request.form (based on merge of POST and GET parameters)
2016-11-02Change plugin API :dalf
- pre_search(request, search) - post_search(request, search) - on_result(request, search, result) with - request is the Flask request - search a searx.Search instance - result a searx result as usual
2016-11-02Clean up the architecturedalf
Purposes : - isolate the plugins calls - distinction between parsing the web request and running the search (Search class). To be able to test code easily, to run searx code outside a web server, to filter the search query parameters with plugins more easily, etc... Details : - request.request_data contains request.form or request.args (initialize inside pre_request() function) - Query class is renamed RawTextQuery - SearchQuery class defines all search parameters - get_search_query_from_webapp create a SearchQuery instance (basically the previous Search.__init__ code) - Search class and SearchWithPlugins class takes a SearchQuery instance as class constructor parameter - SearchWithPlugins class inherites from Search class, and run plugins - A dedicated function search_with_plugins executes plugins to have a well define locals() (which is used by the plugins code). - All plugins code is executed inside the try...except block (webapp.py, index function) - advanced_search HTTP parameter value stays in webapp.py (it is only part of UI) - multiple calls to result_container.get_ordered_results() doesn't compute the order multiple time (note : this method was call only once before) - paging value is stored in the result_container class (compute in the extend method) - test about engine.suspend_end_time is done during search method call (instead of __init__) - check that the format parameter value is one of these : html, rss, json, rss (before the html value was assumed but some text formatting wasn't not done)
2016-09-06[fix] thread safe threaded_requests() functionAdam Tauber
2016-07-31[fix] collect garbage after searches to reduce memory footprintAdam Tauber
2016-07-25advanced-search: panel is visible when checked beforeNoemi Vanyi
2016-07-25add time range search with yahooNoemi Vanyi
2016-04-09more follow ups in new preferencesNoemi Vanyi
2016-04-09rename blocked engines to diabled enginesNoemi Vanyi
2016-04-09new preferences handlingNoemi Vanyi
Preferences class was introduced in order to handle user preferences. Right now it parses cookies and the form in preferences. Also it can retrieve settings based on the name of the setting. ATTENTION Please note that engine preferences are handled differently from now on. So it introduces incompatible changes. Every user who has saved preferences should reset and save his/her settings again. This change was needed, because everytime a default disabled engine was added saved user preferences would broke. Now engine setting tracking is fixed.