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/autocomplete.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/autocomplete.py')
-rw-r--r-- | searx/autocomplete.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/searx/autocomplete.py b/searx/autocomplete.py index 9bc6a98f2..420b8a461 100644 --- a/searx/autocomplete.py +++ b/searx/autocomplete.py @@ -38,22 +38,22 @@ def get(*args, **kwargs): def searx_bang(full_query): '''check if the searchQuery contain a bang, and create fitting autocompleter results''' # check if there is a query which can be parsed - if len(full_query.getSearchQuery()) == 0: + if len(full_query.getQuery()) == 0: return [] results = [] # check if current query stats with !bang - first_char = full_query.getSearchQuery()[0] + first_char = full_query.getQuery()[0] if first_char == '!' or first_char == '?': - if len(full_query.getSearchQuery()) == 1: + if len(full_query.getQuery()) == 1: # show some example queries # TODO, check if engine is not avaliable results.append(first_char + "images") results.append(first_char + "wikipedia") results.append(first_char + "osm") else: - engine_query = full_query.getSearchQuery()[1:] + engine_query = full_query.getQuery()[1:] # check if query starts with categorie name for categorie in categories: @@ -72,14 +72,14 @@ def searx_bang(full_query): # check if current query stats with :bang elif first_char == ':': - if len(full_query.getSearchQuery()) == 1: + if len(full_query.getQuery()) == 1: # show some example queries results.append(":en") results.append(":en_us") results.append(":english") results.append(":united_kingdom") else: - engine_query = full_query.getSearchQuery()[1:] + engine_query = full_query.getQuery()[1:] for lc in language_codes: lang_id, lang_name, country, english_name = map(str.lower, lc) |