Jianghan 2 anos atrás
pai
commit
52aba47795

+ 25 - 37
mapping/medical_institution.txt

@@ -1,45 +1,33 @@
 curl -XPUT http://127.0.0.1:19800/medical_institution_v1 -d '{
   "settings": {
-    "index": {
-      "search": {
-        "showlog": {
-          "threshold": {
-            "query": {
-              "trace": "100ms"
-            },
-            "fetch": {
-              "tract": "100ms"
-            }
-          }
-        }
-      },
-      "analysis": {
-        "analyzer": {
-          "douhao": {
-            "type": "pattern",
-            "pattern": ","
-          },
-          "my_ngram": {
-            "filter": [
-              "lowercase"
-            ],
-            "tokenizer": "my_ngram"
-          }
+    "analysis": {
+      "analyzer": {
+        "douhao": {
+          "type": "pattern",
+          "pattern": ","
         },
-        "tokenizer": {
-          "my_ngram": {
-            "token_chars": [
-              "letter",
-              "digit",
-              "punctuation",
-              "symbol"
-            ],
-            "min_gram": "2",
-            "type": "nGram",
-            "max_gram": "2"
-          }
+        "my_ngram": {
+          "filter": [
+            "lowercase"
+          ],
+          "tokenizer": "my_ngram"
         }
       },
+      "tokenizer": {
+        "my_ngram": {
+          "token_chars": [
+            "letter",
+            "digit",
+            "punctuation",
+            "symbol"
+          ],
+          "min_gram": "2",
+          "type": "nGram",
+          "max_gram": "2"
+        }
+      }
+    },
+    "index": {
       "number_of_shards": "15",
       "number_of_replicas": "0"
     }

+ 57 - 93
mapping/oprd_bidding.txt

@@ -1,134 +1,99 @@
 curl -XPUT http://127.0.0.1:19800/oprd_bidding_v1 -d '
 {
   "settings": {
-    "index": {
-      "search": {
-        "showlog": {
-          "threshold": {
-            "query": {
-              "trace": "100ms"
-            },
-            "fetch": {
-              "tract": "100ms"
-            }
-          }
+    "analysis": {
+      "analyzer": {
+        "my_ngram_title": {
+          "filter": [
+            "lowercase"
+          ],
+          "tokenizer": "my_ngram_title"
+        },
+        "douhao": {
+          "type": "pattern",
+          "pattern": ","
+        },
+        "my_ngram": {
+          "filter": [
+            "lowercase"
+          ],
+          "tokenizer": "my_ngram"
         }
       },
-      "analysis": {
-        "analyzer": {
-          "my_ngram_title": {
-            "filter": [
-              "lowercase"
-            ],
-            "tokenizer": "my_ngram_title"
-          },
-          "douhao": {
-            "type": "pattern",
-            "pattern": ","
-          },
-          "my_ngram": {
-            "filter": [
-              "lowercase"
-            ],
-            "tokenizer": "my_ngram"
-          }
-        },
-        "tokenizer": {
-          "my_ngram_title": {
-            "token_chars": [
-              "letter",
-              "digit",
-              "punctuation",
-              "symbol"
-            ],
-            "min_gram": "1",
-            "type": "nGram",
-            "max_gram": "1"
-          },
-          "my_ngram": {
-            "token_chars": [
-              "letter",
-              "digit",
-              "punctuation",
-              "symbol"
-            ],
-            "min_gram": "2",
-            "type": "nGram",
-            "max_gram": "2"
-          }
+      "tokenizer": {
+        "my_ngram_title": {
+          "token_chars": [
+            "letter",
+            "digit",
+            "punctuation",
+            "symbol"
+          ],
+          "min_gram": "1",
+          "type": "nGram",
+          "max_gram": "1"
+        },
+        "my_ngram": {
+          "token_chars": [
+            "letter",
+            "digit",
+            "punctuation",
+            "symbol"
+          ],
+          "min_gram": "2",
+          "type": "nGram",
+          "max_gram": "2"
         }
-      },
-      "number_of_shards": "20",
+      }
+    },
+    "index": {
+      "number_of_shards": "12",
       "number_of_replicas": "0"
     }
   },
   "mappings": {
-    "bidding": {
-      "transform": {
-        "lang": "groovy",
-        "script": "ctx._source[\"id\"] = ctx._source[\"_id\"]"
-      },
-      "_id": {
-        "path": "_id"
-      },
-      "_all": {
-        "enabled": false
-      },
+    "dynamic": "false",
       "properties": {
         "buyerzipcode": {
-          "index": "not_analyzed",
-          "type": "string"
+          "type": "keyword"
         },
         "winnertel": {
-          "index": "not_analyzed",
-          "type": "string"
+          "type": "keyword"
         },
         "winnerperson": {
-          "index": "not_analyzed",
-          "type": "string"
+          "type": "keyword"
         },
         "contractcode": {
-          "index": "not_analyzed",
-          "type": "string"
+          "type": "keyword"
         },
         "winneraddr": {
-          "index": "not_analyzed",
-          "type": "string"
+          "type": "keyword"
         },
         "agencyaddr": {
-          "index": "not_analyzed",
-          "type": "string"
+          "type": "keyword"
         },
         "buyeraddr": {
-          "index": "not_analyzed",
-          "type": "string"
+          "type": "keyword"
         },
         "signaturedate": {
           "type": "long"
         },
         "projectperiod": {
-          "index": "not_analyzed",
-          "type": "string"
+          "type": "keyword"
         },
         "projectaddr": {
-          "index": "not_analyzed",
-          "type": "string"
+          "type": "keyword"
         },
         "agencytel": {
-          "index": "not_analyzed",
-          "type": "string"
+          "type": "keyword"
         },
         "agencyperson": {
-          "index": "not_analyzed",
-          "type": "string"
+          "type": "keyword"
         },
         "buyerperson": {
-          "index": "not_analyzed",
-          "type": "string"
+          "type": "keyword"
         },
         "agency": {
-          "index": "not_analyzed",
-          "type": "string",
+          "type": "keyword",
           "fields": {
             "magency": {
               "analyzer": "my_ngram",
@@ -449,7 +414,6 @@ curl -XPUT http://127.0.0.1:19800/oprd_bidding_v1 -d '
           "type": "string"
         }
       }
-    }
   }
 }
 '

+ 2 - 2
mapping/proposed.txt

@@ -1,4 +1,4 @@
-curl -XPUT http://127.0.0.1:9200/proposed_v1 -H 'content-Type:application/json' -d '{
+curl -XPUT http://127.0.0.1:19805/proposed_v1 --user es_all:TopJkO2E_d1x -H 'content-Type:application/json' -d '{
   "settings": {
     "analysis": {
       "analyzer": {
@@ -55,7 +55,7 @@ curl -XPUT http://127.0.0.1:9200/proposed_v1 -H 'content-Type:application/json'
       }
     },
     "index": {
-      "number_of_shards": 1,
+      "number_of_shards": 12,
       "number_of_replicas": 0
     }
   },

+ 2 - 2
mapping/tool.txt

@@ -21,14 +21,14 @@ curl -XPUT http://127.0.0.1:19800/bidding_v1/bidding/_mapping -d '
 }'
 
 //开启节点平衡
-curl -XPUT http://127.0.0.1:19800/_cluster/settings -d'{
+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 -d'{
+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"
   }

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

@@ -26,7 +26,7 @@ curl -XPOST http://127.0.0.1:19800/_aliases -d '
     ]
 }'
 
-curl -XPOST http://127.0.0.1:19800/_aliases -d '
+curl -XPOST http://127.0.0.1:19800/_aliases  -d '
 {
     "actions": [
         { "remove": {
@@ -40,12 +40,12 @@ curl -XPOST http://127.0.0.1:19800/_aliases -d '
     ]
 }'
 
-curl -XPOST http://127.0.0.1:19800/_aliases -d '
+curl -XPOST http://127.0.0.1:19805/_aliases --user es_all:TopJkO2E_d1x -H 'content-Type:application/json' -d '
 {
     "actions": [
         { "add": {
-            "alias": "supplier_product",
-            "index": "supplier_product_v1"
+            "alias": "proposed",
+            "index": "proposed_v1"
         }}
     ]
 }'