From cc366d5a6022d0e887861dde99db9ee0dd961eb9 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Tue, 9 Aug 2016 15:20:28 -0400 Subject: [PATCH] FIX: Search in non-english should have a smaller minimum --- lib/search.rb | 2 +- spec/components/search_spec.rb | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/search.rb b/lib/search.rb index 38024cfcd..007aa7a2d 100644 --- a/lib/search.rb +++ b/lib/search.rb @@ -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 diff --git a/spec/components/search_spec.rb b/spec/components/search_spec.rb index f7dac7167..287676e16 100644 --- a/spec/components/search_spec.rb +++ b/spec/components/search_spec.rb @@ -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)