|
@@ -14,7 +14,7 @@ import (
|
|
|
// GetSearchQuery 整理关键词等查询条件
|
|
|
func GetSearchQuery(in *bxcore.SearchReq, mustQuery string) (qstr string) {
|
|
|
var (
|
|
|
- musts, must_not []string
|
|
|
+ musts, mustNot []string
|
|
|
)
|
|
|
if mustQuery != "" {
|
|
|
musts = append(musts, mustQuery)
|
|
@@ -100,7 +100,7 @@ func GetSearchQuery(in *bxcore.SearchReq, mustQuery string) (qstr string) {
|
|
|
hasBuyerTel := in.BuyerTel
|
|
|
if hasBuyerTel != "" {
|
|
|
if hasBuyerTel == "y" {
|
|
|
- must_not = append(must_not, fmt.Sprintf(queryMissing, "buyertel"))
|
|
|
+ mustNot = append(mustNot, fmt.Sprintf(queryMissing, "buyertel"))
|
|
|
} else {
|
|
|
musts = append(musts, fmt.Sprintf(queryMissing, "buyertel"))
|
|
|
}
|
|
@@ -108,7 +108,7 @@ func GetSearchQuery(in *bxcore.SearchReq, mustQuery string) (qstr string) {
|
|
|
hasWinnerTel := in.WinnerTel
|
|
|
if hasWinnerTel != "" {
|
|
|
if hasWinnerTel == "y" {
|
|
|
- must_not = append(must_not, fmt.Sprintf(queryMissing, "winnertel"))
|
|
|
+ mustNot = append(mustNot, fmt.Sprintf(queryMissing, "winnertel"))
|
|
|
} else {
|
|
|
musts = append(musts, fmt.Sprintf(queryMissing, "winnertel"))
|
|
|
}
|
|
@@ -130,19 +130,19 @@ func GetSearchQuery(in *bxcore.SearchReq, mustQuery string) (qstr string) {
|
|
|
}
|
|
|
notKeyMustNot = append(notKeyMustNot, fmt.Sprintf(notKeyMultiMatch, elastic.ReplaceYH(v)))
|
|
|
}
|
|
|
- must_not = append(must_not, fmt.Sprintf(queryBoolShould, strings.Join(notKeyMustNot, ",")))
|
|
|
+ mustNot = append(mustNot, fmt.Sprintf(queryBoolShould, strings.Join(notKeyMustNot, ",")))
|
|
|
}
|
|
|
//
|
|
|
fileExists := in.FileExists
|
|
|
if !isFileSearch && fileExists != "" {
|
|
|
if fileExists == "1" { //有附件
|
|
|
- must_not = append(must_not, fmt.Sprintf(queryMissing, "isValidFile"))
|
|
|
+ mustNot = append(mustNot, fmt.Sprintf(queryMissing, "isValidFile"))
|
|
|
musts = append(musts, fmt.Sprintf(queryBoolMustTerm, 1))
|
|
|
} else if fileExists == "-1" { //无附件
|
|
|
musts = append(musts, fmt.Sprintf(queryMissing, "isValidFile"))
|
|
|
}
|
|
|
}
|
|
|
- qstr = fmt.Sprintf(query, strings.Join(musts, ","), strings.Join(must_not, ","))
|
|
|
+ qstr = fmt.Sprintf(query, strings.Join(musts, ","), strings.Join(mustNot, ","))
|
|
|
logx.Info("qstr:", qstr)
|
|
|
return
|
|
|
}
|
|
@@ -178,7 +178,7 @@ func GetBidSearchQuery(in *bxcore.SearchReq) string {
|
|
|
query += `]}}`
|
|
|
}
|
|
|
if query != "" {
|
|
|
- query = fmt.Sprintf(QueryBoolShould, query)
|
|
|
+ query = fmt.Sprintf(queryBoolShould, query)
|
|
|
}
|
|
|
//发布时间
|
|
|
publishtime := in.PublishTime
|
|
@@ -241,7 +241,7 @@ func GetBidSearchQuery(in *bxcore.SearchReq) string {
|
|
|
if query != "" {
|
|
|
query += ","
|
|
|
}
|
|
|
- query += fmt.Sprintf(QueryBoolShould, alltype)
|
|
|
+ query += fmt.Sprintf(queryBoolShould, alltype)
|
|
|
}
|
|
|
//采购单位类型
|
|
|
buyerclass := in.BuyerClass
|