supplyinfo.txt 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. curl -XPUT http://127.0.0.1:19800/supplyinfo_v1 -d '
  2. {
  3. "settings": {
  4. "index": {
  5. "analysis": {
  6. "analyzer": {
  7. "my_ngram_title": {
  8. "filter": [
  9. "lowercase"
  10. ],
  11. "tokenizer": "my_ngram_title"
  12. },
  13. "my_ngram": {
  14. "filter": [
  15. "lowercase"
  16. ],
  17. "tokenizer": "my_ngram"
  18. }
  19. },
  20. "tokenizer": {
  21. "my_ngram_title": {
  22. "token_chars": [
  23. "letter",
  24. "digit",
  25. "punctuation",
  26. "symbol"
  27. ],
  28. "min_gram": "1",
  29. "type": "nGram",
  30. "max_gram": "1"
  31. },
  32. "my_ngram": {
  33. "token_chars": [
  34. "letter",
  35. "digit",
  36. "punctuation",
  37. "symbol"
  38. ],
  39. "min_gram": "2",
  40. "type": "nGram",
  41. "max_gram": "2"
  42. }
  43. }
  44. },
  45. "number_of_shards": "20",
  46. "number_of_replicas": "0"
  47. }
  48. },
  49. "mappings": {
  50. "supplyinfo": {
  51. "transform": {
  52. "lang": "groovy",
  53. "script": "ctx._source[\"id\"] = ctx._source[\"_id\"]"
  54. },
  55. "_id": {
  56. "path": "_id"
  57. },
  58. "_all": {
  59. "enabled": false
  60. },
  61. "properties": {
  62. "msg_type": {
  63. "index": "not_analyzed",
  64. "type": "string"
  65. },
  66. "title": {
  67. "analyzer": "my_ngram_title",
  68. "type": "string",
  69. "fields": {
  70. "mtitle": {
  71. "index": "not_analyzed",
  72. "type": "string"
  73. }
  74. }
  75. },
  76. "id": {
  77. "index": "not_analyzed",
  78. "type": "string"
  79. },
  80. "detail": {
  81. "analyzer": "my_ngram",
  82. "type": "string"
  83. },
  84. "validity_time": {
  85. "type": "long"
  86. },
  87. "create_time": {
  88. "type": "long"
  89. },
  90. "publish_time": {
  91. "type": "long"
  92. },
  93. "province": {
  94. "index": "not_analyzed",
  95. "type": "string"
  96. },
  97. "city": {
  98. "index": "not_analyzed",
  99. "type": "string"
  100. },
  101. "ent_name": {
  102. "analyzer": "my_ngram_title",
  103. "type": "string"
  104. },
  105. "ent_id": {
  106. "index": "not_analyzed",
  107. "type": "string"
  108. }
  109. }
  110. }
  111. }
  112. }'