Commit Graph

35 Commits (af35eee10b98940c51c6e5e18629de514b4bd48d)

Author SHA1 Message Date
Adam Tauber 88dfee858e [fix] rewrite missing variable 8 years ago
dalf fbb080f358 Change plugin API :
- 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
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
Noemi Vanyi aa227180e2 remove self info answers from pages after first one 8 years ago
David A Roberts 678b9e994a [enh] infinite scroll
resolves #649
8 years ago
David A Roberts 117d36b66e Add Crossref search engine and DOAI rewrite plugin 8 years ago
stepshal b3ab221b98 Fix anomalous backslash in string 8 years ago
Adam Tauber 257e52954a [enh][fix] update to latest dependencies ++ fix tests & travis test runner
WARNING: dependency changes
8 years ago
Kirill Isakov 3246541bdc [WIP] Add vim-hotkeys plugin 8 years ago
Adam Tauber 4e5af8d87b [mod] move plugin static files to static/plugins 9 years ago
Adam Tauber ab6a7601cb [enh] new plugin to open results on new browser tabs 9 years ago
Adam Tauber bd22e9a336 [fix] pep8 compatibilty 9 years ago
Adam Tauber d2fd56612c [fix] rename after result refactor 9 years ago
Adam Tauber 6424a7702d Merge branch 'remove_trackers_plugin' of https://github.com/Cqoicebordel/searx into Cqoicebordel-remove_trackers_plugin
Conflicts:
	searx/plugins/__init__.py
9 years ago
Cqoicebordel 8911233e3e Use parsed_url 9 years ago
Cqoicebordel e93f5314d7 A bit of cleanup of the code
- regexes in a array
- regexes applied only on the last part of the url
9 years ago
Luc Didry 0fe362bacf Change self plugin to self_info + change self_info description 9 years ago
Luc Didry 41fd748cdf Merge self_ip and self_useragent into one plugin 9 years ago
Luc Didry 538029dc14 Add a self user agent plugin
Just like with the "ip" query, duckduckgo gives the server's
information with the "user agent" query.
This corrects this behavior by adding a plugin based on self_ip.py plugin.
9 years ago
Cqoicebordel 617495cca8 Add a plugin to remove trackers from results URLs 9 years ago
Adam Tauber 3683b35877 [fix] plugin description 9 years ago
Adam Tauber ff68546c69 [mod] enable category select plugin by default 9 years ago
Adam Tauber 33516256fd [fix] load https rules 9 years ago
Adam Tauber d2a636f75d [mod] https rewrite pluginification 9 years ago
Adam Tauber 146928a749 [doc] plugin license infos 9 years ago
Adam Tauber 973c97c85b [enh] new plugin: search on category select (currently only in oscar theme)
TODO
purge mootools from default/courgette and integrate jquery ++ this theme
9 years ago
Adam Tauber dd84814b68 [enh] plugins: client side dependency support 9 years ago
Adam Tauber 54f1bc0425 [fix] call ip plugin as a post search callback 9 years ago
Adam Tauber a57a011e94 [fix] remove ip plugin pre_search override - closes #275 10 years ago
Adam Tauber bf5d6f56c6 [enh] plugin attribute type check 10 years ago
Adam Tauber 13ea0a20ae [enh] gettext in self ip plugin 10 years ago
Adam Tauber 9eeb36c787 [enh] selfip plugin description 10 years ago
Adam Tauber 9cb66be29c [enh] plugin id 10 years ago
Adam Tauber cae22bfc76 [enh] per user plugin switch 10 years ago
Adam Tauber 00cc4dcbf4 [enh] plugin support basics ++ self ip plugin 10 years ago