supplier_product.txt 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. curl -XPUT http://127.0.0.1:19800/supplier_product_v2 -d '{
  2. "settings": {
  3. "index": {
  4. "search": {
  5. "showlog": {
  6. "threshold": {
  7. "query": {
  8. "trace": "100ms"
  9. },
  10. "fetch": {
  11. "tract": "100ms"
  12. }
  13. }
  14. }
  15. },
  16. "analysis": {
  17. "analyzer": {
  18. "my_ngram_title": {
  19. "filter": [
  20. "lowercase"
  21. ],
  22. "tokenizer": "my_ngram_title"
  23. },
  24. "my_ngram": {
  25. "tokenizer": "my_ngram"
  26. }
  27. },
  28. "tokenizer": {
  29. "my_ngram_title": {
  30. "token_chars": [
  31. "letter",
  32. "digit",
  33. "punctuation",
  34. "symbol"
  35. ],
  36. "min_gram": "1",
  37. "type": "nGram",
  38. "max_gram": "1"
  39. },
  40. "my_ngram": {
  41. "min_gram": "2",
  42. "type": "nGram",
  43. "max_gram": "2"
  44. }
  45. }
  46. },
  47. "number_of_shards": "15",
  48. "number_of_replicas": "0"
  49. }
  50. },
  51. "mappings": {
  52. "supplier_product": {
  53. "_id": {
  54. "path": "company_id"
  55. },
  56. "_all": {
  57. "enabled": false
  58. },
  59. "properties": {
  60. "id": {
  61. "type": "long"
  62. },
  63. "company_id": {
  64. "index": "not_analyzed",
  65. "type": "string"
  66. },
  67. "supplier": {
  68. "index": "not_analyzed",
  69. "type": "string",
  70. "fields": {
  71. "p_supplier": {
  72. "analyzer": "my_ngram",
  73. "type": "string"
  74. }
  75. }
  76. },
  77. "area_code": {
  78. "index": "not_analyzed",
  79. "type": "string"
  80. },
  81. "area": {
  82. "index": "not_analyzed",
  83. "type": "string"
  84. },
  85. "city": {
  86. "index": "not_analyzed",
  87. "type": "string"
  88. },
  89. "district": {
  90. "index": "not_analyzed",
  91. "type": "string"
  92. },
  93. "business_model": {
  94. "type": "byte"
  95. },
  96. "productlist": {
  97. "properties": {
  98. "name": {
  99. "analyzer": "my_ngram",
  100. "type": "string"
  101. },
  102. "brand": {
  103. "analyzer": "my_ngram_title",
  104. "type": "string"
  105. },
  106. "model": {
  107. "analyzer": "my_ngram_title",
  108. "type": "string"
  109. }
  110. }
  111. },
  112. "bid_num": {
  113. "type": "integer"
  114. }
  115. }
  116. }
  117. }
  118. }'