Browse Source

The previous version: (#1327)

Search function can not work very well in Chinese, for example, there are lots of Chinese words which length is 2, such as apple/duck/eyes/nose and etc., these words in Chinese are 苹果/鸭子/眼睛/鼻子, so the length of the query limitition should be > 1 , not > 2.

The update version:
  Search function can work very well in Chinese word searching. ;-D
Haotian.Wang 5 years ago
parent
commit
2533426f15
1 changed files with 1 additions and 1 deletions
  1. 1 1
      misago/threads/search.py

+ 1 - 1
misago/threads/search.py

@@ -21,7 +21,7 @@ class SearchThreads(SearchProvider):
         root_category = ThreadsRootCategory(self.request)
         root_category = ThreadsRootCategory(self.request)
         threads_categories = [root_category.unwrap()] + root_category.subcategories
         threads_categories = [root_category.unwrap()] + root_category.subcategories
 
 
-        if len(query) > 2:
+        if len(query) > 1:
             visible_threads = exclude_invisible_threads(
             visible_threads = exclude_invisible_threads(
                 self.request.user_acl, threads_categories, Thread.objects
                 self.request.user_acl, threads_categories, Thread.objects
             )
             )