Commit Graph

302 Commits (46a2c63f8e1c3819cceff2d61fe9106051e8ecee)

Author SHA1 Message Date
Alexandre Flament 181c12ae04 [mod] upgrade requirements.txt 7 years ago
Alexandre Flament e67dfaaac7 Merge branch 'master' into flask_perimeter 7 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 7fdfeca3a4 [mod] add a __common__ template that can't be selected but that provides a common place for shared templates.
What has been moved into this template :
* opensearch*.xml is always the same whatever the themes.
* the text inside */about.html
8 years ago
David A Roberts 1d30141c20 [enh] show spelling corrections 8 years ago
Alexandre Flament 7a16aca346 Merge branch 'master' into flask_perimeter 8 years ago
Dalf 06bea82935 [mod] /config API : add language_support, paging, safesearch, supported_languages, time_range_support, timeout fields. 8 years ago
Alexandre Flament 84a2c97a65 [mod] searx uses flask framework only in webapp.py. Make migration to another framework easier. 8 years ago
Adam Tauber 7388067f15 [fix] load engines with uwsgi too 8 years ago
Adam Tauber 8bff42f049 Merge branch 'master' into languages 8 years ago
Adam Tauber 68cbf0448f [fix] do not reload engines twice if started with debug mode 8 years ago
Adam Tauber a605377c40 [enh] explicit engine init 8 years ago
Adam Tauber 14f58bdaec [fix] robot tests ++ set default value for server http protocol version 8 years ago
Adam Tauber a98bbefbcf [enh] configurable listening http protocol version 8 years ago
marc f62ce21f50 [mod] fetch supported languages for several engines
utils/fetch_languages.py gets languages supported by each engine and
generates engines_languages.json with each engine's supported language.
8 years ago
marc 149802c569 [enh] add supported_languages on engines and auto-generate languages.py 8 years ago
Adam Tauber a764ebb4b1 [enh] extend json response with suggestions, infoboxes and answers 8 years ago
Alexandre Flament e48f07a367 Merge branch 'master' into searchpy2 8 years ago
Adam Tauber d80fb2c8e8 [enh] central handling of empty result titles 8 years ago
Adam Tauber ef2ef7974a [enh] central html escaping of results 8 years ago
Adam Tauber 971ed0abd1 [enh] add quick answer functionality with an example answerer 8 years ago
Adam Tauber 827f9e41ca [fix] gettext requires request.preferences 8 years ago
Adam Tauber a757c2f005 [fix] remove unused imports 8 years ago
Adam Tauber 832cf37a97 [enh] display errors
also tried flask's flash feature but flask creates session cookies if it
isn't flushed. Avoiding session cookies to preserve privacy
8 years ago
Adam Tauber 94196c4b6c [enh] show traceback of search errors 8 years ago
Alexandre Flament 01e2648e93 Simplify search.py, basically updated PR #518
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)
8 years ago
Alexandre Flament 58a6c045c8 [mod] replace references request.request_data (GET or POST parameters) by request.form (based on merge of POST and GET parameters) 8 years ago
dalf 67e11c42b9 Clean up the architecture
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)
8 years ago
Adam Tauber 6243639f01 [mod] do not proxify images if image proxy is not set 8 years ago
Noémi Ványi 6334fca11c add version info to config endpoint 8 years ago
Adam Tauber 1b9045ed89 [enh] use morty proxy for image proxification too if it is configured 8 years ago
Adam Tauber a67a4bf2c0 [enh] allow morty proxy without hmac key 8 years ago
Adam Tauber 574d9d40d2 Merge pull request #697 from Eig8phei/http1.1
serve pages with HTTP/1.1
8 years ago
dalf 3e7554422b [mod] the environment variable SEARX_DEBUG can override the general.debug value in settings.yml 8 years ago
Alexandre Flament a88768efd8 Merge branch 'master' into http1.1 8 years ago
Adam Tauber d5c0dcd18a [fix] unicode url proxiing 8 years ago
Adam Tauber 1be6e72d51 [enh] add result proxy support - #707 8 years ago
Adam Tauber 19a6ca0b68 [enh] use HMAC for image proxy url verification 8 years ago
Adam Tauber dceb903114 [mod] disallow search results for robots 8 years ago
Eig8phei f90eb428c6 serve pages with HTTP/1.1 8 years ago
Adam Tauber 8d4dd3c515 [fix] 404 HTTP status on not found pages - closes #681 8 years ago
Adam Tauber fa5bc3a563 [fix] use threading to recover after incomplete request crashes - closes #651 #662 8 years ago
Adam Tauber da4f1c2512 [mod] truncate result content in html - closes #224 8 years ago
Adam Tauber b4b0231617 [fix] links in new tabs without js ++ noopener bug fix - closes #674 8 years ago
Noemi Vanyi 0056c4035e add custom 404 page 8 years ago
Noemi Vanyi 16a8641649 advanced-search: panel is visible when checked before 8 years ago
Noemi Vanyi 93c0c49e9a add time range search with yahoo 8 years ago
Adam Tauber 21c5fb1c45 [fix] pep8 8 years ago
Adam Tauber 5b5478bbd9 [fix] compute the order of results only once per search 8 years ago
Adam Tauber 485da54961 [mod][fix] use the average of results number ++ do not display smaller result number than the actual result count - closes #600 8 years ago