FIX: Count the records added, including duplicates
This commit is contained in:
parent
aef954784a
commit
ec8622a860
|
@ -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 New Issue