]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-11791 fix no more highlighting in component search
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Fri, 15 Mar 2019 14:56:14 +0000 (15:56 +0100)
committerSonarTech <sonartech@sonarsource.com>
Tue, 19 Mar 2019 19:21:26 +0000 (20:21 +0100)
higlighting requires initial value of field stored, either in source or as a stored field
Source used to be stored in the Component Idex.
To reduce impact on index size, we will make only the name field stored in the Component Index

server/sonar-server-common/src/main/java/org/sonar/server/component/index/ComponentIndexDefinition.java

index 42916f12d2906072dff2d60c76bfe3823496a2fa..dde34c989a09f3f5568c4a0bac2891cad34e6b8e 100644 (file)
@@ -88,6 +88,8 @@ public class ComponentIndexDefinition implements IndexDefinition {
     mapping.keywordFieldBuilder(FIELD_KEY).addSubFields(SORTABLE_ANALYZER).build();
     mapping.textFieldBuilder(FIELD_NAME)
       .withFieldData()
+      // required by highlighting
+      .store()
       .termVectorWithPositionOffsets()
       .addSubFields(NAME_ANALYZERS)
       .build();