tool.txt 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427
  1. // 新增某字段mapping
  2. curl -XPUT http://192.168.3.128:9800/bidding_v5/bidding/_mapping -d '
  3. {
  4. "properties": {
  5. "entidlist": {
  6. "index": "not_analyzed",
  7. "type": "string"
  8. }
  9. }
  10. }'
  11. //开启节点平衡
  12. curl -XPUT http://127.0.0.1:9800/_cluster/settings -d'{
  13. "transient" : {
  14. "cluster.routing.allocation.enable" : "all"
  15. }
  16. }'
  17. //关闭节点平衡
  18. curl -XPUT http://127.0.0.1:9800/_cluster/settings -d'{
  19. "transient" : {
  20. "cluster.routing.allocation.enable" : "none"
  21. }
  22. }'
  23. //开启节点平衡
  24. curl -XPUT http://192.168.3.11:9800/_cluster/settings -d'{
  25. "transient" : {
  26. "cluster.routing.allocation.enable" : "all"
  27. }
  28. }'
  29. //关闭节点平衡
  30. curl -XPUT http://192.168.3.11:9800/_cluster/settings -d'{
  31. "transient" : {
  32. "cluster.routing.allocation.enable" : "none"
  33. }
  34. }'
  35. //手动移动节点
  36. curl -XPOST 'http://192.168.3.128:9800/_cluster/reroute' -d '{
  37. "commands" : [ {
  38. "move" :
  39. {
  40. "index" : "qyxy_v1", "shard" : 2,
  41. "from_node" : "GqK0c02DTi264kKPYmw3pA", "to_node" : "m0YXNuy9RGqTo5JWdD5BdA"
  42. }
  43. }
  44. ]
  45. }'
  46. //查看节点个数
  47. curl http://localhost:9800/_settings?pretty
  48. //设置节点个数
  49. curl -XPUT 'http://127.0.0.1:9800/projectset_v1/_settings' -d '{
  50. "index.routing.allocation.total_shards_per_node":2
  51. }'
  52. //新增某字段mapping
  53. curl -XPUT http://192.168.3.128:9800/projectset_v5/projectset/_mapping -d '
  54. {
  55. "properties": {
  56. "project_startdate": {
  57. "type": "long"
  58. },
  59. "project_completedate": {
  60. "type": "long"
  61. }
  62. }
  63. }'
  64. curl -XPUT http://127.0.0.1:9800/qyxy_v1/qyxy/_mapping -d '
  65. {
  66. "properties": {
  67. "company_type_int": {
  68. "type": "integer"
  69. }
  70. }
  71. }'
  72. // 恢复mapping文件
  73. curl -XPOST "http://192.168.3.11:9800/bidding/bidding/_mapping?pretty" -d '
  74. {
  75. "bidding": {
  76. "transform": {
  77. "lang": "groovy",
  78. "script": "ctx._source[\"id\"] = ctx._source[\"_id\"]"
  79. },
  80. "_id": {
  81. "path": "_id"
  82. },
  83. "_all": {
  84. "enabled": false
  85. },
  86. "properties": {
  87. "winneraddr": {
  88. "index": "not_analyzed",
  89. "type": "string"
  90. },
  91. "projectcode": {
  92. "index": "not_analyzed",
  93. "type": "string"
  94. },
  95. "channel": {
  96. "index": "not_analyzed",
  97. "type": "string"
  98. },
  99. "projectaddr": {
  100. "index": "not_analyzed",
  101. "type": "string"
  102. },
  103. "contractcode": {
  104. "index": "not_analyzed",
  105. "type": "string"
  106. },
  107. "entidlist": {
  108. "index": "not_analyzed",
  109. "type": "string"
  110. },
  111. "agencyaddr": {
  112. "index": "not_analyzed",
  113. "type": "string"
  114. },
  115. "tagname": {
  116. "analyzer": "douhao",
  117. "type": "string"
  118. },
  119. "toptype": {
  120. "index": "not_analyzed",
  121. "type": "string"
  122. },
  123. "project_duration": {
  124. "type": "long"
  125. },
  126. "bid_guarantee": {
  127. "type": "boolean"
  128. },
  129. "href": {
  130. "index": "not_analyzed",
  131. "type": "string"
  132. },
  133. "id": {
  134. "index": "not_analyzed",
  135. "type": "string"
  136. },
  137. "filetext": {
  138. "analyzer": "my_ngram",
  139. "type": "string"
  140. },
  141. "budget": {
  142. "type": "double"
  143. },
  144. "buyeraddr": {
  145. "index": "not_analyzed",
  146. "type": "string"
  147. },
  148. "area": {
  149. "index": "not_analyzed",
  150. "type": "string"
  151. },
  152. "bidamount": {
  153. "type": "double"
  154. },
  155. "projectname": {
  156. "index": "not_analyzed",
  157. "type": "string",
  158. "fields": {
  159. "pname": {
  160. "type": "string"
  161. }
  162. }
  163. },
  164. "buyertel": {
  165. "index": "not_analyzed",
  166. "type": "string"
  167. },
  168. "project_scale": {
  169. "analyzer": "my_ngram",
  170. "type": "string"
  171. },
  172. "signaturedate": {
  173. "type": "long"
  174. },
  175. "s_winner": {
  176. "analyzer": "douhao",
  177. "type": "string",
  178. "fields": {
  179. "mwinner": {
  180. "analyzer": "my_ngram_title",
  181. "type": "string"
  182. }
  183. }
  184. },
  185. "winnerorder": {
  186. "properties": {
  187. "sortstr": {
  188. "index": "not_analyzed",
  189. "type": "string"
  190. },
  191. "entname": {
  192. "index": "not_analyzed",
  193. "type": "string"
  194. },
  195. "sort": {
  196. "type": "integer"
  197. }
  198. }
  199. },
  200. "supervisorrate": {
  201. "type": "double"
  202. },
  203. "project_completedate": {
  204. "type": "long"
  205. },
  206. "buyer": {
  207. "index": "not_analyzed",
  208. "type": "string",
  209. "fields": {
  210. "mbuyer": {
  211. "analyzer": "my_ngram_title",
  212. "type": "string"
  213. }
  214. }
  215. },
  216. "winner": {
  217. "index": "not_analyzed",
  218. "type": "string"
  219. },
  220. "qualifies": {
  221. "analyzer": "my_ngram",
  222. "type": "string"
  223. },
  224. "district": {
  225. "index": "not_analyzed",
  226. "type": "string"
  227. },
  228. "publishtime": {
  229. "type": "long"
  230. },
  231. "buyerzipcode": {
  232. "index": "not_analyzed",
  233. "type": "string"
  234. },
  235. "detail": {
  236. "analyzer": "my_ngram",
  237. "type": "string"
  238. },
  239. "projectinfo": {
  240. "properties": {
  241. "approvecontent": {
  242. "analyzer": "my_ngram",
  243. "type": "string"
  244. },
  245. "approvenumber": {
  246. "index": "not_analyzed",
  247. "type": "string"
  248. },
  249. "approvecity": {
  250. "index": "not_analyzed",
  251. "type": "string"
  252. },
  253. "approvestatus": {
  254. "index": "not_analyzed",
  255. "type": "string"
  256. },
  257. "approvecode": {
  258. "index": "not_analyzed",
  259. "type": "string"
  260. },
  261. "projecttype": {
  262. "index": "not_analyzed",
  263. "type": "string"
  264. },
  265. "approvetime": {
  266. "index": "not_analyzed",
  267. "type": "string"
  268. },
  269. "approvedept": {
  270. "analyzer": "my_ngram",
  271. "type": "string"
  272. }
  273. }
  274. },
  275. "city": {
  276. "index": "not_analyzed",
  277. "type": "string"
  278. },
  279. "purchasing": {
  280. "analyzer": "my_ngram",
  281. "type": "string"
  282. },
  283. "projectscope": {
  284. "index": "not_analyzed",
  285. "type": "string",
  286. "fields": {
  287. "pscope": {
  288. "analyzer": "my_ngram",
  289. "type": "string"
  290. }
  291. }
  292. },
  293. "agencytel": {
  294. "index": "not_analyzed",
  295. "type": "string"
  296. },
  297. "project_startdate": {
  298. "type": "long"
  299. },
  300. "title": {
  301. "analyzer": "my_ngram_title",
  302. "type": "string"
  303. },
  304. "winnerperson": {
  305. "index": "not_analyzed",
  306. "type": "string"
  307. },
  308. "comeintime": {
  309. "type": "long"
  310. },
  311. "s_topscopeclass": {
  312. "analyzer": "douhao",
  313. "type": "string"
  314. },
  315. "projectperiod": {
  316. "index": "not_analyzed",
  317. "type": "string"
  318. },
  319. "project_timeunit": {
  320. "index": "not_analyzed",
  321. "type": "string"
  322. },
  323. "spidercode": {
  324. "index": "not_analyzed",
  325. "type": "string"
  326. },
  327. "subtype": {
  328. "index": "not_analyzed",
  329. "type": "string"
  330. },
  331. "infoformat": {
  332. "type": "integer"
  333. },
  334. "s_subscopeclass": {
  335. "analyzer": "douhao",
  336. "type": "string"
  337. },
  338. "agency": {
  339. "index": "not_analyzed",
  340. "type": "string",
  341. "fields": {
  342. "magency": {
  343. "analyzer": "my_ngram",
  344. "type": "string"
  345. }
  346. }
  347. },
  348. "agencyperson": {
  349. "index": "not_analyzed",
  350. "type": "string"
  351. },
  352. "bidstatus": {
  353. "index": "not_analyzed",
  354. "type": "string"
  355. },
  356. "payway": {
  357. "index": "not_analyzed",
  358. "type": "string"
  359. },
  360. "winnertel": {
  361. "index": "not_analyzed",
  362. "type": "string"
  363. },
  364. "buyerclass": {
  365. "index": "not_analyzed",
  366. "type": "string"
  367. },
  368. "contract_guarantee": {
  369. "type": "boolean"
  370. },
  371. "site": {
  372. "index": "not_analyzed",
  373. "type": "string"
  374. },
  375. "bidopentime": {
  376. "type": "long"
  377. },
  378. "topscopeclass": {
  379. "index": "not_analyzed",
  380. "type": "string"
  381. },
  382. "buyerperson": {
  383. "index": "not_analyzed",
  384. "type": "string"
  385. },
  386. "purchasinglist": {
  387. "properties": {
  388. "number": {
  389. "type": "double"
  390. },
  391. "itemname": {
  392. "index": "not_analyzed",
  393. "type": "string"
  394. },
  395. "totalprice": {
  396. "type": "double"
  397. },
  398. "unitname": {
  399. "index": "not_analyzed",
  400. "type": "string"
  401. },
  402. "model": {
  403. "analyzer": "my_ngram",
  404. "type": "string"
  405. },
  406. "brandname": {
  407. "analyzer": "my_ngram",
  408. "type": "string"
  409. },
  410. "unitprice": {
  411. "type": "double"
  412. }
  413. }
  414. }
  415. }
  416. }
  417. }'