templdate

https://www.elastic.co/guide/en/elasticsearch/reference/6.3/indices-templates.html

Dynamic templates

https://www.elastic.co/guide/en/elasticsearch/reference/6.3/dynamic-templates.html
https://blog.csdn.net/prestigeding/article/details/84866824

  1. PUT /_template/advert_brand_content_d
  2. {
  3. "index_patterns": ["advert_brand_content_d*"],
  4. "settings": {
  5. "number_of_replicas": "1",
  6. "number_of_shards": 1
  7. }
  8. }
  1. PUT /_template/oplogs
  2. {
  3. "index_patterns": ["oplogs*"],
  4. "settings": {
  5. "routing.rebalance.enable": "none",
  6. "mapping.total_fields.limit": "5000",
  7. "refresh_interval": "30s",
  8. "index.translog.flush_threshold_size": "1gb",
  9. "index.translog.durability": "async",
  10. "index.merge.scheduler.max_thread_count": "1",
  11. "index.search.slowlog.threshold.query.warn": "10s",
  12. "index.search.slowlog.threshold.query.info": "5s",
  13. "index.search.slowlog.threshold.query.debug": "2s",
  14. "index.search.slowlog.threshold.fetch.warn": "1s",
  15. "index.search.slowlog.threshold.fetch.info": "800ms",
  16. "index.search.slowlog.threshold.fetch.debug": "500ms",
  17. "index.search.slowlog.level": "info",
  18. "index.indexing.slowlog.threshold.index.warn": "10s",
  19. "index.indexing.slowlog.threshold.index.info": "5s",
  20. "index.indexing.slowlog.threshold.index.debug": "2s",
  21. "index.indexing.slowlog.level": "info",
  22. "index.indexing.slowlog.source": "1000",
  23. "index.merge.policy.max_merged_segment": "100m",
  24. "number_of_replicas": "0",
  25. "number_of_shards": 32
  26. },
  27. "mappings": {
  28. "data": {
  29. "_all": {
  30. "enabled": false
  31. },
  32. "_source": {
  33. "enabled": true
  34. },
  35. "dynamic_templates": [{
  36. "strings_as_keywords": {
  37. "match_mapping_type": "string",
  38. "mapping": {
  39. "type": "keyword",
  40. "ignore_above": 256
  41. }
  42. }
  43. }],
  44. "properties": {
  45. "c_mon_key": {
  46. "type": "text",
  47. "fields": {
  48. "keyword": {
  49. "type": "keyword",
  50. "ignore_above": 256
  51. }
  52. }
  53. },
  54. "error": {
  55. "type": "text"
  56. },
  57. "raw": {
  58. "type": "text"
  59. },
  60. "msg": {
  61. "type": "text"
  62. },
  63. "MSG": {
  64. "type": "text"
  65. }
  66. }
  67. }
  68. }
  69. }
文档更新时间: 2019-07-09 19:03