PERF: Use DB to ennumerate full results count

This commit is contained in:
Justin DiRose 2020-06-16 15:51:15 -05:00
parent 90f8bdf945
commit 9cd93e57d6
No known key found for this signature in database
GPG Key ID: D8FDAB7887969D0F
1 changed files with 2 additions and 2 deletions

View File

@ -72,7 +72,7 @@ module KnowledgeExplorer
pd.search_data @@ #{escaped_ts_query}
)
SQL
search_count = results.count
search_count = results.size
end
if @filters[:order] == "title"
@ -99,7 +99,7 @@ module KnowledgeExplorer
categories = results.where('topics.category_id IS NOT NULL').group('topics.category_id').count
categories = create_categories_object(categories)
results_length = results.length
results_length = results.size
if @filters[:page]
offset = @filters[:page].to_i * @limit