aboutsummaryrefslogtreecommitdiffstats
path: root/config-model/src/main/java/com/yahoo/documentmodel/VespaDocumentType.java
blob: 45dea3d66afb6fd5b644663bae5fd7f3c5d09ad2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.documentmodel;

import com.yahoo.document.DataType;
import com.yahoo.document.DataTypeName;
import com.yahoo.document.PositionDataType;

/**
 * This class represents the builtin 'document' document type that all other documenttypes inherits.
 * Remember that changes here must be compatible. Changes to types of fields can not be done here.
 * This must also match the mirroring class in c++.
 *
 * @author baldersheim
 */
public class VespaDocumentType {

    public static final NewDocumentType INSTANCE = newInstance();

    public static final DataTypeName NAME = new DataTypeName("document");

    private static NewDocumentType newInstance() {
        NewDocumentType vespa = new NewDocumentType(new NewDocumentType.Name(8, "document"));
        vespa.add(DataType.BYTE);
        vespa.add(DataType.INT);
        vespa.add(DataType.LONG);
        vespa.add(DataType.STRING);
        vespa.add(DataType.RAW);
        vespa.add(DataType.TAG);
        vespa.add(DataType.FLOAT);
        vespa.add(DataType.DOUBLE);
        vespa.add(DataType.DOCUMENT);
        vespa.add(PositionDataType.INSTANCE);
        vespa.add(DataType.URI);
        vespa.add(DataType.PREDICATE);
        vespa.add(DataType.BOOL);
        vespa.add(DataType.FLOAT16);
        return vespa;
    }

}