@@ -21,6 +21,7 @@ categories = ['general']
2121language_support = True
2222paging = True
2323number_of_results = 1
24+search_type = 'nearmatch' # possible values: title, text, nearmatch
2425
2526# search-url
2627base_url = 'https://{language}.wikipedia.org/'
@@ -30,7 +31,7 @@ search_postfix = 'w/api.php?action=query'\
3031 '&format=json'\
3132 '&sroffset={offset}'\
3233 '&srlimit={limit}'\
33− '&srwhat=nearmatch' # search for a near match in the title
34+ '&srwhat={searchtype}'
3435
3536
3637# do search-request
@@ -39,7 +40,8 @@ def request(query, params):
3940
4041 string_args = dict(query=urlencode({'srsearch': query}),
4142 offset=offset,
42− limit=number_of_results)
43+ limit=number_of_results,
44+ searchtype=search_type)
4345
4446 format_strings = list(Formatter().parse(base_url))
4547