|
@@ -95,6 +95,7 @@ func UtilEsFind(tags map[string]interface{}) (error, int64) {
|
|
|
searchResult, err := client.Search(EsIndex).Source(esquery).Do()
|
|
|
if err == nil && searchResult.Hits != nil {
|
|
|
datas := make([]map[string]interface{}, 0)
|
|
|
+ util.Debug("es查询到的数量:", searchResult.Hits.TotalHits)
|
|
|
for _, v := range searchResult.Hits.Hits {
|
|
|
item := make(map[string]interface{})
|
|
|
if json.Unmarshal(*v.Source, &item) == nil {
|
|
@@ -230,6 +231,14 @@ func Utiltags(tag map[string]interface{}) string {
|
|
|
Gte: tab.Istarttime,
|
|
|
Lt: tab.Iendtime,
|
|
|
}}})
|
|
|
+ }else if tab.Istarttime > 0 {
|
|
|
+ ffBoolObject.Must = append(ffBoolObject.Must, models.PublishtimeMust{PublishtimeObject: &models.PublishtimeObject{Publishtime1: &models.Publishtime1{
|
|
|
+ Gte: tab.Istarttime,
|
|
|
+ }}})
|
|
|
+ }else if tab.Iendtime > 0 {
|
|
|
+ ffBoolObject.Must = append(ffBoolObject.Must, models.PublishtimeMust{PublishtimeObject: &models.PublishtimeObject{Publishtime2: &models.Publishtime2{
|
|
|
+ Lt: tab.Iendtime,
|
|
|
+ }}})
|
|
|
}
|
|
|
if tab.Sbudget != "" {
|
|
|
if strings.Contains(tab.Sbudget, "大于") && strings.Contains(tab.Sbudget, "小于") {
|
|
@@ -396,6 +405,8 @@ func Utiltags(tag map[string]interface{}) string {
|
|
|
rdata["query"] = QueryObjecct
|
|
|
esbytes, _ := json.Marshal(rdata)
|
|
|
esStr := strings.ReplaceAll(string(esbytes), "regexp1", "regexp")
|
|
|
+ esStr = strings.ReplaceAll(esStr, "publishtime1", "publishtime")
|
|
|
+ esStr = strings.ReplaceAll(esStr, "publishtime2", "publishtime")
|
|
|
return strings.ReplaceAll(esStr, "regexp2", "regexp")
|
|
|
}
|
|
|
|