Skip to content
This repository has been archived by the owner on Sep 7, 2023. It is now read-only.

[fix] Fix queries in Hebrew and Norwegian so they give results in the right language #1446

Merged
merged 4 commits into from
Jan 7, 2019

Conversation

MarcAbonce
Copy link
Contributor

Right now when you query Google in Hebrew, all results are in the wrong language. E.g. :he !google iphone. The same bug can be reproduced in other engines when using Norwegian. This happens because some languages have more than one possible language code.

This was a mistake on my part. This was supposedly fixed in #1252, but I forgot to pass a parameter in some engines.

@kvch
Copy link
Member

kvch commented Jan 5, 2019

Sorry for the delay. I tested your branch and I get the following error message when I use the example search query you mentioned.

ERROR:searx.search:engine google : exception : global name 'language_aliases' is not defined
Traceback (most recent call last):
  File "/home/n/p/searx/searx/search.py", line 104, in search_one_request_safe
    search_results = search_one_request(engine, query, request_params)
  File "/home/n/p/searx/searx/search.py", line 73, in search_one_request
    engine.request(query, request_params)
  File "/home/n/p/searx/searx/engines/google.py", line 169, in request
    language = match_language(params['language'], supported_languages, language_aliases)
NameError: global name 'language_aliases' is not defined

@MarcAbonce
Copy link
Contributor Author

Fixed. It should be working now.

@kvch kvch merged commit 491792c into searx:master Jan 7, 2019
@kvch
Copy link
Member

kvch commented Jan 7, 2019

Thank you!

@MarcAbonce MarcAbonce deleted the language_aliases_fix branch June 26, 2019 23:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants