From: Simon Brandhof Date: Tue, 16 Dec 2014 20:43:22 +0000 (+0100) Subject: Prepare removal of BaseIndex from IssueIndex X-Git-Tag: latest-silver-master-#65~494 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a0cf1e569694f72edf2316623099ea4c27f10fd4;p=sonarqube.git Prepare removal of BaseIndex from IssueIndex --- diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java b/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java index a01f0f9eeae..dcb1c35b8f3 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java @@ -136,9 +136,8 @@ public class IssueIndex extends BaseIndex { 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 { public Result 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 { FilterBuilders.andFilter(projectFilter, dateFilter) ); - getClient().prepareDeleteByQuery(getIndexName()).setQuery(queryBuilder).get(); + getClient().prepareDeleteByQuery(IssueIndexDefinition.INDEX).setQuery(queryBuilder).get(); } /* Build main filter (match based) */