summaryrefslogtreecommitdiffstats
path: root/searchcommon/src/vespa/searchcommon/common/datatype.h
blob: 7ba21e0496c0512e3f6dae8e0460306df07af822 (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
50
// Copyright 2017 Yahoo Holdings. 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 {
namespace index {
namespace schema {

/**
 * Basic data type for a field.
 **/
enum class DataType { UINT1 = 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
};

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

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

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


}
}
}