Commit 4543ef09 authored by Sean McGivern's avatar Sean McGivern

Merge branch '44353-improve-snippet-search-performance' into 'master'

Remove redundant counts in snippets search

Closes #44353

See merge request gitlab-org/gitlab-ce!23952
parents 8600043b 40f31486
......@@ -24,10 +24,10 @@ module SearchHelper
end
def search_entries_info(collection, scope, term)
return unless collection.count > 0
return if collection.to_a.empty?
from = collection.offset_value + 1
to = collection.offset_value + collection.count
to = collection.offset_value + collection.to_a.size
count = collection.total_count
"Showing #{from} - #{to} of #{count} #{scope.humanize(capitalize: false)} for \"#{term}\""
......
- if @search_objects.empty?
- if @search_objects.to_a.empty?
= render partial: "search/results/empty"
- else
.row-content-block
......
---
title: Improve snippet search performance by removing duplicate counts
merge_request: 23952
author:
type: performance
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment