aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server/src/main/webapp/WEB-INF/app/controllers/search_controller.rb
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@gmail.com>2012-11-22 11:40:37 +0100
committerJulien Lancelot <julien.lancelot@gmail.com>2012-11-22 11:40:37 +0100
commitce05979da59099aaa3441828398d1cd06a60e883 (patch)
treea5bce3aeae84ff81f323d9537d32f5372e1bea7e /sonar-server/src/main/webapp/WEB-INF/app/controllers/search_controller.rb
parent86f812f12f3a9ea259e581f82887c48dc466ff79 (diff)
downloadsonarqube-ce05979da59099aaa3441828398d1cd06a60e883.tar.gz
sonarqube-ce05979da59099aaa3441828398d1cd06a60e883.zip
SONAR-3790 use distinct keywords in db query instead of a set to remove duplicate results
Diffstat (limited to 'sonar-server/src/main/webapp/WEB-INF/app/controllers/search_controller.rb')
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/search_controller.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/search_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/search_controller.rb
index bbc80bb41f8..90277e674de 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/search_controller.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/search_controller.rb
@@ -33,12 +33,11 @@ class SearchController < ApplicationController
key = search.downcase
results = ResourceIndex.find(:all,
- :select => 'resource_id,root_project_id,qualifier', # optimization to not load unused columns like 'kee'
+ :select => 'distinct(resource_id),root_project_id,qualifier', # optimization to not load unused columns like 'kee'
:conditions => ["kee like ?", key + '%'],
:order => 'name_size')
results = select_authorized(:user, results)
- results = Set.new(results) # do not want the same resource_index to appear many times in the result
@total = results.size
resource_ids=[]