diff options
author | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2017-07-13 15:47:00 +0200 |
---|---|---|
committer | Daniel Schwarz <bartfastiel@users.noreply.github.com> | 2017-08-09 15:09:54 +0200 |
commit | e9bc2b0915e620e0c8ea81e94ac6353e8ab67961 (patch) | |
tree | 702f1f2e015ca887ca1645602faef954c5a71011 /server/sonar-server/src | |
parent | fba6ad10cd608de676bf1672db821651f2913c3d (diff) | |
download | sonarqube-e9bc2b0915e620e0c8ea81e94ac6353e8ab67961.tar.gz sonarqube-e9bc2b0915e620e0c8ea81e94ac6353e8ab67961.zip |
SONAR-8798 term_vector only an analyzed keyword fields
Diffstat (limited to 'server/sonar-server/src')
3 files changed, 5 insertions, 6 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/component/index/ComponentIndexDefinition.java b/server/sonar-server/src/main/java/org/sonar/server/component/index/ComponentIndexDefinition.java index 5a77c847914..593334fb608 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/component/index/ComponentIndexDefinition.java +++ b/server/sonar-server/src/main/java/org/sonar/server/component/index/ComponentIndexDefinition.java @@ -62,7 +62,7 @@ public class ComponentIndexDefinition implements IndexDefinition { mapping.keywordFieldBuilder(FIELD_PROJECT_UUID).disableNorms().build(); mapping.keywordFieldBuilder(FIELD_KEY).addSubFields(SORTABLE_ANALYZER).build(); mapping.keywordFieldBuilder(FIELD_NAME) - .termVectorWithPositionOffsets() + .termVectorWithPositionOffsetsForAllSubfields() .addSubFields(NAME_ANALYZERS) .build(); diff --git a/server/sonar-server/src/main/java/org/sonar/server/es/NewIndex.java b/server/sonar-server/src/main/java/org/sonar/server/es/NewIndex.java index a4fb706fd99..42071805208 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/es/NewIndex.java +++ b/server/sonar-server/src/main/java/org/sonar/server/es/NewIndex.java @@ -241,7 +241,7 @@ public class NewIndex { /** * Position offset term vectors are required for the fast_vector_highlighter (fvh). */ - public KeywordFieldBuilder termVectorWithPositionOffsets() { + public KeywordFieldBuilder termVectorWithPositionOffsetsForAllSubfields() { this.termVectorWithPositionOffsets = true; return this; } @@ -283,9 +283,7 @@ public class NewIndex { multiFields.put(fieldName, ImmutableMap.of( "type", FIELD_TYPE_KEYWORD, "index", INDEX_SEARCHABLE, - "term_vector", termVectorWithPositionOffsets ? "with_positions_offsets" : "no", - "norms", - "false" + "norms", "false" )); hash.put("fields", multiFields); diff --git a/server/sonar-server/src/main/java/org/sonar/server/rule/index/RuleIndex.java b/server/sonar-server/src/main/java/org/sonar/server/rule/index/RuleIndex.java index c49f11dbe5f..3842a5b6275 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/rule/index/RuleIndex.java +++ b/server/sonar-server/src/main/java/org/sonar/server/rule/index/RuleIndex.java @@ -325,7 +325,8 @@ public class RuleIndex { QProfileDto compareToQProfile = query.getCompareToQProfile(); if (compareToQProfile != null) { filters.put("comparison", - QueryBuilders.hasChildQuery(INDEX_TYPE_ACTIVE_RULE.getType(), + QueryBuilders.hasChildQuery( + INDEX_TYPE_ACTIVE_RULE.getType(), boolQuery().must(QueryBuilders.termQuery(FIELD_ACTIVE_RULE_PROFILE_UUID, compareToQProfile.getRulesProfileUuid())), ScoreMode.None)); } |