Browse Source

es查询修改

renjiaojiao 3 years ago
parent
commit
381c313a87

+ 1 - 1
rpc/knowledge/internal/logic/knowledgedellogic.go

@@ -40,7 +40,7 @@ func (l *KnowledgeDelLogic) KnowledgeDel(in *knowledgeclient.KnowledgeDelReq) (*
 
 	if fool {
 		//删除es数据
-		query := `{"query":{"bool":{"must":[{"term":{"smart_v.answerId":"` + strconv.Itoa(int(in.AnswerId)) + `"}}],"must_not":[],"should":[]}},"from":0,"size":10,"sort":[],"facets":{}}`
+		query := `{"query":{"bool":{"must":[{"term":{"answerId":"` + strconv.Itoa(int(in.AnswerId)) + `"}}],"must_not":[],"should":[]}},"from":0,"size":10,"sort":[],"facets":{}}`
 		ok := elastic.Del(C.Es.Index, C.Es.Type, query)
 		if ok {
 			result.ErrorCode = 0

+ 1 - 1
rpc/knowledge/internal/logic/knowledgeeditlogic.go

@@ -51,7 +51,7 @@ func (l *KnowledgeEditLogic) KnowledgeEdit(in *knowledgeclient.KnowledgeEditReq)
 
 	if fool {
 		//先查询es获取es _id
-		query := `{"query":{"bool":{"must":[{"term":{"smart_v.answerId":"` + strconv.Itoa(int(in.AnswerId)) + `"}}],"must_not":[],"should":[]}},"from":0,"size":10,"sort":[],"facets":{}}`
+		query := `{"query":{"bool":{"must":[{"term":{"answerId":"` + strconv.Itoa(int(in.AnswerId)) + `"}}],"must_not":[],"should":[]}},"from":0,"size":10,"sort":[],"facets":{}}`
 		//修改es数据
 		newKnowledge := map[string]interface{}{
 			"knowledgeId":  in.KnowledgeId,