Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Mapping for ChannelLogs index
{
"log": {
"properties": {
"_id": {
"type": "string",
"index": "not_analyzed"
},
"channel_id": {
"type": "string",
"index": "not_analyzed"
},
"channel_name": {
"type": "string",
"index": "not_analyzed"
},
"server_id": {
"type": "string",
"index": "not_analyzed"
},
"server_name": {
"type": "string",
"index": "not_analyzed"
},
"message": {
"type": "string",
"analyzer": "standard"
},
"raw_message": {
"type": "object",
"enabled": false
},
"nick": {
"type": "string",
"index": "not_analyzed"
},
"from": {
"type": "string",
"index": "not_analyzed",
"null_value": ""
},
"from_user": {
"type": "string",
"index": "not_analyzed",
"null_value": ""
},
"from_user_id": {
"type": "string",
"index": "not_analyzed",
"null_value": ""
},
"created": {
"type": "date",
"index": "not_analyzed"
},
"last_updated": {
"type": "date",
"index": "not_analyzed"
},
"type": {
"type": "string",
"index": "not_analyzed",
"index_name": "msg_type"
},
"user": {
"type": "string",
"index": "not_analyzed"
},
"user_id": {
"type": "string",
"index": "not_analyzed"
},
"global": {
"type": "boolean",
"index": "not_analyzed"
},
"status": {
"type": "string",
"index": "not_analyzed"
},
"not_for_user": {
"type": "string",
"index": "not_analyzed"
}
}
}
}
Owner

D-Ne0 commented May 25, 2014

How to apply this mapping?

  1. First create channel_logs index:
    curl -XPOST 'http://localhost:9200/channel_logs?pretty'
  2. Add mapping:
    curl -XPOST 'http://localhost:9200/channel_logs/log/_mapping?pretty' -d '{json-mapping-here}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment