Each document, must have a specific document-type.
The document types controls the indexing, on a per field level, as well as optional validation rules.
|A single collection may have documents with different document types.|
The table will show a list of the document-types.
Each row represents a document-type and will have a button to edit the document-type.
When creating a new document type, you must define the basic settings:
A unique name which is also the identifier. The name may only contain a strictly limited set of characters.
The name cannot be changed after a document-type is created. Deleting a document type after clients have started using it will be a breaking change in the GraphQL API. To prevent breaking the API, a document type can rather be disabled.
- Add fields automatically
Enable this option if you want the document type to be dynamic. If enabled, whenever a document is created or updated it will automatically detect new fields, determine a Value type for the field and add it to the document-type.
Once a document type has been created, you may manage it’s fields.
Each row represents a field and will have a button to edit the field, or add new fields.
Each field must have a unique name within the document-type.
The name cannot be changed after a field is created. Deleting a field after clients have started using it will be a breaking change in the GraphQL API. To prevent breaking the API, a field can rather be disabled.
Fields can also be nested. A dot '.' is used to indicate nesting. For instance:
person.name. In this case, the field
personwill be reserved for nesting, and can no longer be used for indexing.
- Value type
Each field must have a specific value type. The value type enables field validation, and default indexing options.
The value types are:
Value type validation is only enforced if documents are created with validateOccurrences=true.
Visit the Enonic XP Value types documentation for more details on value types and indexing.
0 means the field is optional. Setting it to anything larger than 0 means it’s a required field.
The "Min" option is only enforced if documents are created with validateOccurrences=true.
0 means there is no limit on how many values the field can have.
The "Max" option is only enforced if documents are created with validateOccurrences=true.
Enable in order to search this specific field. Enabled by default.
For details on all indexing options, see Config Options.
- Include in alltext
When enabled, the value of this field will be included in the system defined _alltext field. _alltext typically aggregates all string values in a document, and is the default field used when searching.
When enabled, the field value will be analyzed and enabled for general text search.
When enabled, the field value will be analyzed and enabled for ngram search. Ngram is typically used for autocompletion, and "starts with" types of search.
When enabled, the field value will be analyzed and enabled for path search. Paths are strings with / separators.
Deleting a field will potentially break the strongly typed GraphQL API. Deactivating will not break the schema, but simply return empty values for the field instead.
When a document type is in use (one or more documents exists), it is still possible to modify and update the document type.
After saving your changes to the document type, all documents will automatically be re-indexed based on the new document type definition.