Skip to content

Instantly share code, notes, and snippets.

@D-Ne0
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save D-Ne0/10a479fd4b6c1c0f4c93 to your computer and use it in GitHub Desktop.
Save D-Ne0/10a479fd4b6c1c0f4c93 to your computer and use it in GitHub Desktop.
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"
}
}
}
}
@D-Ne0
Copy link
Author

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