diff options
author | Bjørn Christian Seime <bjorncs@yahoo-inc.com> | 2017-01-25 16:09:42 +0100 |
---|---|---|
committer | Bjørn Christian Seime <bjorncs@yahoo-inc.com> | 2017-01-25 16:09:56 +0100 |
commit | 47e32a080d84764fece1701627ca2aed5a828dea (patch) | |
tree | 5f77b40814338f0cf6562e232419b8f2492a07e2 /config-model | |
parent | cfdaa5e995bd051e3eafee25cbe22c18dda19ee1 (diff) |
Move document references from Search to SDDocumentType
Diffstat (limited to 'config-model')
-rw-r--r-- | config-model/src/main/java/com/yahoo/searchdefinition/Search.java | 11 | ||||
-rw-r--r-- | config-model/src/main/java/com/yahoo/searchdefinition/document/SDDocumentType.java | 31 |
2 files changed, 28 insertions, 14 deletions
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/Search.java b/config-model/src/main/java/com/yahoo/searchdefinition/Search.java index a0aae70bb25..710f49dddb6 100644 --- a/config-model/src/main/java/com/yahoo/searchdefinition/Search.java +++ b/config-model/src/main/java/com/yahoo/searchdefinition/Search.java @@ -74,9 +74,6 @@ public class Search implements Serializable { private ApplicationPackage sourceApplication; - // Document references - private Optional<DocumentReferences> documentReferences = Optional.empty(); - /** * Creates a search definition which just holds a set of documents which should not (here, directly) be searchable */ @@ -563,14 +560,6 @@ public class Search implements Serializable { return fieldSets; } - public Optional<DocumentReferences> getDocumentReferences() { - return documentReferences; - } - - public void setDocumentReferences(DocumentReferences documentReferences) { - this.documentReferences = Optional.of(documentReferences); - } - /** * For adding structs defined in document scope * diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/document/SDDocumentType.java b/config-model/src/main/java/com/yahoo/searchdefinition/document/SDDocumentType.java index b8b577b7b40..d4df196ae48 100644 --- a/config-model/src/main/java/com/yahoo/searchdefinition/document/SDDocumentType.java +++ b/config-model/src/main/java/com/yahoo/searchdefinition/document/SDDocumentType.java @@ -1,17 +1,31 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.searchdefinition.document; -import com.yahoo.document.*; +import com.yahoo.document.CompressionConfig; +import com.yahoo.document.DataType; +import com.yahoo.document.DataTypeName; +import com.yahoo.document.DocumentType; +import com.yahoo.document.Field; +import com.yahoo.document.PositionDataType; +import com.yahoo.document.StructDataType; import com.yahoo.document.annotation.AnnotationType; import com.yahoo.document.annotation.AnnotationTypeRegistry; import com.yahoo.documentmodel.NewDocumentType; import com.yahoo.documentmodel.VespaDocumentType; +import com.yahoo.searchdefinition.DocumentReferences; import com.yahoo.searchdefinition.FieldSets; import com.yahoo.searchdefinition.Search; import java.io.Serializable; -import java.util.*; -import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.Map; +import java.util.Optional; +import java.util.Set; /** <p>A document definition is a list of fields. Documents may inherit other documents, @@ -30,6 +44,8 @@ public class SDDocumentType implements Cloneable, Serializable { private DataType structType; // The field sets here are set from the processing step in SD, to ensure that the full Search and this SDDocumentType is built first. private FieldSets fieldSets; + // Document references + private Optional<DocumentReferences> documentReferences = Optional.empty(); static { VESPA_DOCUMENT = new SDDocumentType(VespaDocumentType.INSTANCE.getFullName().getName()); @@ -313,4 +329,13 @@ public class SDDocumentType implements Cloneable, Serializable { public void setFieldSets(FieldSets fieldSets) { this.fieldSets = fieldSets; } + + public Optional<DocumentReferences> getDocumentReferences() { + return documentReferences; + } + + public void setDocumentReferences(DocumentReferences documentReferences) { + this.documentReferences = Optional.of(documentReferences); + } + } |