project-forecast2.txt 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. curl -H 'Content-Type: application/json' -XPUT http://192.168.3.149:9200/forecast_v2 -d '{
  2. "settings": {
  3. "index": {
  4. "analysis": {
  5. "analyzer": {
  6. "douhao": {
  7. "type": "pattern",
  8. "pattern": ","
  9. },
  10. "my_ngram_title": {
  11. "filter": [
  12. "lowercase"
  13. ],
  14. "tokenizer": "my_ngram_title"
  15. },
  16. "my_ngram": {
  17. "filter": [
  18. "lowercase"
  19. ],
  20. "tokenizer": "my_ngram"
  21. }
  22. },
  23. "tokenizer": {
  24. "my_ngram_title": {
  25. "token_chars": [
  26. "letter",
  27. "digit",
  28. "punctuation",
  29. "symbol"
  30. ],
  31. "min_gram": "1",
  32. "type": "nGram",
  33. "max_gram": "1"
  34. },
  35. "my_ngram": {
  36. "token_chars": [
  37. "letter",
  38. "digit"
  39. ],
  40. "min_gram": "2",
  41. "type": "nGram",
  42. "max_gram": "2"
  43. }
  44. }
  45. },
  46. "number_of_shards": "2",
  47. "number_of_replicas": "0"
  48. }
  49. },
  50. "mappings": {
  51. "dynamic":false,
  52. "properties": {
  53. "area": {
  54. "type": "keyword"
  55. },
  56. "city": {
  57. "type": "keyword"
  58. },
  59. "nature": {
  60. "type": "keyword"
  61. },
  62. "buyer": {
  63. "type": "keyword"
  64. },
  65. "buyerclass": {
  66. "type": "keyword"
  67. },
  68. "title": {
  69. "analyzer": "my_ngram_title",
  70. "type": "text"
  71. },
  72. "projectname": {
  73. "type": "keyword",
  74. "fields": {
  75. "pname": {
  76. "type": "keyword"
  77. }
  78. }
  79. },
  80. "projectcode": {
  81. "type": "keyword"
  82. },
  83. "spidercode": {
  84. "type": "keyword"
  85. },
  86. "stage": {
  87. "type": "keyword"
  88. },
  89. "main_project": {
  90. "type": "keyword"
  91. },
  92. "top_category": {
  93. "type": "keyword"
  94. },
  95. "sub_category": {
  96. "type": "keyword"
  97. },
  98. "approvestatus": {
  99. "type": "keyword"
  100. },
  101. "href": {
  102. "type": "keyword"
  103. },
  104. "jyhref": {
  105. "type": "keyword"
  106. },
  107. "publishtime": {
  108. "type": "long"
  109. },
  110. "yucetime": {
  111. "type": "long"
  112. },
  113. "yucestarttime": {
  114. "type": "long"
  115. },
  116. "yuceendtime": {
  117. "type": "long"
  118. },
  119. "results": {
  120. "properties": {
  121. "purchasing": {
  122. "analyzer": "douhao",
  123. "type": "text",
  124. "fields": {
  125. "mypurchasing": {
  126. "analyzer": "my_ngram_title",
  127. "type": "text"
  128. }
  129. }
  130. },
  131. "p_projects": {
  132. "properties": {
  133. "p_purchasing": {
  134. "type": "keyword"
  135. },
  136. "p_id": {
  137. "type": "keyword"
  138. },
  139. "p_orther": {
  140. "type": "keyword"
  141. },
  142. "p_phone": {
  143. "type": "keyword"
  144. },
  145. "p_person": {
  146. "type": "keyword"
  147. }
  148. }
  149. }
  150. }
  151. }
  152. }
  153. }
  154. }'