mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 09:36:19 -05:00
FIX: Count the records added, including duplicates
This commit is contained in:
parent
aef954784a
commit
ec8622a860
1 changed files with 7 additions and 2 deletions
|
@ -721,8 +721,13 @@ class Search
|
|||
def aggregate_search(opts = {})
|
||||
post_sql = aggregate_post_sql(opts)
|
||||
|
||||
aggregate_posts(post_sql[:default]).each {|p| @results.add(p)}
|
||||
if @results.posts.size < @limit
|
||||
added = 0
|
||||
aggregate_posts(post_sql[:default]).each do |p|
|
||||
@results.add(p)
|
||||
added += 1
|
||||
end
|
||||
|
||||
if added < @limit
|
||||
aggregate_posts(post_sql[:remaining]).each {|p| @results.add(p) }
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue