]> source.dussan.org Git - sonarqube.git/commitdiff
Prepare removal of BaseIndex from IssueIndex
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Tue, 16 Dec 2014 20:43:22 +0000 (21:43 +0100)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Tue, 16 Dec 2014 20:43:22 +0000 (21:43 +0100)
server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java

index a01f0f9eeae994a88d67992890e411fce76a6d29..dcb1c35b8f3579444ff13148d6bf84ddbd851e6b 100644 (file)
@@ -136,9 +136,8 @@ public class IssueIndex extends BaseIndex<Issue, FakeIssueDto, String> {
     QueryContext queryContext = new QueryContext().setPage(1, 0);
 
     SearchRequestBuilder esSearch = getClient()
-      .prepareSearch(this.getIndexName())
-      .setTypes(this.getIndexType())
-      .setIndices(this.getIndexName());
+      .prepareSearch(IssueIndexDefinition.INDEX)
+      .setTypes(IssueIndexDefinition.TYPE_ISSUE);
 
     QueryBuilder esQuery = QueryBuilders.matchAllQuery();
     BoolFilterBuilder esFilter = getFilter(query, queryContext);
@@ -166,9 +165,8 @@ public class IssueIndex extends BaseIndex<Issue, FakeIssueDto, String> {
 
   public Result<Issue> search(IssueQuery query, QueryContext options) {
     SearchRequestBuilder esSearch = getClient()
-      .prepareSearch(this.getIndexName())
-      .setTypes(this.getIndexType())
-      .setIndices(this.getIndexName());
+      .prepareSearch(IssueIndexDefinition.INDEX)
+      .setTypes(IssueIndexDefinition.TYPE_ISSUE);
 
     if (options.isScroll()) {
       esSearch.setSearchType(SearchType.SCAN);
@@ -217,7 +215,7 @@ public class IssueIndex extends BaseIndex<Issue, FakeIssueDto, String> {
       FilterBuilders.andFilter(projectFilter, dateFilter)
       );
 
-    getClient().prepareDeleteByQuery(getIndexName()).setQuery(queryBuilder).get();
+    getClient().prepareDeleteByQuery(IssueIndexDefinition.INDEX).setQuery(queryBuilder).get();
   }
 
   /* Build main filter (match based) */