aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchcommon/common/datatype.h
blob: b7a0cc53e37a957ed121c5e2ceecd8e10fb8d51c (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
41
42
43
44
45
46
47
48
49
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include <vespa/vespalib/stllike/string.h>

namespace search::index::schema {

/**
 * Basic data type for a field.
 **/
enum class DataType {
    BOOL = 0,
    UINT2 = 1,
    UINT4 = 2,
    INT8 = 3,
    INT16 = 4,
    INT32 = 5,
    INT64 = 6,
    FLOAT = 7,
    DOUBLE = 8,
    STRING = 9,
    RAW = 10,
    //FEATURE = 11,
    BOOLEANTREE = 12,
    TENSOR = 13,
    REFERENCE = 14,
    COMBINED = 15
};

/**
 * Collection type for a field.
 **/
enum class CollectionType {
    SINGLE = 0,
    ARRAY = 1,
    WEIGHTEDSET = 2
};

DataType dataTypeFromName(vespalib::stringref name);
vespalib::string getTypeName(DataType type);
std::ostream &operator<<(std::ostream &os, const DataType &type);

CollectionType collectionTypeFromName(vespalib::stringref n);
vespalib::string getTypeName(CollectionType type);
std::ostream &operator<<(std::ostream &os, const CollectionType &type);


}