Jianghan před 4 roky
rodič
revize
b4cc9baeda

+ 1 - 25
mapping/biddingmapping.json

@@ -1,4 +1,4 @@
-curl -XPUT http://127.0.0.1:9800/bidding_v1 -d '{
+curl -XPUT http://127.0.0.1:9800/bidding_v2 -d '{
   "settings": {
     "index": {
       "analysis": {
@@ -394,27 +394,3 @@ curl -XPUT http://127.0.0.1:9800/bidding_v1 -d '{
     }
   }
 }'
-
-
-
-//新增某字段mapping
-curl -XPUT http://192.168.3.11:9800/bidding_v5/bidding/_mapping -d '
-{
-	"properties": {
-		"bidcycle":{
-			"type":"integer"
-		}
-	}
-}'
-
-
-
-
-"bidamount": {
-          "null_value": 0,
-          "type": "double"
-        },
-"budget": {
-          "null_value": 0,
-          "type": "double"
-        }

+ 17 - 2
mapping/entmapping.json

@@ -1,4 +1,4 @@
- curl -XPUT http://127.0.0.1:9800/qyxy_v1 -d '{
+ curl -XPUT http://127.0.0.1:9800/qyxy_v2 -d '{
   "settings": {
     "index": {
 	  "analysis": {
@@ -55,7 +55,13 @@
 		},
 		"history_name": {
 		  "analyzer": "my_ngram",
-		  "type": "string"
+		  "type": "string",
+		  "fields": {
+			  "hname": {
+				"index": "not_analyzed",
+				"type": "string"
+			  }
+		  }
 		},
 		"company_code": {
 		  "index": "not_analyzed",
@@ -96,6 +102,9 @@
 		"company_type": {
 		  "type": "string"
 		},
+		"company_type_int": {
+			"type": "integer"
+		},
 		"legal_person": {
 		  "index": "not_analyzed",
 		  "type": "string"
@@ -183,6 +192,12 @@
 			"identify_type": {
 			  "index": "not_analyzed",
 			  "type": "string"
+			},
+			"stock_capital": {
+				"type": "double"
+			},
+			"stock_realcapital": {
+				"type": "double"
 			}
 		  }
 		},

+ 2 - 1
mapping/projectset.json

@@ -414,4 +414,5 @@ curl -XPUT http://127.0.0.1:9800/projectset_v1 -d '{
       }
     }
   }
-}'
+}'
+

+ 427 - 0
mapping/tool.txt

@@ -0,0 +1,427 @@
+// 新增某字段mapping
+curl -XPUT http://192.168.3.128:9800/bidding_v5/bidding/_mapping -d '
+{
+  "properties": {
+    "entidlist": {
+    "index": "not_analyzed",
+    "type": "string"
+    }
+  }
+}'
+
+//开启节点平衡
+curl -XPUT http://127.0.0.1:9800/_cluster/settings -d'{
+  "transient" : {
+    "cluster.routing.allocation.enable" : "all"
+  }
+}'
+
+//关闭节点平衡
+curl -XPUT http://127.0.0.1:9800/_cluster/settings -d'{
+  "transient" : {
+    "cluster.routing.allocation.enable" : "none"
+  }
+}'
+//开启节点平衡
+curl -XPUT http://192.168.3.11:9800/_cluster/settings -d'{
+  "transient" : {
+    "cluster.routing.allocation.enable" : "all"
+  }
+}'
+
+//关闭节点平衡
+curl -XPUT http://192.168.3.11:9800/_cluster/settings -d'{
+  "transient" : {
+    "cluster.routing.allocation.enable" : "none"
+  }
+}'
+//手动移动节点
+curl -XPOST 'http://192.168.3.128:9800/_cluster/reroute' -d '{
+    "commands" : [ {
+        "move" : 
+            {
+              "index" : "qyxy_v1", "shard" : 2, 
+              "from_node" : "GqK0c02DTi264kKPYmw3pA", "to_node" : "m0YXNuy9RGqTo5JWdD5BdA"
+            }
+        }
+    ]
+}'
+//查看节点个数
+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
+}'
+
+
+
+//新增某字段mapping
+curl -XPUT http://192.168.3.128:9800/projectset_v5/projectset/_mapping -d '
+{
+	"properties": {
+    "project_startdate": {
+      "type": "long"
+    },
+    "project_completedate": {
+      "type": "long"
+    }
+	}
+}'
+
+curl -XPUT http://127.0.0.1:9800/qyxy_v1/qyxy/_mapping -d '
+{
+	"properties": {
+    "company_type_int": {
+      "type": "integer"
+    }
+	}
+}'
+
+// 恢复mapping文件
+curl -XPOST "http://192.168.3.11: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"
+          }
+        }
+      }
+    }
+  }
+}'
+

+ 9 - 0
mapping/新建索引库.txt

@@ -0,0 +1,9 @@
+1.执行mapping文件创建索引库
+2.执行节点平衡all--none
+
+######################生索引######################
+./sendtask -ip 127.0.0.1 -p 14833 -gtid 5a85ae800000000000000000  -lteid 5d8649000000000000000000 -stype biddingdata -param '{"coll":"bidding"}'
+1、新启一个生索引程序,udp端口修改了如2483
+2、生索引 stype使用biddingdata,对应配置在bidding段
+3、先跑bidding_back库,再跑bidding库,对应抽取在extract_v3库result_v3表
+5、生索引生到bidding_v4中,先跑一条,然后看看结果对不对http://127.0.0.1:9800/bidding_v4/bidding/5b679d10a5cb26b9b7a5555e?pretty

+ 0 - 9
mapping/新建索引库流程.txt

@@ -1,9 +0,0 @@
-1.执行mapping文件创建索引库
-2.执行节点平衡all--none
-
-######################生索引######################
-./sendtask -ip 127.0.0.1 -p 14833 -gtid 5a85ae800000000000000000  -lteid 5d8649000000000000000000 -stype biddingdata -param '{"coll":"bidding"}'
-1、新启一个生索引程序,udp端口修改了如2483
-2、生索引 stype使用biddingdata,对应配置在bidding段
-3、先跑bidding_back库,再跑bidding库,对应抽取在extract_v3库result_v3表
-5、生索引生到bidding_v4中,先跑一条,然后看看结果对不对http://127.0.0.1:9800/bidding_v4/bidding/5b679d10a5cb26b9b7a5555e?pretty

+ 17 - 3
mapping/更换索引库索引名称.txt

@@ -40,16 +40,30 @@ curl -XPOST http://127.0.0.1:9800/_aliases -d '
     ]
 }'
 
-curl -XPOST http://192.168.3.128:9800/_aliases -d '
+curl -XPOST http://127.0.0.1:9800/_aliases -d '
 {
     "actions": [
         { "remove": {
             "alias": "projectset",
-            "index": "projectset_v5"
+            "index": "projectset_v3"
         }},
         { "add": {
             "alias": "projectset",
-            "index": "projectset_v6"
+            "index": "projectset_v1"
+        }}
+    ]
+}'
+
+curl -XPOST http://127.0.0.1:9800/_aliases -d '
+{
+    "actions": [
+        { "remove": {
+            "alias": "qyxy",
+            "index": "qyxy_v1"
+        }},
+        { "add": {
+            "alias": "qyxy",
+            "index": "qyxy_v2"
         }}
     ]
 }'

+ 0 - 45
mapping/节点平衡.txt

@@ -1,45 +0,0 @@
-//开启节点平衡
-curl -XPUT http://127.0.0.1:9800/_cluster/settings -d'{
-  "transient" : {
-    "cluster.routing.allocation.enable" : "all"
-  }
-}'
-
-//关闭节点平衡
-curl -XPUT http://127.0.0.1:9800/_cluster/settings -d'{
-  "transient" : {
-    "cluster.routing.allocation.enable" : "none"
-  }
-}'
-//开启节点平衡
-curl -XPUT http://192.168.3.128:9800/_cluster/settings -d'{
-  "transient" : {
-    "cluster.routing.allocation.enable" : "all"
-  }
-}'
-
-//关闭节点平衡
-curl -XPUT http://192.168.3.128:9800/_cluster/settings -d'{
-  "transient" : {
-    "cluster.routing.allocation.enable" : "none"
-  }
-}'
-//手动移动节点
-curl -XPOST 'http://127.0.0.1:9800/_cluster/reroute' -d '{
-    "commands" : [ {
-        "move" : 
-            {
-              "index" : "bidding_v1", "shard" : 5, 
-              "from_node" : "793VjTv8Rze4LGvjK0pNUw", "to_node" : "KmsGnH3EQeiwT92SOzR7KQ"
-            }
-        }
-      
-    ]
-}'
-//查看节点个数
-curl http://localhost:9800/_settings?pretty
-
-//设置节点个数
-curl -XPUT 'http://127.0.0.1:9800/bidding_v1/_settings' -d '{
-"index.routing.allocation.total_shards_per_node":2
-}'