Skip to content

Commit

Permalink
fix(search): tidb do not support 'select where'
Browse files Browse the repository at this point in the history
  • Loading branch information
wd0517 committed Feb 17, 2020
1 parent bf79f36 commit da4fc44
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@ def posts_query(limit, opts = nil)
def categories_ignored(posts)
posts.where(<<~SQL, Searchable::PRIORITIES[:ignore])
categories.id NOT IN (
SELECT categories.id WHERE categories.search_priority = ?
SELECT categories.id FROM DUAL WHERE categories.search_priority = ?
)
SQL
end
Expand Down Expand Up @@ -852,7 +852,7 @@ def aggregate_posts(post_sql)

posts_eager_loads(Post)
.joins("JOIN (#{post_sql}) x ON x.id = posts.topic_id AND x.post_number = posts.post_number")
.order('row_number')
.order('`row_number`')
end

def aggregate_search(opts = {})
Expand Down

0 comments on commit da4fc44

Please sign in to comment.