Elastic mapping guide
Migrated to MD
This page contains information about the structure and properties of Elasticsearch mapping for NAE versions 5.4.0 or greater.
Elasticsearch field types
An overview of index field types supported by Elasticsearch can be found at https://www.elastic.co/guide/en/elasticsearch/reference/6.6/mapping-types.html
Refer to this document when index types are mentioned throughout this document. Some fields are mentioned to be Arrays
, as per the referenced document, any index in Elasticsearch can contain multiple values with the same type. When this document mentions Array
type fields, we mean that the Application Engine is actively storing multiple entries into the value of this field. The Application Engine stores only single values in non-array fields mentioned in this document.
Every field that uses the TEXT
type is also indexed as a KEYWORD
type field, for other purposes (such as sorting). When an attribute maps to some TEXT
field some.field.textValue
then its KEYWORD
representation is always mapped to some.field.textValue.keyword
.
All the mapping configuration is implemented with class annotations. If you want to modify the default mapping, you can extend the default engine classes, inherit the default mapping and override only some parts of it.
Task - ElasticTask
Tasks are converted into their ElasticTask counterparts by the IElasticTaskMappingService
. You should only create ElasticTasks instances by converting an existing Task object with the service and you should never use the constructor to create instances of this class.
Indexed fields
Case is always the “parent“ case to which the task belongs.
Process is always the “parent“ process from which the case and the task were created.
index | type | value |
---|---|---|
| Keyword | the mongo ID of the task |
| Keyword | the mongo ID of the process |
| Keyword | the mongo ID of the case |
| Keyword | the import ID of the transition represented by the task |
| Text | title of the task |
| Keyword | title of the task |
| Keyword | color code of the case |
| Text | title of the case |
| Keyword | title of the case |
| Integer | task priority |
| Long | assignee user ID |
| Integer array | date of last assignment stored in the nae date format - an array with the year, month, day, hour, minute, second and timestamp |
| Keyword | ID of the transaction |
| Keyword array | mongo IDs of positive roles associated with the task |
| Keyword array | mongo IDs of negative view roles associated with the task |
| Keyword array | user IDs of users in user lists associated with the task |
| Long array | user IDs of users in negative view user lists associated with the task |
| Keyword | task material icon |
| Keyword | task assign policy |
| Keyword | task data focus policy |
| Keyword | task finish policy |
Case - ElasticCase
Cases are converted into their ElasticCase counterpart by the IElasticCaseMappingService
. You should only create ElasticCase instances by converting an existing Case instance with the service and you should never use the constructor to create instances of this class.
ElasticCase contains the indexed data variable information of any data variable that is marked as immediate
in the process net. An overview of data variable indexation is provided in a separate section.
Indexed fields
Process is always the “parent” process from which the case and its tasks were created.
Tasks are always the “child“ tasks owned by the case.
index | type | value |
---|---|---|
| Long | timestamp of the last modification |
| Keyword | the mongo ID of the case |
| Text | visual ID of the case |
| Keyword | the import ID of the process |
| Keyword | the mongo ID of the process |
| Text | case title |
| Integer array | creation date stored in the nae date format - an array with the year, month, day, hour, minute, second and timestamp |
| Long | creation date stored as a timestamp |
| Text | name of the author |
| Text | author email |
| Object | see the next section for information about data variable indexation |
| Keyword array | import IDs of transitions with existing task instances |
| Keyword array | mongo IDs of existing task instances |
| Keyword array | mongo IDs of roles associated with the case |
| Keyword array | mongo Ids of negative view roles associated with the case |
Dataset - Data variables
All data variables marked as immediate
are indexed according to the rules described in this section.
All data variables are stored in the Case entry under the dataSet
key. The individual attributes that are saved are prefixed by the import ID of the data variable. E.g. if we have an immediate text variable with the id myTextVariable
its value would be indexed under: dataSet.myTextVariable.textValue
Each data variable type has a different attribute mapping associated with it. All the mappings follow a common pattern.
You can implement your own data variable mappings by overriding the IElasticCaseMappingService
.
An overview of all mapping configuration classes follows. The associated data variable types are listed with each class. A data variable might be associated with more than one class because of inheritance.
If a data variable has an I18nString
value all of the associated translations are set as values. For example an enumeration field with the default translation value Dog and both a German and a Slovak translation, would be stored as [Dog, Hund, Pes] in the index.
DataField - all data variables
Base class for data field mapping. All indexed data variables have these attributes available.
index | type | value |
---|---|---|
| Text array | value depends on the field type: boolean: textual representation of the value date & dateTime: date formated as ISO-8601 basic local date format file & fileList: names of the contained files number: the value stored as decimal string text: the value itself multichoice & enumeration: all translations of the selected options multichoiceMap & enumerationMap: all translated values of the selected key-value pairs user & userList: full name followed by email as a single string for each selected user |
BooleanField - boolean
index | type | value |
---|---|---|
| Boolean | value of the data variable stored as boolean |
DateField - date, dateTime
index | type | value |
---|---|---|
| Date | value of the data variable stored as date |
| Long | value of the data variable stored as timestamp |
FileField - file, fileList
index | type | value |
---|---|---|
| Text array | file names of the contained files |
| Keyword array | file extensions of the contained files |
NumberField - number
index | type | value |
---|---|---|
| Double | value of the data variable |
TextField - multichoice, multichoiceMap, enumeration, enumerationMap, text
This serves as the fallback type for any unsupported data variable type. If an unsupported type is found its toString()
value is stored.
index | type | value |
---|---|---|
| Text array | value of the data variable multichoice variants store all the selected values map variants store the value part of the key-value pair (i.e. the part visible to the user) |
MapField - multichoiceMap, enumerationMap
index | type | value |
---|---|---|
| Keyword array | the key part of the selected key-value pairs (i.e. the part stored as the map field value) |
UserField - user, userList
index | type | value |
---|---|---|
| Text array | emails of the selected users |
| Text array | full names of the selected users |
| Long array | IDs of the selected users |