summaryrefslogtreecommitdiffstats
path: root/config-model
diff options
context:
space:
mode:
Diffstat (limited to 'config-model')
-rw-r--r--config-model/src/main/java/com/yahoo/searchdefinition/processing/ReferenceFieldsProcessor.java13
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/AbstractService.java2
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/HostResource.java10
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/Container.java1
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java8
-rw-r--r--config-model/src/test/derived/importedfields/attributes.cfg20
-rw-r--r--config-model/src/test/derived/importedfields/child.sd2
-rw-r--r--config-model/src/test/derived/importedfields/index-info.cfg6
-rw-r--r--config-model/src/test/derived/importedfields/summary.cfg10
9 files changed, 58 insertions, 14 deletions
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/processing/ReferenceFieldsProcessor.java b/config-model/src/main/java/com/yahoo/searchdefinition/processing/ReferenceFieldsProcessor.java
index 2c5c237f840..f29d53d1c86 100644
--- a/config-model/src/main/java/com/yahoo/searchdefinition/processing/ReferenceFieldsProcessor.java
+++ b/config-model/src/main/java/com/yahoo/searchdefinition/processing/ReferenceFieldsProcessor.java
@@ -29,6 +29,19 @@ public class ReferenceFieldsProcessor extends Processor {
@Override
public void process() {
+ clearSummaryAttributeAspectForConcreteFields();
+ clearSummaryAttributeAspectForExplicitSummaryFields();
+ }
+
+ private void clearSummaryAttributeAspectForExplicitSummaryFields() {
+ for (DocumentSummary docSum : search.getSummaries().values()) {
+ docSum.getSummaryFields().stream()
+ .filter(summaryField -> summaryField.getDataType() instanceof ReferenceDataType)
+ .forEach(summaryField -> summaryField.setTransform(SummaryTransform.NONE));
+ }
+ }
+
+ private void clearSummaryAttributeAspectForConcreteFields() {
for (SDField field : search.allConcreteFields()) {
if (field.getDataType() instanceof ReferenceDataType) {
removeFromAttributePrefetchSummaryClass(field);
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/AbstractService.java b/config-model/src/main/java/com/yahoo/vespa/model/AbstractService.java
index 57635281bd8..6d4945f23ad 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/AbstractService.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/AbstractService.java
@@ -551,6 +551,6 @@ public abstract class AbstractService extends AbstractConfigProducer<AbstractCon
@Override
public String toString() {
- return getServiceName() + " on " + getHost().toString();
+ return getServiceName() + " on " + (getHost() == null ? "no host" : getHost().toString());
}
}
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/HostResource.java b/config-model/src/main/java/com/yahoo/vespa/model/HostResource.java
index cdfe1d706d7..bc890755ca9 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/HostResource.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/HostResource.java
@@ -22,8 +22,7 @@ import java.util.stream.Collectors;
* TODO: Merge with {@link Host}
* Host resources are ordered by their host order.
*
- * @author lulf
- * @since 5.12
+ * @author Ulf Lillengen
*/
public class HostResource implements Comparable<HostResource> {
@@ -31,8 +30,9 @@ public class HostResource implements Comparable<HostResource> {
final static int MAX_PORTS = 799;
private final Host host;
- // Map from "sentinel name" to service
+ /** Map from "sentinel name" to service */
private final Map<String, Service> services = new LinkedHashMap<>();
+
private final Map<Integer, Service> portDB = new LinkedHashMap<>();
private int allocatedPorts = 0;
@@ -74,9 +74,7 @@ public class HostResource implements Comparable<HostResource> {
}
range++;
}
- return range == numPorts ?
- port - range :
- 0;
+ return range == numPorts ? port - range : 0;
}
/**
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/Container.java b/config-model/src/main/java/com/yahoo/vespa/model/container/Container.java
index 9a2c631a17b..b015e25f7ea 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/container/Container.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/container/Container.java
@@ -51,6 +51,7 @@ public class Container extends AbstractService implements
ContainerHttpConfig.Producer,
ContainerMbusConfig.Producer,
ClusterMemberInfoConfig.Producer {
+
public static final int BASEPORT = Defaults.getDefaults().vespaWebServicePort();
public static final String SINGLENODE_CONTAINER_SERVICESPEC = "default_singlenode_container";
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java b/config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java
index fe473015d3e..49229fcc87a 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java
@@ -62,7 +62,7 @@ import java.util.function.Consumer;
import java.util.stream.Collectors;
/**
- * @author tonytv
+ * @author Tony Vaagenes
*/
public class ContainerModelBuilder extends ConfigModelBuilder<ContainerModel> {
@@ -552,10 +552,10 @@ public class ContainerModelBuilder extends ConfigModelBuilder<ContainerModel> {
private List<Container> createNodesFromNodeList(ContainerCluster cluster, Element nodesElement) {
List<Container> nodes = new ArrayList<>();
- int nodeCount = 0;
+ int nodeIndex = 0;
for (Element nodeElem: XML.getChildren(nodesElement, "node")) {
- nodes.add(new ContainerServiceBuilder("container." + nodeCount, nodeCount).build(cluster, nodeElem));
- nodeCount++;
+ nodes.add(new ContainerServiceBuilder("container." + nodeIndex, nodeIndex).build(cluster, nodeElem));
+ nodeIndex++;
}
return nodes;
}
diff --git a/config-model/src/test/derived/importedfields/attributes.cfg b/config-model/src/test/derived/importedfields/attributes.cfg
index 74348377ceb..62fe0052bc3 100644
--- a/config-model/src/test/derived/importedfields/attributes.cfg
+++ b/config-model/src/test/derived/importedfields/attributes.cfg
@@ -38,6 +38,26 @@ attribute[].upperbound 9223372036854775807
attribute[].densepostinglistthreshold 0.4
attribute[].tensortype ""
attribute[].imported false
+attribute[].name "b_ref_with_summary"
+attribute[].datatype REFERENCE
+attribute[].collectiontype SINGLE
+attribute[].removeifzero false
+attribute[].createifnonexistent false
+attribute[].fastsearch false
+attribute[].huge false
+attribute[].sortascending true
+attribute[].sortfunction UCA
+attribute[].sortstrength PRIMARY
+attribute[].sortlocale ""
+attribute[].enablebitvectors false
+attribute[].enableonlybitvector false
+attribute[].fastaccess false
+attribute[].arity 8
+attribute[].lowerbound -9223372036854775808
+attribute[].upperbound 9223372036854775807
+attribute[].densepostinglistthreshold 0.4
+attribute[].tensortype ""
+attribute[].imported false
attribute[].name "my_int_field"
attribute[].datatype INT32
attribute[].collectiontype SINGLE
diff --git a/config-model/src/test/derived/importedfields/child.sd b/config-model/src/test/derived/importedfields/child.sd
index 75063be1d1d..703451c1293 100644
--- a/config-model/src/test/derived/importedfields/child.sd
+++ b/config-model/src/test/derived/importedfields/child.sd
@@ -3,6 +3,7 @@ search child {
document child {
field a_ref type reference<parent_a> { indexing: attribute }
field b_ref type reference<parent_b> { indexing: attribute }
+ field b_ref_with_summary type reference<parent_b> { indexing: attribute | summary }
}
import field a_ref.int_field as my_int_field {}
import field b_ref.string_field as my_string_field {}
@@ -15,6 +16,7 @@ search child {
document-summary mysummary {
summary a_ref type reference<parent_a> {}
+ summary b_ref_with_summary type reference<parent_b> {}
summary my_int_field type int {}
summary my_string_field type string {}
summary my_int_array_field type array<int> {}
diff --git a/config-model/src/test/derived/importedfields/index-info.cfg b/config-model/src/test/derived/importedfields/index-info.cfg
index b33091bff04..7cb53c480ce 100644
--- a/config-model/src/test/derived/importedfields/index-info.cfg
+++ b/config-model/src/test/derived/importedfields/index-info.cfg
@@ -15,6 +15,12 @@ indexinfo[].command[].indexname "b_ref"
indexinfo[].command[].command "attribute"
indexinfo[].command[].indexname "b_ref"
indexinfo[].command[].command "word"
+indexinfo[].command[].indexname "b_ref_with_summary"
+indexinfo[].command[].command "index"
+indexinfo[].command[].indexname "b_ref_with_summary"
+indexinfo[].command[].command "attribute"
+indexinfo[].command[].indexname "b_ref_with_summary"
+indexinfo[].command[].command "word"
indexinfo[].command[].indexname "rankfeatures"
indexinfo[].command[].command "index"
indexinfo[].command[].indexname "summaryfeatures"
diff --git a/config-model/src/test/derived/importedfields/summary.cfg b/config-model/src/test/derived/importedfields/summary.cfg
index 95a9c2bb318..17bb1fd1e23 100644
--- a/config-model/src/test/derived/importedfields/summary.cfg
+++ b/config-model/src/test/derived/importedfields/summary.cfg
@@ -1,16 +1,20 @@
-defaultsummaryid 1151071433
-classes[].id 1151071433
+defaultsummaryid 1294344677
+classes[].id 1294344677
classes[].name "default"
+classes[].fields[].name "b_ref_with_summary"
+classes[].fields[].type "longstring"
classes[].fields[].name "rankfeatures"
classes[].fields[].type "featuredata"
classes[].fields[].name "summaryfeatures"
classes[].fields[].type "featuredata"
classes[].fields[].name "documentid"
classes[].fields[].type "longstring"
-classes[].id 665629335
+classes[].id 762794406
classes[].name "mysummary"
classes[].fields[].name "a_ref"
classes[].fields[].type "longstring"
+classes[].fields[].name "b_ref_with_summary"
+classes[].fields[].type "longstring"
classes[].fields[].name "my_int_field"
classes[].fields[].type "integer"
classes[].fields[].name "my_string_field"