]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-7609 remove usage of SearchType.COUNT
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Fri, 20 May 2016 13:35:24 +0000 (15:35 +0200)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Tue, 24 May 2016 21:12:58 +0000 (23:12 +0200)
server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java

index 6b77a9ce32c2f26793fcc58a9e21125a8c99726e..6b4f76a60647ac9e6bdf0f3ac9d00e9e147ebafd 100644 (file)
@@ -496,7 +496,7 @@ public class IssueIndex extends BaseIndex {
     SearchRequestBuilder esRequest = getClient()
       .prepareSearch(IssueIndexDefinition.INDEX)
       .setTypes(IssueIndexDefinition.TYPE_ISSUE)
-      .setSearchType(SearchType.COUNT);
+      .setSize(0);
     BoolFilterBuilder esFilter = FilterBuilders.boolFilter();
     for (FilterBuilder filter : filters.values()) {
       if (filter != null) {
@@ -666,7 +666,7 @@ public class IssueIndex extends BaseIndex {
     SearchRequestBuilder requestBuilder = getClient()
       .prepareSearch(IssueIndexDefinition.INDEX)
       // Avoids returning search hits
-      .setSearchType(SearchType.COUNT)
+      .setSize(0)
       .setTypes(IssueIndexDefinition.TYPE_ISSUE);
 
     requestBuilder.setQuery(QueryBuilders.filteredQuery(QueryBuilders.matchAllQuery(),