summaryrefslogtreecommitdiffstats
path: root/document
diff options
context:
space:
mode:
authorJon Marius Venstad <jonmv@users.noreply.github.com>2020-11-09 13:58:54 +0100
committerGitHub <noreply@github.com>2020-11-09 13:58:54 +0100
commit7734b8a6eb9a07af57f6f9009fef1202bc628e09 (patch)
treef72a1b70aecaeb7f34b74b96f82c5ca1f5cfd152 /document
parent089145d4f8f7225b41a2c23c6d551fc599d609f6 (diff)
parent215d8a7a446a37d74be3900061d4488a662b54cb (diff)
Merge pull request #15187 from vespa-engine/jonmv/reindexig-controller
Jonmv/reindexig controller
Diffstat (limited to 'document')
-rw-r--r--document/src/main/java/com/yahoo/document/fieldset/FieldSetRepo.java23
1 files changed, 13 insertions, 10 deletions
diff --git a/document/src/main/java/com/yahoo/document/fieldset/FieldSetRepo.java b/document/src/main/java/com/yahoo/document/fieldset/FieldSetRepo.java
index 285c78ef0ab..905376e81ca 100644
--- a/document/src/main/java/com/yahoo/document/fieldset/FieldSetRepo.java
+++ b/document/src/main/java/com/yahoo/document/fieldset/FieldSetRepo.java
@@ -34,21 +34,24 @@ public class FieldSetRepo {
FieldSet parseFieldCollection(DocumentTypeManager docMan, String docType, String fieldNames) {
DocumentType type = docMan.getDocumentType(docType);
if (type == null) {
- throw new IllegalArgumentException("Unknown document type " + docType);
+ throw new IllegalArgumentException("Unknown document type " + docType);
}
- StringTokenizer tokenizer = new StringTokenizer(fieldNames, ",");
FieldCollection collection = new FieldCollection(type);
-
- while (tokenizer.hasMoreTokens()) {
- String token = tokenizer.nextToken();
- Field f = type.getField(token);
- if (f == null) {
- throw new IllegalArgumentException("No such field " + token);
+ if (fieldNames.equals("[document]")) {
+ collection.addAll(type.fieldSet());
+ }
+ else {
+ StringTokenizer tokenizer = new StringTokenizer(fieldNames, ",");
+ while (tokenizer.hasMoreTokens()) {
+ String token = tokenizer.nextToken();
+ Field f = type.getField(token);
+ if (f == null) {
+ throw new IllegalArgumentException("No such field " + token);
+ }
+ collection.add(f);
}
- collection.add(f);
}
-
return collection;
}