summaryrefslogtreecommitdiff
path: root/searx/search.py
AgeCommit message (Collapse)Author
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.
2016-02-20[enh] suspend engines after errorAdam Tauber
The duration is based on the number of continuous errors, but maximized in one minute
2015-12-01Merge pull request #438 from Cqoicebordel/error_page_formatAdam Tauber
Don't throw away the request if pageno is wrong
2015-10-03[enh][mod] result handling refactorAdam Tauber
Several changes has been made: - Parallel result merge - Scoring algorithm slightly changed (see result_score()) - Proper Thread locking on global data manipulation
2015-09-18Don't throw away the request if pageno is wrongCqoicebordel
Fix #424 but maybe only partially
2015-09-11[fix] add missing scheme to duplicated results too ++ revert gigablasts handlingAdam Tauber
2015-09-01[fix] display categories of the selected enginesAdam Tauber
2015-09-01[fix] engine selection from urlAdam Tauber
2015-08-25[fix] check empty engine language attribute - fixes subtitleseekerAdam Tauber
2015-08-24[fix] rewrite scheme to http if there is no one, FIX #390Thomas Pointhuber
2015-08-02[fix] type errorAdam Tauber
2015-08-02[enh] default settings option to safe_search - #396Adam Tauber