mirror of
https://github.com/discourse/discourse.git
synced 2025-06-02 04:08:41 +08:00
Work in progress, full page search
This commit is contained in:
@ -452,10 +452,6 @@ class Search
|
||||
# double wrapping so we get correct row numbers
|
||||
post_sql = "SELECT *, row_number() over() row_number FROM (#{post_sql}) xxx"
|
||||
|
||||
# p Topic.exec_sql(post_sql).to_a
|
||||
# puts post_sql
|
||||
# p Topic.exec_sql("SELECT topic_id FROM topic_allowed_users WHERE user_id = 2").to_a
|
||||
|
||||
posts = Post.includes(:topic => :category)
|
||||
.joins("JOIN (#{post_sql}) x ON x.id = posts.topic_id AND x.post_number = posts.post_number")
|
||||
.order('row_number')
|
||||
|
Reference in New Issue
Block a user