A platform for community discussion. Free, open, simple.
DEV: Remove useless ordering when searching within a topic. (#14676)
Alan Guo Xiang Tan6544e3b02a00
diff --git a/lib/search.rb b/lib/search.rbindex dd5581d8863..231b5df29f6 100644--- a/lib/search.rb+++ b/lib/search.rb@@ -93,7 +93,6 @@ class Searchenddata = data.join(' ')-elsedata.squish!end@@ -990,7 +989,7 @@ class Search.push(@search_context.id)posts.where("topics.category_id in (?)", category_ids)- elsif @search_context.is_a?(Topic)+ elsif is_topic_searchposts.where("topics.id = #{@search_context.id}").order("posts.post_number #{@order == :latest ? "DESC" : ""}")elsif @search_context.is_a?(Tag)@@ -1028,7 +1027,7 @@ class Searchelseposts = posts.order("posts.like_count DESC")end- else+ elsif !is_topic_searchrank = <<~SQLTS_RANK_CD(post_search_data.search_data,