|
@@ -49,14 +49,18 @@ func DSL4SmartResponse(question string, entId string, msgType int, addr, index,
|
|
|
return ""
|
|
|
}
|
|
|
|
|
|
-func DSL4SearchByKwsOrid(keyWords string, entId string) string {
|
|
|
+func DSL4SearchByKwsOrid(keyWords string, entId string, mark int) string {
|
|
|
|
|
|
var (
|
|
|
sql = `{"query": {"bool": {"must": [%s%s]}}}`
|
|
|
queryMatch = `{"match":{"keywords":{"query":"%s","minimum_should_match":"%s"}}}`
|
|
|
ridTerms = `,{"term":{"entId":%s}}`
|
|
|
)
|
|
|
- queryMatch = fmt.Sprintf(queryMatch, keyWords, "20%")
|
|
|
+ if mark == 1 {
|
|
|
+ queryMatch = fmt.Sprintf(queryMatch, keyWords, "30%")
|
|
|
+ } else {
|
|
|
+ queryMatch = fmt.Sprintf(queryMatch, keyWords, "20%")
|
|
|
+ }
|
|
|
ridTerms = fmt.Sprintf(ridTerms, entId)
|
|
|
sql = fmt.Sprintf(sql, queryMatch, ridTerms)
|
|
|
//log.Println("sql", sql)
|