mirror of
https://github.com/discourse/discourse.git
synced 2025-09-10 12:04:21 +08:00
PERF: optimise and improve topic similarity search
FIX: shows up similarity search with blank results
This commit is contained in:
parent
f20c5a02c7
commit
16b7004767
5 changed files with 56 additions and 16 deletions
|
@ -211,7 +211,11 @@ describe Topic do
|
|||
end
|
||||
|
||||
context 'with a similar topic' do
|
||||
let!(:topic) { Fabricate(:topic, title: "Evil trout is the dude who posted this topic") }
|
||||
let!(:topic) {
|
||||
ActiveRecord::Base.observers.enable :search_observer
|
||||
post = create_post(title: "Evil trout is the dude who posted this topic")
|
||||
post.topic
|
||||
}
|
||||
|
||||
it 'returns the similar topic if the title is similar' do
|
||||
Topic.similar_to("has evil trout made any topics?", "i am wondering has evil trout made any topics?").should == [topic]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue