Browse Source

[fix] fix threshold in replace_auto_language

[1] https://github.com/searxng/searxng/pull/2027#pullrequestreview-1322157677
[2] https://github.com/searxng/searxng/pull/1969#issuecomment-1345354529

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Markus Heiser 2 years ago
parent
commit
150a90c84e
1 changed files with 1 additions and 1 deletions
  1. 1 1
      searx/search/__init__.py

+ 1 - 1
searx/search/__init__.py

@@ -54,7 +54,7 @@ def replace_auto_language(search_query: SearchQuery):
     if search_query.lang != 'auto':
     if search_query.lang != 'auto':
         return
         return
 
 
-    detected_lang = detect_language(search_query.query, threshold=0.0, only_search_languages=True)
+    detected_lang = detect_language(search_query.query, threshold=0.3, only_search_languages=True)
     if detected_lang is None:
     if detected_lang is None:
         # fallback to 'all' if no language has been detected
         # fallback to 'all' if no language has been detected
         search_query.lang = 'all'
         search_query.lang = 'all'