Advertisement
Guest User

ElasticSearch Index Template

a guest
May 20th, 2015
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. {
  2.   "tpl_data": {
  3.     "order": 0,
  4.     "template": "site-data*",
  5.     "settings": {
  6.       "index.refresh_interval": "5s"
  7.     },
  8.     "mappings": {
  9.       "_default_": {
  10.         "dynamic_templates": [
  11.         {
  12.           "boolean_fields": {
  13.             "mapping": {
  14.               "index": "not_analyzed",
  15.               "omit_norms": true,
  16.               "type": "boolean"
  17.             },
  18.             "match": "*.boolean"
  19.           }
  20.         },
  21.         {
  22.           "ip_fields": {
  23.             "mapping": {
  24.               "index": "not_analyzed",
  25.               "omit_norms": true,
  26.               "type": "ip"
  27.             },
  28.             "match": "*.ip"
  29.           }
  30.         },
  31.         {
  32.           "int_fields": {
  33.             "mapping": {
  34.               "index": "not_analyzed",
  35.               "omit_norms": true,
  36.               "type": "integer"
  37.             },
  38.             "match": "*.integer"
  39.           }
  40.         },
  41.         {
  42.           "float_fields": {
  43.             "mapping": {
  44.               "index": "not_analyzed",
  45.               "omit_norms": true,
  46.               "type": "float"
  47.             },
  48.             "match": "*.float"
  49.           }
  50.         },
  51.         {
  52.           "double_fields": {
  53.             "mapping": {
  54.               "index": "not_analyzed",
  55.               "omit_norms": true,
  56.               "type": "double"
  57.             },
  58.             "match": "*.double"
  59.           }
  60.         },
  61.         {
  62.           "long_fields": {
  63.             "mapping": {
  64.               "index": "not_analyzed",
  65.               "omit_norms": true,
  66.               "type": "long"
  67.             },
  68.             "match": "*.long"
  69.           }
  70.         },
  71.         {
  72.           "geo_point_fields": {
  73.             "mapping": {
  74.               "index": "not_analyzed",
  75.               "omit_norms": true,
  76.               "type": "geo_point"
  77.             },
  78.             "match": "*.geo_point"
  79.           }
  80.         },
  81.                 {
  82.           "date_epoch": {
  83.             "mapping": {
  84.               "index": "analyzed",
  85.               "omit_norms": true,
  86.               "type": "date",
  87.               "_timestamp" : {
  88.                   "enabled" : true,
  89.                   "path" : "timestamp_epoch"
  90.               },
  91.               "transform": {
  92.                 "script": "ctx._source['timestamp_epoch'] = ctx._source['timestamp_epoch'] * 1000",
  93.                 "params": {},
  94.                 "lang": "groovy"
  95.               }
  96.             },
  97.             "match": "timestamp_epoch"
  98.           }
  99.         },
  100.         {
  101.           "date_iso8601": {
  102.             "mapping": {
  103.               "index": "analyzed",
  104.               "type": "date",
  105.               "format": "ordinal_date_time_no_millis",
  106.               "_timestamp" : {
  107.                   "enabled" : true,
  108.                   "path" : "timestamp_iso8601"
  109.               }
  110.             },
  111.             "match": "timestamp_iso8601"
  112.           }
  113.         },
  114.         {
  115.           "string_fields": {
  116.             "mapping": {
  117.               "index": "analyzed",
  118.               "omit_norms": true,
  119.               "type": "string",
  120.               "fields": {
  121.                 "raw": {
  122.                   "index": "not_analyzed",
  123.                   "ignore_above": 256,
  124.                   "type": "string"
  125.                 }
  126.               }
  127.             },
  128.             "match": "*",
  129.             "match_mapping_type": "string"
  130.           }
  131.         }
  132.         ],
  133.         "properties": {
  134.           "geoip": {
  135.             "dynamic": true,
  136.             "path": "full",
  137.             "properties": {
  138.               "location": {
  139.                 "type": "geo_point"
  140.               }
  141.             },
  142.             "type": "object"
  143.           },
  144.           "@version": {
  145.             "index": "not_analyzed",
  146.             "type": "string"
  147.           }
  148.         },
  149.         "_all": {
  150.           "enabled": true
  151.         }
  152.       }
  153.     },
  154.     "aliases": {}
  155.   }
  156. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement