diff options
author | Noémi Ványi <sitbackandwait@gmail.com> | 2017-05-18 21:34:54 +0200 |
---|---|---|
committer | Noémi Ványi <sitbackandwait@gmail.com> | 2017-05-18 21:34:54 +0200 |
commit | 2db807368c549029a5f1fc8b20d0fcd56627cc5e (patch) | |
tree | e704e90fd5fff712ec6e6e307548cfda834dabb8 | |
parent | 9ee8e552da4654cd41228ce1a3addfa1fa1f377d (diff) | |
download | searxng-2db807368c549029a5f1fc8b20d0fcd56627cc5e.tar.gz searxng-2db807368c549029a5f1fc8b20d0fcd56627cc5e.zip |
[enh] make search type of mediawiki configurable
-rw-r--r-- | searx/engines/mediawiki.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/searx/engines/mediawiki.py b/searx/engines/mediawiki.py index 5a70204b1..82efbbdcb 100644 --- a/searx/engines/mediawiki.py +++ b/searx/engines/mediawiki.py @@ -21,6 +21,7 @@ categories = ['general'] language_support = True paging = True number_of_results = 1 +search_type = 'nearmatch' # possible values: title, text, nearmatch # search-url base_url = 'https://{language}.wikipedia.org/' @@ -30,7 +31,7 @@ search_postfix = 'w/api.php?action=query'\ '&format=json'\ '&sroffset={offset}'\ '&srlimit={limit}'\ - '&srwhat=nearmatch' # search for a near match in the title + '&srwhat={searchtype}' # search for a near match in the title # do search-request @@ -39,7 +40,8 @@ def request(query, params): string_args = dict(query=urlencode({'srsearch': query}), offset=offset, - limit=number_of_results) + limit=number_of_results, + searchtype=search_type) format_strings = list(Formatter().parse(base_url)) |