|
@@ -80,7 +80,9 @@ type SieveCondition struct {
|
|
SearchGroup int `json:"searchGroup"` // 搜索分组:默认0:全部;1:招标采购公告;2:超前项目
|
|
SearchGroup int `json:"searchGroup"` // 搜索分组:默认0:全部;1:招标采购公告;2:超前项目
|
|
SearchMode int `json:"searchMode"` // 搜索模式:0:精准搜索;1:模糊搜索
|
|
SearchMode int `json:"searchMode"` // 搜索模式:0:精准搜索;1:模糊搜索
|
|
WordsMode int `json:"wordsMode"` // 搜索关键词模式;默认0:包含所有,1:包含任意
|
|
WordsMode int `json:"wordsMode"` // 搜索关键词模式;默认0:包含所有,1:包含任意
|
|
- District []string `json:"district"`
|
|
|
|
|
|
+ District []string `json:"district"` //
|
|
|
|
+ UserId string `json:"s_userid"` //用户id 或 职位id
|
|
|
|
+ MgoUserId string `json:"mgoUserId"` //mgoUserId
|
|
}
|
|
}
|
|
|
|
|
|
const (
|
|
const (
|
|
@@ -557,11 +559,13 @@ func GetSqlObjFromId(mongo mg.MongodbSim, _id string) *SieveCondition {
|
|
PushKeyWords: getStringArrFromDbResult((*query)["pushKeyWords"]),
|
|
PushKeyWords: getStringArrFromDbResult((*query)["pushKeyWords"]),
|
|
FileExists: qutil.ObjToString((*query)["fileExists"]),
|
|
FileExists: qutil.ObjToString((*query)["fileExists"]),
|
|
SearchTypeSwitch: searchTypeSwitch,
|
|
SearchTypeSwitch: searchTypeSwitch,
|
|
- BidField: qutil.ObjToString((*query)["bid_field"]), // 领域化数据
|
|
|
|
- SearchGroup: qutil.IntAll((*query)["searchGroup"]), //搜索分组:默认0:全部;1:招标采购公告;2:超前项目
|
|
|
|
- SearchMode: qutil.IntAll((*query)["searchMode"]), // 搜索模式:0:精准搜索;1:模糊搜索
|
|
|
|
- WordsMode: qutil.IntAll((*query)["wordsMode"]), // 搜索关键词模式;默认0:包含所有,1:包含任意
|
|
|
|
- District: gconv.Strings((*query)["district"]),
|
|
|
|
|
|
+ BidField: qutil.ObjToString((*query)["bid_field"]), // 领域化数据
|
|
|
|
+ SearchGroup: qutil.IntAll((*query)["searchGroup"]), //搜索分组:默认0:全部;1:招标采购公告;2:超前项目
|
|
|
|
+ SearchMode: qutil.IntAll((*query)["searchMode"]), // 搜索模式:0:精准搜索;1:模糊搜索
|
|
|
|
+ WordsMode: qutil.IntAll((*query)["wordsMode"]), // 搜索关键词模式;默认0:包含所有,1:包含任意
|
|
|
|
+ District: gconv.Strings((*query)["district"]), //
|
|
|
|
+ UserId: qutil.InterfaceToStr((*query)["s_userid"]), //
|
|
|
|
+ MgoUserId: qutil.InterfaceToStr((*query)["mgoUserId"]), //
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -587,7 +591,7 @@ func GetDataExportSearchCountBySieveCondition(scd *SieveCondition, elasticAddres
|
|
}
|
|
}
|
|
// 依据用户选择的搜索模式和搜索范围进行匹配,即不限制只能匹配标题,且不限制最多展示100条、针对输入的单个关键词分词后需要都包含
|
|
// 依据用户选择的搜索模式和搜索范围进行匹配,即不限制只能匹配标题,且不限制最多展示100条、针对输入的单个关键词分词后需要都包含
|
|
//超级搜索一致的检索(防止数据导出和超级搜索数据量不一致)
|
|
//超级搜索一致的检索(防止数据导出和超级搜索数据量不一致)
|
|
- if scd.Comeinfrom == "supersearchPage" && (len(scd.Keyword) != 0 || len(scd.Industry) != 0) && scd.SearchMode == SearchModeFuzzy {
|
|
|
|
|
|
+ if scd.Comeinfrom == "supersearchPage" && (len(scd.Keyword) != 0 || len(scd.Industry) != 0 || IsOnTheWhitelist(scd.UserId, scd.MgoUserId)) && scd.SearchMode == SearchModeFuzzy {
|
|
if len(scd.Keyword) != 0 {
|
|
if len(scd.Keyword) != 0 {
|
|
// 关键词分词
|
|
// 关键词分词
|
|
searchTextSize := 0
|
|
searchTextSize := 0
|
|
@@ -894,7 +898,7 @@ func GetDataExportIds(elasticAddress string, scd *SieveCondition, checkCount int
|
|
}
|
|
}
|
|
//超级搜索一致的检索(防止数据导出和超级搜索数据量不一致)
|
|
//超级搜索一致的检索(防止数据导出和超级搜索数据量不一致)
|
|
// 依据用户选择的搜索模式和搜索范围进行匹配,即不限制只能匹配标题,且不限制最多展示100条、针对输入的单个关键词分词后需要都包含
|
|
// 依据用户选择的搜索模式和搜索范围进行匹配,即不限制只能匹配标题,且不限制最多展示100条、针对输入的单个关键词分词后需要都包含
|
|
- if scd.Comeinfrom == "supersearchPage" && (len(scd.Keyword) != 0 || len(scd.Industry) != 0) && len(scd.SelectIds) == 0 && scd.SearchMode == SearchModeFuzzy {
|
|
|
|
|
|
+ if scd.Comeinfrom == "supersearchPage" && (len(scd.Keyword) != 0 || len(scd.Industry) != 0 || IsOnTheWhitelist(scd.UserId, scd.MgoUserId)) && len(scd.SelectIds) == 0 && scd.SearchMode == SearchModeFuzzy {
|
|
if len(scd.Keyword) != 0 {
|
|
if len(scd.Keyword) != 0 {
|
|
searchTextSize := 0
|
|
searchTextSize := 0
|
|
// 关键词分词
|
|
// 关键词分词
|
|
@@ -964,7 +968,7 @@ func GetDataExportSearchResult(bid mg.MongodbSim, bidMgoDBName, elasticAddress s
|
|
res = doSearchByBatch(qstr, dataType, checkCount, fmt.Sprintf("%s-%s", "GetDataExportSearchResult", scd.Id))
|
|
res = doSearchByBatch(qstr, dataType, checkCount, fmt.Sprintf("%s-%s", "GetDataExportSearchResult", scd.Id))
|
|
}
|
|
}
|
|
//超级搜索一致的检索(防止数据导出和超级搜索数据量不一致)
|
|
//超级搜索一致的检索(防止数据导出和超级搜索数据量不一致)
|
|
- if scd.Comeinfrom == "supersearchPage" && (len(scd.Keyword) != 0 || len(scd.Industry) != 0) && len(scd.SelectIds) == 0 && scd.SearchMode == SearchModeFuzzy {
|
|
|
|
|
|
+ if scd.Comeinfrom == "supersearchPage" && (len(scd.Keyword) != 0 || len(scd.Industry) != 0 || IsOnTheWhitelist(scd.UserId, scd.MgoUserId)) && len(scd.SelectIds) == 0 && scd.SearchMode == SearchModeFuzzy {
|
|
if len(scd.Keyword) != 0 {
|
|
if len(scd.Keyword) != 0 {
|
|
searchTextSize := 0
|
|
searchTextSize := 0
|
|
// 关键词分词
|
|
// 关键词分词
|