I have a conceptual entity called test execution and every test execution should be a separate type in an Elasticsearch index. Mapping for every test execution type should be the same and will be added to the index dynamically.
I have already created a mapping for a single test execution as follows and I want to make it generalized for all the types that will be created in future.
PUT /test_tool/_mapping/test_execution_20151710_1324_12
{
"properties": {
"timestamp":{
"type": "string",
"index": "not_analyzed"
},
"source":{
"type": "string",
"index": "not_analyzed"
},
"payload":{
"type": "string",
"index": "not_analyzed"
}
}
}
How should I create a generic mapping for dynamic types, for an example: create a wildcard for the type 'test_execution_*'.
[Update]
After looking at the below answers I have considered not to use separate types for different executions and hope to use a separate key to identify documents in the same test execution.
PUT /test_tool/_mapping/executions
{
"properties": {
"timestamp":{
"type": "string",
"index": "not_analyzed"
},
"source":{
"type": "string",
"index": "not_analyzed"
},
"payload":{
"type": "string",
"index": "not_analyzed"
},
"test_execution":{
"type": "string",
"index": "not_analyzed"
}
}
}