mirror of
https://github.com/discourse/discourse.git
synced 2025-06-06 22:06:46 +08:00
FIX: don't stem the search term
Search for "canned" not working correctly and "butted", "ands" and many more :)
This commit is contained in:
@ -663,7 +663,7 @@ class Search
|
||||
def self.ts_query(term, locale = nil, joiner = "&")
|
||||
|
||||
data = Post.exec_sql("SELECT to_tsvector(:locale, :term)",
|
||||
locale: locale || long_locale,
|
||||
locale: 'simple',
|
||||
term: term
|
||||
).values[0][0]
|
||||
|
||||
|
@ -323,6 +323,11 @@ describe Search do
|
||||
end
|
||||
end
|
||||
|
||||
it 'does not tokenize search term' do
|
||||
Fabricate(:post, raw: 'thing is canned should still be found!')
|
||||
expect(Search.execute('canned').posts).to be_present
|
||||
end
|
||||
|
||||
context 'categories' do
|
||||
|
||||
let!(:category) { Fabricate(:category) }
|
||||
|
Reference in New Issue
Block a user