diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2013-03-24 23:46:17 -0400 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2013-03-24 23:46:17 -0400 |
commit | b01c07ac0ee3f169bcb0de589f940b53b54ec963 (patch) | |
tree | 8c81c09370be055df63c7ccb1f294ec0aaf721a0 /askbot/search | |
parent | 1fd1afb5e44a205d1ae51f6e8cc451c0ceb23fd0 (diff) | |
download | askbot-b01c07ac0ee3f169bcb0de589f940b53b54ec963.tar.gz askbot-b01c07ac0ee3f169bcb0de589f940b53b54ec963.tar.bz2 askbot-b01c07ac0ee3f169bcb0de589f940b53b54ec963.zip |
added a hack for short japanese queries
Diffstat (limited to 'askbot/search')
-rw-r--r-- | askbot/search/postgresql/__init__.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/askbot/search/postgresql/__init__.py b/askbot/search/postgresql/__init__.py index e42190a8..d71b824f 100644 --- a/askbot/search/postgresql/__init__.py +++ b/askbot/search/postgresql/__init__.py @@ -65,6 +65,11 @@ def run_full_text_search(query_set, query_text, text_search_vector_name): language_code = get_language() + #a hack with japanese search for the short queries + if language_code == 'ja' and len(query_text) in (1, 2): + mul = 4/len(query_text) #4 for 1 and 2 for 2 + query_text = (query_text + ' ')*mul + #the table name is a hack, because user does not have the language code is_multilingual = getattr(django_settings, 'ASKBOT_MULTILINGUAL', True) if is_multilingual and table_name == 'askbot_thread': |