소스 검색

es查询修改

renjiaojiao 3 년 전
부모
커밋
381c313a87
2개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      rpc/knowledge/internal/logic/knowledgedellogic.go
  2. 1 1
      rpc/knowledge/internal/logic/knowledgeeditlogic.go

+ 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,