diff options
author | Alexandre Flament <alex@al-f.net> | 2020-09-14 10:11:49 +0200 |
---|---|---|
committer | Alexandre Flament <alex@al-f.net> | 2020-09-22 12:36:26 +0200 |
commit | edd8dccd07d5c9bbd5d73c74ee98d0a7ee585dd0 (patch) | |
tree | a688a0c148f7c23cd99b87e01f8b6d565ffda235 /searx/webapp.py | |
parent | c4067a9d02d97ca08259daeede92a031cd608724 (diff) | |
download | searxng-edd8dccd07d5c9bbd5d73c74ee98d0a7ee585dd0.tar.gz searxng-edd8dccd07d5c9bbd5d73c74ee98d0a7ee585dd0.zip |
[mod] searx.query.RawTextQuery: getSearchQuery and changeSearchQuery rename to getQuery and changeQuery
getSearchQuery is confusing, the method returns a str not a SearchQuery object
Diffstat (limited to 'searx/webapp.py')
-rwxr-xr-x | searx/webapp.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/searx/webapp.py b/searx/webapp.py index 90bc8fc6e..bba37cce1 100755 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -679,13 +679,13 @@ def index(): # suggestions: use RawTextQuery to get the suggestion URLs with the same bang suggestion_urls = list(map(lambda suggestion: { - 'url': raw_text_query.changeSearchQuery(suggestion).getFullQuery(), + 'url': raw_text_query.changeQuery(suggestion).getFullQuery(), 'title': suggestion }, result_container.suggestions)) correction_urls = list(map(lambda correction: { - 'url': raw_text_query.changeSearchQuery(correction).getFullQuery(), + 'url': raw_text_query.changeQuery(correction).getFullQuery(), 'title': correction }, result_container.corrections)) @@ -744,7 +744,7 @@ def autocompleter(): raw_text_query = RawTextQuery(request.form.get('q', ''), disabled_engines) # check if search query is set - if not raw_text_query.getSearchQuery(): + if not raw_text_query.getQuery(): return '', 400 # run autocompleter @@ -765,12 +765,12 @@ def autocompleter(): else: language = language.split('-')[0] # run autocompletion - raw_results.extend(completer(raw_text_query.getSearchQuery(), language)) + raw_results.extend(completer(raw_text_query.getQuery(), language)) # parse results (write :language and !engine back to result string) results = [] for result in raw_results: - raw_text_query.changeSearchQuery(result) + raw_text_query.changeQuery(result) # add parsed result results.append(raw_text_query.getFullQuery()) |