diff options
author | Arne H Juul <arnej@yahooinc.com> | 2022-03-31 12:58:55 +0000 |
---|---|---|
committer | Arne H Juul <arnej@yahooinc.com> | 2022-03-31 13:09:46 +0000 |
commit | 6e85b3244085f2260e137ca80a078347eec170ba (patch) | |
tree | 37d9f57450c25a7184a25bfc107bc320f02780fe /document | |
parent | d0fa48f2559c297e7b9c15137f3c04bc32fc65fa (diff) |
add new doctype array
* this is almost the same as in documentmanager.def
Diffstat (limited to 'document')
-rw-r--r-- | document/src/vespa/document/config/documenttypes.def | 175 |
1 files changed, 174 insertions, 1 deletions
diff --git a/document/src/vespa/document/config/documenttypes.def b/document/src/vespa/document/config/documenttypes.def index 2e0483f025b..202447295c3 100644 --- a/document/src/vespa/document/config/documenttypes.def +++ b/document/src/vespa/document/config/documenttypes.def @@ -44,7 +44,7 @@ documenttype[].datatype[].map.value.id int default=0 ## This is the id of the datatype of the key in the wset. documenttype[].datatype[].wset.key.id int default=0 -## Should an update to a nonexistent element cause it to be created +## Should an update to a nonexistent element cause it to be created documenttype[].datatype[].wset.createifnonexistent bool default=false ## Should an element in a weighted set be removed if an update changes the weight to 0 @@ -110,3 +110,176 @@ documenttype[].referencetype[].target_type_id int ## Imported fields (specified outside the document block in the schema) documenttype[].importedfield[].name string + + +# Here starts a new model for how datatypes are configured, where +# everything is per document-type, and each documenttype contains the +# datatypes it defines. + +# 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. + +# 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). + + +## Name of the document type. Must be unique. +doctype[].name string + +## Index of this type (as a datatype which can be referred to). +doctype[].idx int + +## Internal ID of this datatype +doctype[].internalid int + +## 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 + +## Internal ID of this datatype +doctype[].arraytype[].internalid 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 + +## Internal ID of this datatype +doctype[].maptype[].internalid 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 + +## Internal ID of this datatype +doctype[].wsettype[].internalid int + + +# 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 + +## Index of the document type this reference type refers to: +doctype[].documentref[].targettype int + +## Internal ID of this datatype +doctype[].documentref[].internalid 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 + +## Internal id of this annotation type +doctype[].annotationtype[].internalid int + +## 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 + +## Internal ID of this datatype +doctype[].annotationref[].internalid 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 + +## Internal ID of this datatype +doctype[].structtype[].internalid int |