Thanks for helping! I'll try to follow formatting.
So I create an index with the following mapping like this:
`PUT /test3
{
"test3" : {
"mappings" : {
"doc" : {
"properties" : {
"alerttype" : {
"type" : "text"
},
"devicename" : {
"type" : "text"
},
"eventtime" : {
"type" : "date"
},
"text" : {
"type" : "text"
},
"timestamp" : {
"type" : "date",
"format" : "epoch_second"
}
}
}
}
}
}`
Then my application does the following:
POST /test3/doc/
{
"alertinfo": {
"alerttype": "Showoff-Soft-Trigger",
"deviceRef": {
"refName": "Lab-7070",
"refObjectType": "device_vs_camera_ip",
"refUid": "161272cc-62e7-4fc4-8b13-ab3daf0b9645",
"refVsomUid": "1d0ac9ec-e357-47e5-b9c8-978705b9f0dc"
},
"devicename": "Lab-7070",
"eventtime": "Feb 12 at 2018 3:23:36 PM ",
"text": "Holy crap Batman!!!<br>On Feb 12 at 2018 3:23:36 PM , we received an alert from location: Main Office, with severity: INFO, triggered by device name: Lab-7070.<br>Alert data: Showoff-Soft-Trigger<br>",
"timestamp": 1518470616
}
}
After that POST - the return from Elasticsearch is:
{
"_index": "test3",
"_type": "doc",
"_id": "s2nmi2EBkXZxUv2r1RM8",
"_version": 1,
"result": "created",
"_shards": {
"total": 2,
"successful": 1,
"failed": 0
},
"_seq_no": 0,
"_primary_term": 1
}
When I pull the mapping after the first document is posted my mapping looks like this:
{
"test3": {
"mappings": {
"doc": {
"properties": {
"alertinfo": {
"properties": {
"alerttype": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"deviceRef": {
"properties": {
"refName": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"refObjectType": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"refUid": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"refVsomUid": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
"devicename": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"eventtime": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"text": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"timestamp": {
"type": "long"
}
}
},
"alerttype": {
"type": "text"
},
"devicename": {
"type": "text"
},
"eventtime": {
"type": "date"
},
"text": {
"type": "text"
},
"timestamp": {
"type": "date",
"format": "epoch_second"
}
}
}
}
}
}`