summaryrefslogtreecommitdiffstats
path: root/config-model/src/main/java/com/yahoo/searchdefinition/DocumentOnlySearch.java
diff options
context:
space:
mode:
Diffstat (limited to 'config-model/src/main/java/com/yahoo/searchdefinition/DocumentOnlySearch.java')
-rw-r--r--config-model/src/main/java/com/yahoo/searchdefinition/DocumentOnlySearch.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/DocumentOnlySearch.java b/config-model/src/main/java/com/yahoo/searchdefinition/DocumentOnlySearch.java
new file mode 100644
index 00000000000..5940f908be8
--- /dev/null
+++ b/config-model/src/main/java/com/yahoo/searchdefinition/DocumentOnlySearch.java
@@ -0,0 +1,26 @@
+// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+package com.yahoo.searchdefinition;
+
+import com.yahoo.searchdefinition.document.SDDocumentType;
+
+/**
+ * A search that was derived from an sd file containing no search element(s), only
+ * document specifications, so the name of this is decided by parsing and adding the document instance.
+ *
+ * @author vegardh
+ */
+public class DocumentOnlySearch extends Search {
+
+ public DocumentOnlySearch() {
+ // empty
+ }
+
+ @Override
+ public void addDocument(SDDocumentType docType) {
+ if (getName() == null) {
+ setName(docType.getName());
+ }
+ super.addDocument(docType);
+ }
+
+}