summaryrefslogtreecommitdiffstats
path: root/config-model
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorncs@yahoo-inc.com>2017-03-29 16:19:31 +0200
committerBjørn Christian Seime <bjorncs@yahoo-inc.com>2017-04-03 11:20:29 +0200
commit4d4dc8840bf851bb013760c2b842a56ce019381d (patch)
tree9854de7f3cc993c399ab1c94a592d5beda32de90 /config-model
parente106383cfbf41f1691618fec1a2c3f5168c4c130 (diff)
Remove summary transform for implicit reference field source
Diffstat (limited to 'config-model')
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/documentmodel/SummaryField.java3
-rw-r--r--config-model/src/test/derived/reference_fields/ad.sd6
-rw-r--r--config-model/src/test/derived/reference_fields/attributes.cfg19
-rw-r--r--config-model/src/test/derived/reference_fields/summary.cfg8
4 files changed, 36 insertions, 0 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/documentmodel/SummaryField.java b/config-model/src/main/java/com/yahoo/vespa/documentmodel/SummaryField.java
index cb5f5d0a1ed..684a3abe2b2 100644
--- a/config-model/src/main/java/com/yahoo/vespa/documentmodel/SummaryField.java
+++ b/config-model/src/main/java/com/yahoo/vespa/documentmodel/SummaryField.java
@@ -249,6 +249,9 @@ public class SummaryField extends Field implements Cloneable, TypedKey {
}
public boolean hasSource(String name) {
+ if (sources.isEmpty() && name.equals(getName())) {
+ return true;
+ }
for (Source s : sources) {
if (s.getName().equals(name)) {
return true;
diff --git a/config-model/src/test/derived/reference_fields/ad.sd b/config-model/src/test/derived/reference_fields/ad.sd
index e6f084dbeed..b7ead570154 100644
--- a/config-model/src/test/derived/reference_fields/ad.sd
+++ b/config-model/src/test/derived/reference_fields/ad.sd
@@ -6,5 +6,11 @@ search ad {
field other_ref type reference<campaign> {
indexing: attribute
}
+ field yet_another_ref type reference<campaign> {
+ indexing: attribute
+ }
+ }
+ document-summary explicit_summary {
+ summary yet_another_ref type reference<campaign> {}
}
}
diff --git a/config-model/src/test/derived/reference_fields/attributes.cfg b/config-model/src/test/derived/reference_fields/attributes.cfg
index f657ed2b93b..b9446c596fd 100644
--- a/config-model/src/test/derived/reference_fields/attributes.cfg
+++ b/config-model/src/test/derived/reference_fields/attributes.cfg
@@ -36,3 +36,22 @@ attribute[].lowerbound -9223372036854775808
attribute[].upperbound 9223372036854775807
attribute[].densepostinglistthreshold 0.4
attribute[].tensortype ""
+attribute[].name "yet_another_ref"
+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 ""
diff --git a/config-model/src/test/derived/reference_fields/summary.cfg b/config-model/src/test/derived/reference_fields/summary.cfg
index 429a179faac..49037473d88 100644
--- a/config-model/src/test/derived/reference_fields/summary.cfg
+++ b/config-model/src/test/derived/reference_fields/summary.cfg
@@ -9,6 +9,14 @@ classes[].fields[].name "summaryfeatures"
classes[].fields[].type "featuredata"
classes[].fields[].name "documentid"
classes[].fields[].type "longstring"
+classes[].id 428144659
+classes[].name "explicit_summary"
+classes[].fields[].name "yet_another_ref"
+classes[].fields[].type "longstring"
+classes[].fields[].name "rankfeatures"
+classes[].fields[].type "featuredata"
+classes[].fields[].name "summaryfeatures"
+classes[].fields[].type "featuredata"
classes[].id 1274088866
classes[].name "attributeprefetch"
classes[].fields[].name "rankfeatures"