aboutsummaryrefslogtreecommitdiffstats
path: root/document/src/vespa/document/config/documentmanager.def
blob: 6d26e7e49184750f7e7992014fb4192a1bf5cc8f (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

namespace=document.config

## Whether attempts to set an undefined field should be ignored rather than causing an error
ignoreundefinedfields bool default=false

## Prefer "Vespa 8" format for the "position" type
usev8geopositions bool default=false

## The Id of the datatype. Must be unique, including not
## overlapping with the internal datatypes (defined in datatype.h)
datatype[].id int

## Use if this datatype is an array type, for instance an int
## or double array. Specifies the datatype we have an array of.
## This can be a built-in datatype or a new one created here, meaning
## that for instance arrays of arrays are allowed.
datatype[].arraytype[].datatype int

## Map type. Keys and values can be built in types or types created here.
datatype[].maptype[].keytype int
datatype[].maptype[].valtype int

## Use if this datatype is a weighted set type, for instance an int
## or double weighted set. Specifies the datatype we have a weighted set of.
## This can be a built-in datatype or a new one craeted here, meaning
## that for instance weighted sets of weighted sets are allowed.
datatype[].weightedsettype[].datatype int

## Should an update to a nonexistant element cause it to be created
datatype[].weightedsettype[].createifnonexistant bool default=false

## Should an element in a weighted set be removed if an update changes the weight to 0
datatype[].weightedsettype[].removeifzero bool default=false

## Specify the name of the document type. Must be unique.
datatype[].structtype[].name string

## Verison is not in use
datatype[].structtype[].version int default=0

## Specify which compression to use if compression is enabled above
datatype[].structtype[].compresstype enum { NONE, UNCOMPRESSABLE, LZ4 } default=NONE

## Specify the compression level to use if compression is enabled
datatype[].structtype[].compresslevel int default=0

## Specify the minimum reduction required from compression in order to keep the compressed version (maximum percentage of original size)
datatype[].structtype[].compressthreshold int default=95

## Specify the minimum size of the struct data before we even try to compress it
datatype[].structtype[].compressminsize int default=800

## Specify a document field name. Must be unique within the document type.
datatype[].structtype[].field[].name string

## Specify a document field id. If not specified, this is generated by a hash function
datatype[].structtype[].field[].id[].id int

## Specify the datatype of the field. Can be a built-in datatype or
## one specified in config.
datatype[].structtype[].field[].datatype int

## Additional, optional type information which can be changed without
## (necessarily) causing field incompatibility
datatype[].structtype[].field[].detailedtype string default=""

## Specify a struct type to inherit
datatype[].structtype[].inherits[].name string

## Version is not in use
datatype[].structtype[].inherits[].version int default=0

## Specity an annotation reference type and the name of the annotation type it is referencing
datatype[].annotationreftype[].annotation string

## Specify the name of the document type. Must be unique.
datatype[].documenttype[].name string

## Version is not in use
datatype[].documenttype[].version int default=0

## Specify a document type to inherit
datatype[].documenttype[].inherits[].name string

## Version is not in use
datatype[].documenttype[].inherits[].version int default=0

## Name of header struct defining document header.
datatype[].documenttype[].headerstruct int

## Specify a document field id. Must be unique within the document type.
datatype[].documenttype[].bodystruct int default=0

## Field sets
datatype[].documenttype[].fieldsets{}.fields[] string

## Imported fields (specified outside the document block in the schema)
datatype[].documenttype[].importedfield[].name string

## Cross-document reference with ID of target document type
datatype[].referencetype[].target_type_id int

## The Id of the annotation type. Must be unique.
annotationtype[].id int
annotationtype[].name string
annotationtype[].datatype int default=-1
annotationtype[].inherits[].id int


# Here starts a new model for how datatypes are configured, where
# everything is per document-type, and each documenttype contains the
# datatypes it defines.  Will be used (only?) if the arrays above
# (datatype[] and annotationtype[]) are empty.


# Note: we will include the built-in "document" document
# type that all other doctypes inherit from also, in order
# to get all the primitive and built-in types declared
# with an idx we can refer to.

## Name of the document type. Must be unique.
doctype[].name string

# Note: indexes are only meaningful as internal references in this
# config; they will typically be sequential (1,2,3,...)  in the order
# that they are generated (but nothing should depend on that).

## Index of this type (as a datatype which can be referred to).
doctype[].idx int

# Could also use name here?
## Specify document types to inherit
doctype[].inherits[].idx int

## Index of struct defining document fields
doctype[].contentstruct int

## Field sets available for this document type
doctype[].fieldsets{}.fields[] string

## Imported fields (specified outside the document block in the schema)
doctype[].importedfield[].name string

# Everything below here is configuration of data types defined by
# this document type.

# Primitive types must be present as built-in static members.

## Index of primitive type
doctype[].primitivetype[].idx int

## The name of this primitive type
doctype[].primitivetype[].name string

# Arrays are the simplest collection type:

## Index of this array type
doctype[].arraytype[].idx int

## Index of the element type this array type contains
doctype[].arraytype[].elementtype int


# Maps are another collection type:

## Index of this map type
doctype[].maptype[].idx int

## Index of the key type used by this map type
doctype[].maptype[].keytype int

## Index of the key type used by this map type
doctype[].maptype[].valuetype int


# Weighted sets are more complicated;
# they can be considered as an collection
# of unique elements where each element has
# an associated weight:

## Index of this weighted set type
doctype[].wsettype[].idx int

## Index of the element types contained in this weighted set type
doctype[].wsettype[].elementtype int

## Should an update to a nonexistent element cause it to be created 
doctype[].wsettype[].createifnonexistent bool default=false

## Should an element in a weighted set be removed if an update changes the weight to 0
doctype[].wsettype[].removeifzero bool default=false


# Tensors have their own type system

## Index of this tensor type
doctype[].tensortype[].idx int

## Description of the type of the actual tensors contained
doctype[].tensortype[].detailedtype string


# Document references refer to parent documents that a document can
# import fields from:

## Index of this reference data type:
doctype[].documentref[].idx int

# Could also use name?
## Index of the document type this reference type refers to:
doctype[].documentref[].targettype int


# Annotation types are another world, but are modeled here
# as if they were also datatypes contained inside document types:

## Index of an annotation type.
doctype[].annotationtype[].idx int

## Name of the annotation type.
doctype[].annotationtype[].name string

# Could we somehow avoid this?
## Internal id of this annotation type
doctype[].annotationtype[].internalid int default=-1

## Index of contained datatype of the annotation type, if any
doctype[].annotationtype[].datatype int default=-1

## Index of annotation type that this type inherits.
doctype[].annotationtype[].inherits[].idx int


# Annotation references are field values referring to
# an annotation of a certain annotation type.

## Index of this annotation reference type
doctype[].annotationref[].idx int

## Index of the annotation type this annotation reference type refers to
doctype[].annotationref[].annotationtype int


# A struct is just a named collections of fields:

## Index of this struct type
doctype[].structtype[].idx int

## Name of the struct type. Must be unique within documenttype.
doctype[].structtype[].name string

## Index of another struct type to inherit
doctype[].structtype[].inherits[].type int

## Name of a struct field. Must be unique within the struct type.
doctype[].structtype[].field[].name string

## The "field id" - used in serialized format!
doctype[].structtype[].field[].internalid int

## Index of the type of this field
doctype[].structtype[].field[].type int