diff options
Diffstat (limited to 'config-model/src/main/java/com/yahoo/searchdefinition/document/SDField.java')
-rw-r--r-- | config-model/src/main/java/com/yahoo/searchdefinition/document/SDField.java | 34 |
1 files changed, 10 insertions, 24 deletions
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/document/SDField.java b/config-model/src/main/java/com/yahoo/searchdefinition/document/SDField.java index 93b3ff29e13..c657d29033a 100644 --- a/config-model/src/main/java/com/yahoo/searchdefinition/document/SDField.java +++ b/config-model/src/main/java/com/yahoo/searchdefinition/document/SDField.java @@ -29,7 +29,6 @@ import com.yahoo.vespa.indexinglanguage.parser.ParseException; import java.util.Collection; import java.util.Collections; import java.util.HashMap; -import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.ListIterator; @@ -220,9 +219,6 @@ public class SDField extends Field implements TypedKey, FieldOperationContainer, } @Override - public ImmutableSDField getBackingField() { return this; } - - @Override public boolean doesAttributing() { return containsExpression(AttributeExpression.class); } @@ -513,20 +509,9 @@ public class SDField extends Field implements TypedKey, FieldOperationContainer, this.indexStructureField = indexStructureField; } - /** - * Returns an iterator of the index names this should index to - * (whether set explicitly or not) - */ - public Iterator<String> getFieldNameAsIterator() { // TODO: Replace usage by getName - return Collections.singletonList(getName()).iterator(); - } - - /** Returns 1 if this is indexed, 0 if it is not indexed */ // TODO: Replace by a boolean method, or something, see hasIndex - public int getIndexToCount() { - if (getIndexingScript() == null) return 0; - if (!doesIndexing()) return 0; - - return 1; + @Override + public boolean hasIndex() { + return (getIndexingScript() != null) && doesIndexing(); } /** Sets the literal boost of this field */ @@ -537,12 +522,14 @@ public class SDField extends Field implements TypedKey, FieldOperationContainer, * when a query term matched as query term exactly (unnormalized and unstemmed). * Default is non-positive. */ + @Override public int getLiteralBoost() { return literalBoost; } /** Sets the weight of this field */ public void setWeight(int weight) { this.weight=weight; } /** Returns the weight of this field, or 0 if nothing is set */ + @Override public int getWeight() { return weight; } /** @@ -600,20 +587,17 @@ public class SDField extends Field implements TypedKey, FieldOperationContainer, * Returns an index if this field has one (implicitly or * explicitly) targeting the given name. */ + @Override public boolean existsIndex(String name) { if (indices.get(name) != null) return true; - if (name.equals(getName())) { - if (doesIndexing()) { - return true; - } - } - return false; + return name.equals(getName()) && doesIndexing(); } /** * Defined indices on this field * @return defined indices on this */ + @Override public Map<String, Index> getIndices() { return indices; } @@ -638,6 +622,7 @@ public class SDField extends Field implements TypedKey, FieldOperationContainer, public Ranking getRanking() { return ranking; } /** Returns the default rank type of indices of this field, or null if nothing is set */ + @Override public RankType getRankType() { return this.rankType; } /** @@ -712,6 +697,7 @@ public class SDField extends Field implements TypedKey, FieldOperationContainer, * Returns a summary field defined (implicitly or explicitly) by this field. * Returns null if there is no such summary field defined. */ + @Override public SummaryField getSummaryField(String name) { return summaryFields.get(name); } |