|
@@ -366,10 +366,10 @@ func GetSearchQuery(in *bxcore.SearchReq, mustquery string) (qstr string) {
|
|
|
for _, v := range strings.Split(in.KeyWords, "+") {
|
|
|
//标题 全文搜索 搜索类型开关打开 默认搜索全文;(全文包含标题)(单字排除)
|
|
|
if switchBool && len([]rune(elastic.ReplaceYH(v))) > 1 {
|
|
|
- if strings.Contains(findfields, "title,") {
|
|
|
- findfields = strings.Replace(findfields, "title,", "", -1)
|
|
|
- } else if strings.Contains(findfields, ",title") {
|
|
|
- findfields = strings.Replace(findfields, ",title", "", -1)
|
|
|
+ if strings.Contains(findfields, `"title",`) {
|
|
|
+ findfields = strings.Replace(findfields, `"title",`, ``, -1)
|
|
|
+ } else if strings.Contains(findfields, `,"title"`) {
|
|
|
+ findfields = strings.Replace(findfields, `,"title"`, ``, -1)
|
|
|
}
|
|
|
}
|
|
|
keyword_multi_match := fmt.Sprintf(multi_match, "%s", findfields)
|