浏览代码

feat:提交

fuwencai 8 月之前
父节点
当前提交
6976ca53c9
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      rpc/knowledge/util/elasticsearch_dsl.go

+ 1 - 1
rpc/knowledge/util/elasticsearch_dsl.go

@@ -93,7 +93,7 @@ func GetQueryOT(tags, question, keywords, repositoryId string) (qstr string) {
 	return qstr
 }
 
-var queryStr = `{"_source": ["question","intention","answer"],"size": %d, "min_score":%v,"query": {"bool": {"must": [{"term":{"entId":%v}},{"script_score": {"query": {"match_all": {}},"script": {"source": "cosineSimilarity(params.queryVector,'questionVector')+1", "params": {"queryVector": %v}}}}]}}}`
+var queryStr = `{"_source": ["question","intention","answer"],"size": %d, "min_score":%v,"query": {"bool": {"must": [{"script_score": {"query": {"term":{"entId":%v}},"script": {"source": "cosineSimilarity(params.queryVector,'questionVector')+1", "params": {"queryVector": %v}}}}]}}}`
 
 func GetAnswerQueryStr(question string, entId string, size int, minScore float64) string {
 	qv, _ := EncodeVector(question)