renzheng 8 年之前
父节点
当前提交
9ed8d2a00e
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      common/src/qfw/util/elastic/elasticutil.go

+ 2 - 1
common/src/qfw/util/elastic/elasticutil.go

@@ -1128,6 +1128,7 @@ func GetResForJY(index, itype string, keys []KeyConfig, allquery, findfields, So
 	if len(keys) > 0 {
 		qstr := ""
 		new_minq := fmt.Sprintf(minq, "%s", findfields)
+		not_new_minq := fmt.Sprintf(minq, "%s", `"title"`) //排除词只查询标题
 		musts := []string{}
 		for _, qs_words := range keys {
 			mq := []string{}
@@ -1136,7 +1137,7 @@ func GetResForJY(index, itype string, keys []KeyConfig, allquery, findfields, So
 				mq = append(mq, fmt.Sprintf(new_minq, ReplaceYH(qs_word)))
 			}
 			for _, qs_word := range qs_words.NotKeys {
-				notmq = append(notmq, fmt.Sprintf(new_minq, ReplaceYH(qs_word)))
+				notmq = append(notmq, fmt.Sprintf(not_new_minq, ReplaceYH(qs_word)))
 			}
 			if len(qs_words.Areas) > 0 {
 				mq = append(mq, fmt.Sprintf(`{"terms":{"area":["%s"]}}`, strings.Join(qs_words.Areas, `","`)))