]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5529 - Fixed BaseIndex for source and updated ES Types for domain objects
authorStephane Gamard <stephane.gamard@sonarsource.com>
Sun, 31 Aug 2014 15:52:29 +0000 (17:52 +0200)
committerStephane Gamard <stephane.gamard@sonarsource.com>
Sun, 31 Aug 2014 15:52:29 +0000 (17:52 +0200)
server/sonar-server/src/main/java/org/sonar/server/search/BaseIndex.java
server/sonar-server/src/main/java/org/sonar/server/search/IndexDefinition.java

index f4baaf004b8e6fde26d9695f93ed1b1bcdebecfb..1aa47aeb866ed926a5d6afc8cc65bf655026ec19 100644 (file)
@@ -103,7 +103,7 @@ public abstract class BaseIndex<DOMAIN, DTO extends Dto<KEY>, KEY extends Serial
     // nothing to do
   }
 
-  public SearchClient getClient(){
+  public SearchClient getClient() {
     return client;
   }
 
@@ -381,6 +381,7 @@ public abstract class BaseIndex<DOMAIN, DTO extends Dto<KEY>, KEY extends Serial
       .setType(this.getIndexType())
       .setIndex(this.getIndexName())
       .setId(this.getKeyValue(key))
+      .setFetchSource(true)
       .setRouting(this.getKeyValue(key));
 
     GetResponse response = client.execute(request);
@@ -418,7 +419,6 @@ public abstract class BaseIndex<DOMAIN, DTO extends Dto<KEY>, KEY extends Serial
       .get().getCount();
   }
 
-
   public Map<String, Long> countByField(IndexField indexField, FilterBuilder filter) {
     Map<String, Long> counts = new HashMap<String, Long>();
 
index 3bef085c511ccfaa8602e6917cec4f7513db0392..0d16ff4b972186e3805d008b74a4f313bec9d4b6 100644 (file)
@@ -50,11 +50,10 @@ public class IndexDefinition {
     return MANAGEMENT_TYPE;
   }
 
-  public static final IndexDefinition RULE = new IndexDefinition("rules", "rules");
-  public static final IndexDefinition ACTIVE_RULE = new IndexDefinition("rules", "activeRules");
-  public static final IndexDefinition ISSUES = new IndexDefinition("issues", "issues");
-  public static final IndexDefinition LOG = new IndexDefinition("logs", "sonarLogs");
-
+  public static final IndexDefinition RULE = new IndexDefinition("rules", "rule");
+  public static final IndexDefinition ACTIVE_RULE = new IndexDefinition("rules", "activeRule");
+  public static final IndexDefinition ISSUES = new IndexDefinition("issues", "issue");
+  public static final IndexDefinition LOG = new IndexDefinition("logs", "sonarLog");
 
   @VisibleForTesting
   protected static IndexDefinition TEST = new IndexDefinition("test", "test");