feat:优化es查询规则
This commit is contained in:
@ -34,15 +34,15 @@ func (this *ESManage) Create() error {
|
||||
}
|
||||
|
||||
func (this *ESManage) Search(page, pageSize int) (interface{}, error) {
|
||||
mustParams := make(map[string]interface{}, 0)
|
||||
termParams := make(map[string]interface{}, 0)
|
||||
shouldParams := make(map[string]interface{}, 0)
|
||||
|
||||
if this.Industry != "" {
|
||||
termParams["industry"] = this.Industry
|
||||
}
|
||||
if this.Title != "" {
|
||||
shouldParams["title"] = this.Title
|
||||
}
|
||||
if this.Industry != "" {
|
||||
mustParams["title"] = this.Industry
|
||||
}
|
||||
if this.Keyword != "" {
|
||||
shouldParams["keyword"] = this.Keyword
|
||||
}
|
||||
@ -50,7 +50,7 @@ func (this *ESManage) Search(page, pageSize int) (interface{}, error) {
|
||||
shouldParams["research"] = this.Research
|
||||
}
|
||||
out, err := es.Search(this, this.Index(), &es.SearchParams{
|
||||
MustParams: mustParams,
|
||||
TermParams: termParams,
|
||||
ShouldParams: shouldParams,
|
||||
}, page, pageSize)
|
||||
|
||||
|
Reference in New Issue
Block a user