Commit Graph

37 Commits

Author SHA1 Message Date
Adam Tauber 17b6faa4c3 [fix] pep8 2020-01-02 22:38:12 +01:00
Adam Tauber 2292e6e130 [fix] handle missing result size 2020-01-02 22:28:47 +01:00
Dalf 85b3723345 [mod] speed optimization
compile XPath only once
avoid redundant call to urlparse
get_locale(webapp.py): avoid useless call to request.accept_languages.best_match
2019-11-15 09:33:15 +01:00
Léo Bourrel 88261e111c Fix bing engine results count (#1387)
This PR fixes the result count from bing which was throwing an (hidden) error and add a validation to avoid reading more results than avalaible.

For example :
If there is 100 results from some search and we try to get results from 120 to 130, Bing will send back the results from 0 to 10 and no error. If we compare results count with the first parameter of the request we can avoid this "invalid" results.
2019-08-05 16:15:40 +02:00
Dalf 1cee2c1796 [fix] bing engine
before this commit, sometimes there are no results
use a generic user-agent instead of one with the OS "Windows NT 6.3; WOW64"
2019-08-05 15:46:40 +02:00
Noémi Ványi b63d645a52 Revert "remove 'all' option from search languages"
This reverts commit 4d1770398a.
2019-01-07 21:19:00 +01:00
Marc Abonce Seguin 75b276f408 fix bing "garbage" results (issue #1275) 2018-05-20 18:13:32 -05:00
Marc Abonce Seguin 772c048d01 refactor engine's search language handling
Add match_language function in utils to match any user given
language code with a list of engine's supported languages.

Also add language_aliases dict on each engine to translate
standard language codes into the custom codes used by the engine.
2018-03-27 00:08:03 -06:00
marc 4d1770398a remove 'all' option from search languages 2017-12-06 01:20:15 -06:00
Adam Tauber 52e615dede [enh] py3 compatibility 2017-05-15 12:02:30 +02:00
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.
2017-03-18 23:44:21 +01:00
Adam Tauber 6bf9c398a7 [fix] use english as default language in bing
If no language is specified, bing returns results with multiple languages
for one query which isn't really useful. Setting english as default
insted if nothing.
2016-12-30 18:17:14 +01:00
marc af35eee10b tests for _fetch_supported_languages in engines
and refactor method to make it testable without making requests
2016-12-15 00:40:21 -06:00
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.
2016-12-13 19:58:10 -06:00
marc 149802c569 [enh] add supported_languages on engines and auto-generate languages.py 2016-12-13 19:32:00 -06:00
Adam Tauber 16bdc0baf4 [mod] do not escape html content in engines 2016-12-09 18:59:19 +01:00
Adam Tauber 43ddbc60da [fix] pep8 2016-11-14 16:09:16 +01:00
Adam Tauber 16f2e346b3 [fix] bing unicode issue part III. 2016-11-14 15:52:29 +01:00
Adam Tauber 1176505fa4 [fix] bing character encoding - closes #760 2016-11-14 15:47:42 +01:00
Adam Tauber 17b08d096c [fix] unicode search expression for bing 2016-11-07 22:33:17 +01:00
Adam Tauber 16ff8d06c7 [fix] bing paging and language support
see https://msdn.microsoft.com/en-us/library/ff795620.aspx for bing
specific search operators

closes #755
2016-11-07 22:30:20 +01:00
Adam Tauber 2f7752b410 [enh] display number of results 2016-06-28 00:06:50 +02:00
Adam Tauber 604f32f672 [fix] bing unicode encode error - fixes #408 2015-08-28 14:51:32 +02:00
Alexandre Flament 4689fe341c update versions.cfg to use the current up-to-date packages 2015-05-02 15:45:17 +02:00
Cqoicebordel 525af2a031 Add bing in the test units 2015-01-25 20:14:37 +01:00
dalf 7c13d630e4 [fix] pep8 : engines (errors E121, E127, E128 and E501 still exist) 2014-12-07 16:37:56 +01:00
Thomas Pointhuber 3d61d9b930 little refactoring 2014-09-02 17:13:44 +02:00
Thomas Pointhuber 4b1e0423a0 update bing engines and fix bing_news 2014-09-01 14:38:59 +02:00
Adam Tauber 66f02dc2b6 [fix] unused globals removed 2014-07-09 01:18:37 +02:00
Gabor Nagy 22fd0746d9 Improves PEP8 compatibility. 2014-02-05 20:24:31 +01:00
asciimoo 2a788c8f29 [enh] search language support init 2014-01-31 04:35:23 +01:00
asciimoo ca271fd861 [enh] bing, google paging support 2014-01-29 21:14:38 +01:00
Matej Cotman dd4662978d fix: robot fw, entry points, some flake8, package searx egg 2014-01-20 01:06:29 +01:00
Dalf bf56ec4fb1 [mod] bing and duckduckgo engines : add / rename locale parameter 2014-01-05 13:58:17 +01:00
asciimoo d9011f673e [fix] debug msg removed 2013-10-25 01:46:12 +02:00
asciimoo aa41c2b8ac [enh] bing updates ++ language support 2013-10-25 01:37:48 +02:00
asciimoo 2ca4cf7f2d [enh] bing engine added 2013-10-24 23:52:57 +02:00