diff options
Diffstat (limited to 'config-model/src')
3 files changed, 16 insertions, 14 deletions
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/derived/SummaryClass.java b/config-model/src/main/java/com/yahoo/searchdefinition/derived/SummaryClass.java index 68966d39d7d..6c233aacf30 100644 --- a/config-model/src/main/java/com/yahoo/searchdefinition/derived/SummaryClass.java +++ b/config-model/src/main/java/com/yahoo/searchdefinition/derived/SummaryClass.java @@ -31,9 +31,9 @@ public class SummaryClass extends Derived { private final boolean omitSummaryFeatures; /** The summary fields of this indexed by name */ - private Map<String,SummaryClassField> fields = new java.util.LinkedHashMap<>(); + private final Map<String,SummaryClassField> fields = new java.util.LinkedHashMap<>(); - private DeployLogger deployLogger; + private final DeployLogger deployLogger; private final Random random = new Random(7); @@ -78,9 +78,9 @@ public class SummaryClass extends Derived { private void addField(String name, DataType type, SummaryTransform transform) { if (fields.containsKey(name)) { SummaryClassField sf = fields.get(name); - if (!SummaryClassField.convertDataType(type, transform, rawAsBase64).equals(sf.getType())) { - deployLogger.logApplicationPackage(Level.WARNING, "Conflicting definition of field " + name + ". " + - "Declared as type " + sf.getType() + " and " + type); + if ( SummaryClassField.convertDataType(type, transform, rawAsBase64) != sf.getType()) { + deployLogger.logApplicationPackage(Level.WARNING, "Conflicting definition of field " + name + + ". " + "Declared as type " + sf.getType() + " and " + type); } } else { fields.put(name, new SummaryClassField(name, type, transform, rawAsBase64)); @@ -106,6 +106,7 @@ public class SummaryClass extends Derived { public int getFieldCount() { return fields.size(); } + @Override public int hashCode() { int number = 1; int hash = getName().hashCode(); @@ -143,6 +144,7 @@ public class SummaryClass extends Derived { @Override protected String getDerivedName() { return "summary"; } + @Override public String toString() { return "summary class " + getName(); } diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/processing/ImplicitSummaries.java b/config-model/src/main/java/com/yahoo/searchdefinition/processing/ImplicitSummaries.java index ef2e75cfcd8..9eb8b921e81 100644 --- a/config-model/src/main/java/com/yahoo/searchdefinition/processing/ImplicitSummaries.java +++ b/config-model/src/main/java/com/yahoo/searchdefinition/processing/ImplicitSummaries.java @@ -32,7 +32,7 @@ public class ImplicitSummaries extends Processor { DocumentSummary defaultSummary = schema.getSummariesInThis().get("default"); if (defaultSummary == null) { defaultSummary = new DocumentSummary("default", schema); - defaultSummary.setFromDisk(true); // TODO: Not necessarily + defaultSummary.setFromDisk(true); // As we add documentid to this schema.addSummary(defaultSummary); } @@ -164,13 +164,13 @@ public class ImplicitSummaries extends Processor { throw newProcessException(schema, summaryField, "Source field '" + fieldName + "' does not exist."); } if (! sourceField.doesSummarying() && - ! summaryField.getTransform().equals(SummaryTransform.ATTRIBUTE) && - ! summaryField.getTransform().equals(SummaryTransform.GEOPOS)) + summaryField.getTransform() != SummaryTransform.ATTRIBUTE && + summaryField.getTransform() != SummaryTransform.GEOPOS) { // Summary transform attribute may indicate that the ilscript was rewritten to remove summary // by another search that uses this same field in inheritance. deployLogger.logApplicationPackage(Level.WARNING, "Ignoring " + summaryField + ": " + sourceField + - " is not creating a summary value in its indexing statement"); + " is not creating a summary value in its indexing statement"); return false; } diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/processing/MakeDefaultSummaryTheSuperSet.java b/config-model/src/main/java/com/yahoo/searchdefinition/processing/MakeDefaultSummaryTheSuperSet.java index f38de14bb9e..49a56bafe2a 100644 --- a/config-model/src/main/java/com/yahoo/searchdefinition/processing/MakeDefaultSummaryTheSuperSet.java +++ b/config-model/src/main/java/com/yahoo/searchdefinition/processing/MakeDefaultSummaryTheSuperSet.java @@ -10,20 +10,20 @@ import com.yahoo.vespa.documentmodel.SummaryTransform; import com.yahoo.vespa.model.container.search.QueryProfiles; /** - * <p>All summary fields which are not attributes + * All summary fields which are not attributes * must currently be present in the default summary class, * since the default summary class also defines the docsum.dat format. * This processor adds any missing summaries to the default summary. * When that is decoupled from the actual summaries returned, this * processor can be removed. Note: the StreamingSummary also takes advantage of - * the fact that default is the superset.</p> + * the fact that default is the superset. * - * <p>All other summary logic should work unchanged without this processing step + * All other summary logic should work unchanged without this processing step * except that IndexStructureValidator.validateSummaryFields must be changed to * consider all summaries, not just the default, i.e change to - * if (search.getSummaryField(expr.getFieldName()) == null)</p> + * if (search.getSummaryField(expr.getFieldName()) == null) * - * <p>This must be done after other summary processors.</p> + * This must be done after other summary processors. * * @author bratseth */ |