|
@@ -32,7 +32,7 @@ const (
|
|
bidSearch_field = ``
|
|
bidSearch_field = ``
|
|
|
|
|
|
forecastQuery = `{"query":{"bool":{"must":[%s],"should":[%s],"minimum_should_match":1}}}`
|
|
forecastQuery = `{"query":{"bool":{"must":[%s],"should":[%s],"minimum_should_match":1}}}`
|
|
- filter_must_time = `{"bool":{"%s":[{"exists":{"field":"top_category"}}]}},{"bool":{"should":[{"bool":{"must":[{"constant_score":{"filter":{"exists":{"field":"yuceendtime"}}}},{"range":{"yuceendtime":{"gte":%d,"lte":%d}}}]}}]}}`
|
|
|
|
|
|
+ filter_must_time = `{"bool":{"%s":[{"exists":{"field":"top_category"}}]}},{"bool":{"should":[{"bool":{"must":[%s]}}]}}`
|
|
filter_must_area_city = `{"bool":{"should":[%s]}}`
|
|
filter_must_area_city = `{"bool":{"should":[%s]}}`
|
|
query_should_keys = `{"bool":{"must":[%s],"must_not":[%s]}}`
|
|
query_should_keys = `{"bool":{"must":[%s],"must_not":[%s]}}`
|
|
query_should_multi_match = `{"multi_match":{"query":"%s","type":"phrase","fields":["%s"]}}`
|
|
query_should_multi_match = `{"multi_match":{"query":"%s","type":"phrase","fields":["%s"]}}`
|
|
@@ -57,12 +57,13 @@ func getForecastProjectSql(scd *util.ViewCondition, startTime, endTime int, data
|
|
endTime = int(time.Now().Unix())
|
|
endTime = int(time.Now().Unix())
|
|
}
|
|
}
|
|
name := ""
|
|
name := ""
|
|
|
|
+ mustStr := "{\"constant_score\":{\"filter\":{\"exists\":{\"field\":\"%s\"}}}},{\"range\":{\"%s\":{\"gte\":%d,\"lte\":%d}}}"
|
|
if dataType == "nj" {
|
|
if dataType == "nj" {
|
|
name = "title"
|
|
name = "title"
|
|
- musts = append(musts, fmt.Sprintf(filter_must_time, "must", startTime, endTime))
|
|
|
|
|
|
+ musts = append(musts, fmt.Sprintf(filter_must_time, "must", fmt.Sprintf(mustStr, "yucetime", "yucetime", startTime, endTime)))
|
|
} else {
|
|
} else {
|
|
name = "results.purchasing.mypurchasing"
|
|
name = "results.purchasing.mypurchasing"
|
|
- musts = append(musts, fmt.Sprintf(filter_must_time, "must_not", startTime, endTime))
|
|
|
|
|
|
+ musts = append(musts, fmt.Sprintf(filter_must_time, "must_not", fmt.Sprintf(mustStr, "yuceendtime", "yuceendtime", startTime, endTime)))
|
|
}
|
|
}
|
|
//省份
|
|
//省份
|
|
areaCity := []string{}
|
|
areaCity := []string{}
|