apple 4 роки тому
батько
коміт
16270c56f5

+ 5 - 0
udpdataclear/udpSensitiveWords/grpc_server/main.go

@@ -76,6 +76,11 @@ func init() {
 
 func main() {
 
+	log.Println("1111")
+	//log.Println(escape("同方知网(北京)技术有限公司"))
+	dealWithNameScoreRules("同方知网(北京)技术有限公司")
+
+	return
 	//临时测试
 	MixDataMgo = &util.MongodbSim{
 		MongodbAddr: "172.17.4.187:27082,172.17.145.163:27083",

+ 4 - 1
udpdataclear/udpSensitiveWords/grpc_server/words.go

@@ -16,6 +16,8 @@ func dealWithNameScoreRules(name string) (string,bool) {
 		return "",false
 	}
 	query := `{"query":{"bool":{"must":[{"query_string":{"default_field":"unique_qy.name_word","query":"`+old_name+`"}}],"must_not":[],"should":[]}},"from":"0","size":"1"}`
+	log.Println("222",query)
+	return "",false
 	tmp := make(map[string]interface{})
 	json.Unmarshal([]byte(query),&tmp)
 	searchResult, err := Client_Es.Search().Index(es_index).Type(es_type).Source(tmp).Do()
@@ -109,7 +111,8 @@ func escape(s string) string {
 		//}
 		if c == '\\' || c == '+' || c == '-' || c == '!' || c == '(' || c == ')' || c == ':' || c == '^' || c == '[' || c == ']' || c == '{' || c == '}' || c == '~' || c == '*' || c == '?' || c == '|' || c == '&' || c == '/' || c == '#' || c == '@' || c == '(' || c == ')' || c == '>' || c == '<' || c == '“' || c == '”' || c == '?' || c == '、' || c == '.' {
 			a := string([]rune{os.PathSeparator, '\\'})
-			news = news + a + `\` + string(c)
+			//news = news + a + `\` + string(c)
+			news = news + a  + string(c)
 		} else {
 			news = news + string(c)
 		}