|
@@ -238,6 +238,18 @@ func GetBidSearchQuery(in *bxcore.SearchReq) string {
|
|
|
}
|
|
|
district := in.District
|
|
|
if district != "" {
|
|
|
+ for k, v := range strings.Split(district, ",") {
|
|
|
+ if k > 0 {
|
|
|
+ query += `,`
|
|
|
+ }
|
|
|
+ cityName := strings.Split(v, "_")[0]
|
|
|
+ districtName := strings.Split(v, "_")[1]
|
|
|
+ query_bool_must_and_district := `{"bool":{"must":[{"terms":{"city":["%s"]}},{"terms":{"district":["%s"]}}]}}`
|
|
|
+ query += fmt.Sprintf(query_bool_must_and_district, cityName, districtName)
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ /*if district != "" {
|
|
|
for _, v := range strings.Split(district, ",") {
|
|
|
if len(v) > 0 {
|
|
|
query += ","
|
|
@@ -256,7 +268,7 @@ func GetBidSearchQuery(in *bxcore.SearchReq) string {
|
|
|
query += `]}}`
|
|
|
}
|
|
|
|
|
|
- }
|
|
|
+ }*/
|
|
|
if query != "" {
|
|
|
query = fmt.Sprintf(queryBoolShould, query)
|
|
|
}
|