|
@@ -690,17 +690,17 @@ func EsArticleSearchBody(keyWord string, startSize, pageSize int, orderColumn st
|
|
|
},
|
|
|
},
|
|
|
}
|
|
|
- //把第一次键入词的筛选条件过滤掉
|
|
|
- //if ikType == 2 {
|
|
|
- queryMap = map[string]interface{}{
|
|
|
- "query": map[string]interface{}{
|
|
|
- "bool": map[string]interface{}{
|
|
|
- "must": mustMap,
|
|
|
- "must_not": mustNotMap,
|
|
|
+ //把第一次的筛选条件过滤掉
|
|
|
+ if searchType == 2 {
|
|
|
+ queryMap = map[string]interface{}{
|
|
|
+ "query": map[string]interface{}{
|
|
|
+ "bool": map[string]interface{}{
|
|
|
+ "must": mustMap,
|
|
|
+ "must_not": mustNotMap,
|
|
|
+ },
|
|
|
},
|
|
|
- },
|
|
|
+ }
|
|
|
}
|
|
|
- //}
|
|
|
if orderColumn == "Matching" {
|
|
|
queryMap["sort"] = sortMap
|
|
|
}
|
|
@@ -709,7 +709,7 @@ func EsArticleSearchBody(keyWord string, startSize, pageSize int, orderColumn st
|
|
|
queryMap["highlight"] = highlightMap
|
|
|
jsonBytes, _ := json.Marshal(queryMap)
|
|
|
fmt.Println(string(jsonBytes))
|
|
|
- //utils.FileLog.Info(string(jsonBytes))
|
|
|
+ utils.FileLog.Info(string(jsonBytes))
|
|
|
request := client.Search(indexName).Source(queryMap) // sets the JSON request
|
|
|
searchByMatch, err := request.Do(context.Background())
|
|
|
if searchByMatch != nil {
|