// 新增某字段mapping curl -XPUT http://127.0.0.1:19800/bidding_v2/bidding/_mapping -d ' { "properties": { "bidstarttime": { "type": "long" }, "docendtime": { "type": "long" }, "docstarttime": { "type": "long" }, "signendtime": { "type": "long" }, "signstarttime": { "type": "long" } } }' //开启节点平衡 curl -XPUT http://127.0.0.1:19805/_cluster/settings --user es_all:TopJkO2E_d1x -H 'content-Type:application/json' -d'{ "transient" : { "cluster.routing.allocation.enable" : "all" } }' //关闭节点平衡 curl -XPUT http://127.0.0.1:19800/_cluster/settings --user es_all:TopJkO2E_d1x -H 'content-Type:application/json' -d'{ "transient" : { "cluster.routing.allocation.enable" : "none" } }' //开启节点平衡 curl -XPUT http://192.168.3.206:9800/_cluster/settings -d'{ "transient" : { "cluster.routing.allocation.enable" : "all" } }' //关闭节点平衡 curl -XPUT http://192.168.3.206:9800/_cluster/settings -d'{ "transient" : { "cluster.routing.allocation.enable" : "none" } }' //开启节点平衡,es7 环境,需要传递header参数 curl -H 'Content-Type: application/json' -XPUT http://192.168.3.149:9200/_cluster/settings -d'{ "transient" : { "cluster.routing.allocation.enable" : "all" } }' //关闭节点平衡 curl -H 'Content-Type: application/json' -XPUT http://192.168.3.149:9200/_cluster/settings -d'{ "transient" : { "cluster.routing.allocation.enable" : "none" } }' //手动移动节点 curl -XPOST 'http://127.0.0.1:9800/_cluster/reroute' -d '{ "commands" : [ { "move" : { "index": "qyxy_v2", "shard": 12, "from_node": "node_12", "to_node": "node_1" } } ] }' //查看节点个数 curl http://localhost:9800/_settings?pretty //设置节点个数 curl -XPUT 'http://127.0.0.1:9800/projectset_v1/_settings' -d '{ "index.routing.allocation.total_shards_per_node":2 }' // 分片异常 unsigned curl -XPOST '192.168.3.206:9800/_cluster/reroute' -d '{ "commands": [{ "allocate": { "index": "projectset_v1", "shard": 1, "node": "node-4", "allow_primary": 1 } }] }' //新增某字段mapping curl -XPUT http://127.0.0.1:9800/bidding_v1/bidding/_mapping -d ' { "properties": { "isValidFile": { "type": "boolean" } } }' //新增某字段mapping,es7 版本 curl -XPUT "http://192.168.3.149:9200/bidding_v2/_mapping" -H 'Content-Type: application/json' -d' { "properties": { "dataweight": { "type": "long" } } } ' curl -XPUT http://127.0.0.1:9800/bidding_v1/bidding/_mapping -d ' { "properties": { "dataweight": { "type": "integer" } } }' // 恢复mapping文件 curl -XPOST "http://192.168.3.128:9800/bidding/bidding/_mapping?pretty" -d ' { "bidding": { "transform": { "lang": "groovy", "script": "ctx._source[\"id\"] = ctx._source[\"_id\"]" }, "_id": { "path": "_id" }, "_all": { "enabled": false }, "properties": { "winneraddr": { "index": "not_analyzed", "type": "string" }, "projectcode": { "index": "not_analyzed", "type": "string" }, "channel": { "index": "not_analyzed", "type": "string" }, "projectaddr": { "index": "not_analyzed", "type": "string" }, "contractcode": { "index": "not_analyzed", "type": "string" }, "entidlist": { "index": "not_analyzed", "type": "string" }, "agencyaddr": { "index": "not_analyzed", "type": "string" }, "tagname": { "analyzer": "douhao", "type": "string" }, "toptype": { "index": "not_analyzed", "type": "string" }, "project_duration": { "type": "long" }, "bid_guarantee": { "type": "boolean" }, "href": { "index": "not_analyzed", "type": "string" }, "id": { "index": "not_analyzed", "type": "string" }, "filetext": { "analyzer": "my_ngram", "type": "string" }, "budget": { "type": "double" }, "buyeraddr": { "index": "not_analyzed", "type": "string" }, "area": { "index": "not_analyzed", "type": "string" }, "bidamount": { "type": "double" }, "projectname": { "index": "not_analyzed", "type": "string", "fields": { "pname": { "type": "string" } } }, "buyertel": { "index": "not_analyzed", "type": "string" }, "project_scale": { "analyzer": "my_ngram", "type": "string" }, "signaturedate": { "type": "long" }, "s_winner": { "analyzer": "douhao", "type": "string", "fields": { "mwinner": { "analyzer": "my_ngram_title", "type": "string" } } }, "winnerorder": { "properties": { "sortstr": { "index": "not_analyzed", "type": "string" }, "entname": { "index": "not_analyzed", "type": "string" }, "sort": { "type": "integer" } } }, "supervisorrate": { "type": "double" }, "project_completedate": { "type": "long" }, "buyer": { "index": "not_analyzed", "type": "string", "fields": { "mbuyer": { "analyzer": "my_ngram_title", "type": "string" } } }, "winner": { "index": "not_analyzed", "type": "string" }, "qualifies": { "analyzer": "my_ngram", "type": "string" }, "district": { "index": "not_analyzed", "type": "string" }, "publishtime": { "type": "long" }, "buyerzipcode": { "index": "not_analyzed", "type": "string" }, "detail": { "analyzer": "my_ngram", "type": "string" }, "projectinfo": { "properties": { "approvecontent": { "analyzer": "my_ngram", "type": "string" }, "approvenumber": { "index": "not_analyzed", "type": "string" }, "approvecity": { "index": "not_analyzed", "type": "string" }, "approvestatus": { "index": "not_analyzed", "type": "string" }, "approvecode": { "index": "not_analyzed", "type": "string" }, "projecttype": { "index": "not_analyzed", "type": "string" }, "approvetime": { "index": "not_analyzed", "type": "string" }, "approvedept": { "analyzer": "my_ngram", "type": "string" } } }, "city": { "index": "not_analyzed", "type": "string" }, "purchasing": { "analyzer": "my_ngram", "type": "string" }, "projectscope": { "index": "not_analyzed", "type": "string", "fields": { "pscope": { "analyzer": "my_ngram", "type": "string" } } }, "agencytel": { "index": "not_analyzed", "type": "string" }, "project_startdate": { "type": "long" }, "title": { "analyzer": "my_ngram_title", "type": "string" }, "winnerperson": { "index": "not_analyzed", "type": "string" }, "comeintime": { "type": "long" }, "s_topscopeclass": { "analyzer": "douhao", "type": "string" }, "projectperiod": { "index": "not_analyzed", "type": "string" }, "project_timeunit": { "index": "not_analyzed", "type": "string" }, "spidercode": { "index": "not_analyzed", "type": "string" }, "subtype": { "index": "not_analyzed", "type": "string" }, "infoformat": { "type": "integer" }, "s_subscopeclass": { "analyzer": "douhao", "type": "string" }, "agency": { "index": "not_analyzed", "type": "string", "fields": { "magency": { "analyzer": "my_ngram", "type": "string" } } }, "agencyperson": { "index": "not_analyzed", "type": "string" }, "bidstatus": { "index": "not_analyzed", "type": "string" }, "payway": { "index": "not_analyzed", "type": "string" }, "winnertel": { "index": "not_analyzed", "type": "string" }, "buyerclass": { "index": "not_analyzed", "type": "string" }, "contract_guarantee": { "type": "boolean" }, "site": { "index": "not_analyzed", "type": "string" }, "bidopentime": { "type": "long" }, "topscopeclass": { "index": "not_analyzed", "type": "string" }, "buyerperson": { "index": "not_analyzed", "type": "string" }, "purchasinglist": { "properties": { "number": { "type": "double" }, "itemname": { "index": "not_analyzed", "type": "string" }, "totalprice": { "type": "double" }, "unitname": { "index": "not_analyzed", "type": "string" }, "model": { "analyzer": "my_ngram", "type": "string" }, "brandname": { "analyzer": "my_ngram", "type": "string" }, "unitprice": { "type": "double" } } } } } }'