|
@@ -538,19 +538,23 @@ func (so *SearchOptimize) GetSearchQuery(mustQuery string) (qstr string) {
|
|
}
|
|
}
|
|
//物业业态
|
|
//物业业态
|
|
if so.PropertyForm != "" && isLogin {
|
|
if so.PropertyForm != "" && isLogin {
|
|
- musts = append(musts, fmt.Sprintf(queryBoolMustA, "property form", `"`+strings.ReplaceAll(so.PropertyForm, ", ", `", "`)+`"`))
|
|
|
|
|
|
+ musts = append(musts, fmt.Sprintf(queryBoolShould, fmt.Sprintf(`{"terms":{"property_form":[%s]}}`, so.PropertyForm)))
|
|
|
|
+ //musts = append(musts, fmt.Sprintf(queryBoolShould, "property_form", `"`+strings.ReplaceAll(so.PropertyForm, ", ", `", "`)+`"`))
|
|
}
|
|
}
|
|
//业务类型
|
|
//业务类型
|
|
if so.Subinformation != "" && isLogin {
|
|
if so.Subinformation != "" && isLogin {
|
|
- musts = append(musts, fmt.Sprintf(queryBoolMustA, "tag_subinformation", `"`+strings.ReplaceAll(so.Subinformation, ", ", `", "`)+`"`))
|
|
|
|
|
|
+ musts = append(musts, fmt.Sprintf(queryBoolShould, fmt.Sprintf(`{"terms":{"tag_subinformation":[%s]}}`, so.Subinformation)))
|
|
|
|
+ //musts = append(musts, fmt.Sprintf(queryBoolShould, "tag_subinformation", `"`+strings.ReplaceAll(so.Subinformation, ", ", `", "`)+`"`))
|
|
}
|
|
}
|
|
//价格区间
|
|
//价格区间
|
|
if so.Scale != 0 && isLogin {
|
|
if so.Scale != 0 && isLogin {
|
|
- musts = append(musts, fmt.Sprintf(queryBoolMustA, "tag_set.wuye.scale", `"`+gconv.String(so.Scale)+`"`))
|
|
|
|
|
|
+ musts = append(musts, fmt.Sprintf(queryBoolShould, fmt.Sprintf(`{"terms":{"tag_set.wuye.scale":[%s]}}`, so.Scale)))
|
|
|
|
+ //musts = append(musts, fmt.Sprintf(queryBoolShould, "tag_set.wuye.scale", `"`+gconv.String(so.Scale)+`"`))
|
|
}
|
|
}
|
|
//合同周期
|
|
//合同周期
|
|
if so.Period != 0 && isLogin {
|
|
if so.Period != 0 && isLogin {
|
|
- musts = append(musts, fmt.Sprintf(queryBoolMustA, "tag_set.wuye.period", `"`+gconv.String(so.Period)+`"`))
|
|
|
|
|
|
+ musts = append(musts, fmt.Sprintf(queryBoolShould, fmt.Sprintf(`{"terms":{"tag_set.wuye.period":[%s]}}`, so.Period)))
|
|
|
|
+ //musts = append(musts, fmt.Sprintf(queryBoolShould, "tag_set.wuye.period", `"`+gconv.String(so.Period)+`"`))
|
|
}
|
|
}
|
|
//换手率
|
|
//换手率
|
|
if so.Changehand != 0 && isLogin {
|
|
if so.Changehand != 0 && isLogin {
|