|
@@ -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": [{"script_score": {"query": {"term":{"entId":%v}},"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": "cosine(params.queryVector,doc['questionVector'])+1", "params": {"queryVector": %v}}}}]}}}`
|
|
|
|
|
|
func GetAnswerQueryStr(question string, entId string, size int, minScore float64) string {
|
|
|
qv, _ := EncodeVector(question)
|