Hi everyone,
Finally, my company will switch from ES 1.7 to ES 5.5 (in fact, the new one is for new projects ... and the old for that already exists ... anyway) !
"Old" Mapping
{
"properties": {
// some fields
"tasks": {
"properties": {
"formKey": {
"index": "not_analyzed",
"doc_values": true,
"type": "string"
},
"assignee": {
"index": "not_analyzed",
"doc_values": true,
"type": "string"
},
"endTime": {
"type": "date"
},
"id": {
"index": "not_analyzed",
"doc_values": true,
"type": "string"
},
"startTime": {
"type": "date"
},
"duration": {
"type": "long"
},
"category": {
"index": "not_analyzed",
"doc_values": true,
"type": "string"
},
"description": {
"type": "string"
},
"priority": {
"type": "integer"
},
"name": {
"type": "string"
},
"taskDefinitionKey": {
"index": "not_analyzed",
"doc_values": true,
"type": "string"
},
"owner": {
"index": "not_analyzed",
"doc_values": true,
"type": "string"
},
"dueDate": {
"type": "date"
},
"deleteReason": {
"index": "not_analyzed",
"doc_values": true,
"type": "string"
}
},
"type": "nested"
},
"variables": {
"properties": {
"id": {
"index": "not_analyzed",
"doc_values": true,
"type": "string"
},
"attachmentValue": {
"index": "not_analyzed",
"doc_values": true,
"type": "string"
},
"storedType": {
"index": "not_analyzed",
"doc_values": true,
"type": "string"
},
"longValue": {
"type": "long"
},
"name": {
"index": "not_analyzed",
"doc_values": true,
"type": "string"
},
"executionId": {
"index": "not_analyzed",
"doc_values": true,
"type": "string"
},
"binaryValue": {
"type": "binary"
},
"stringValue": {
"type": "string"
},
"rawValue": {
"index": "not_analyzed",
"doc_values": true,
"type": "string"
},
"doubleValue": {
"type": "double"
},
"dateValue": {
"type": "date"
},
"booleanValue": {
"type": "boolean"
},
"originalType": {
"index": "not_analyzed",
"doc_values": true,
"type": "string"
}
},
"type": "nested"
}
}
}
"New" Mapping
{
"properties": {
// same fields until tasks
"tasks": { // What can I do with tasks? I thought to put them in another mapping, as parent/child... but I don't know if it would be good
"properties": {
"formKey": {
"index": "not_analyzed",
"doc_values": true,
"type": "string"
},
"assignee": {
"index": "not_analyzed",
"doc_values": true,
"type": "string"
},
"endTime": {
"type": "date"
},
"id": {
"index": "not_analyzed",
"doc_values": true,
"type": "string"
},
"startTime": {
"type": "date"
},
"duration": {
"type": "long"
},
"category": {
"index": "not_analyzed",
"doc_values": true,
"type": "string"
},
"description": {
"type": "string"
},
"priority": {
"type": "integer"
},
"name": {
"type": "string"
},
"taskDefinitionKey": {
"index": "not_analyzed",
"doc_values": true,
"type": "string"
},
"owner": {
"index": "not_analyzed",
"doc_values": true,
"type": "string"
},
"dueDate": {
"type": "date"
},
"deleteReason": {
"index": "not_analyzed",
"doc_values": true,
"type": "string"
}
},
"type": "nested"
},
"variables": { // Now variables has a more simple structure. I will use dynamic_template here
"properties": {
"protocol": {
"type": "keyword"
},
// another fields, but with the same idea...
"eps": {
"type": "keyword"
}
},
"type": "nested" // I kept the nested type to keep them organized
}
}
}
About the old mapping:
-
We have problems filtering the contents of variables and tasks
Example: to get a protocol variable, we need to do a "variables.name = protocol" AND "variables.stringValue = protocol_value". If we try to use _source include with "variables.name", it will not work, because every "variables.name" will return. The same idea for tasks. -
We have no relationship between "processA" and "subProcessA" in a case like "one processA has many subProcessA"
About the new mapping:
-
Variables will be more direct. Something like "protocol = protocol_value". This way, _source include will work properly
- Also, I will use dynamic_template for new variables
-
I will use parent/child for "processA" and "subProcessA" (both with a similar mapping)
-
But what can I do with the tasks?
The structure is fixed, it does not have much to take out or put in the fields. But the way it is, the same problem (which I explained with the variables) would continue. But if you do a type for tasks, that would be very repetitive. I would have processA tasks and subProcessA tasks. Just thinking about these cases. I would still have processB, subProcessB and tasks for both ... and there are more process yet.
Do you have any suggestion?
thanks