mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-30 10:58:31 -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 = {})
|
def aggregate_search(opts = {})
|
||||||
post_sql = aggregate_post_sql(opts)
|
post_sql = aggregate_post_sql(opts)
|
||||||
|
|
||||||
aggregate_posts(post_sql[:default]).each {|p| @results.add(p)}
|
added = 0
|
||||||
if @results.posts.size < @limit
|
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) }
|
aggregate_posts(post_sql[:remaining]).each {|p| @results.add(p) }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue