FIX: Search in non-english should have a smaller minimum

This commit is contained in:
Robin Ward 2016-08-09 15:20:28 -04:00
parent fd3a8583dd
commit cc366d5a60
2 changed files with 3 additions and 1 deletions

View file

@ -178,7 +178,7 @@ class Search
@valid = false
return
end
@term = terms.join(' ')
@term = terms.join(' ') if @term.include?(' ')
end
# If the term is a number or url to a topic, just include that topic

View file

@ -413,6 +413,7 @@ describe Search do
skip("skipped until pg app installs the db correctly") if RbConfig::CONFIG["arch"] =~ /darwin/
SiteSetting.default_locale = 'zh_TW'
SiteSetting.min_search_term_length = 1
topic = Fabricate(:topic, title: 'My Title Discourse社區指南')
post = Fabricate(:post, topic: topic)
@ -424,6 +425,7 @@ describe Search do
skip("skipped until pg app installs the db correctly") if RbConfig::CONFIG["arch"] =~ /darwin/
SiteSetting.search_tokenize_chinese_japanese_korean = true
SiteSetting.min_search_term_length = 1
topic = Fabricate(:topic, title: 'My Title Discourse社區指南')
post = Fabricate(:post, topic: topic)