| @@ -118,7 +118,7 @@ func SearchDatasetCondition(opts *SearchDatasetOptions) builder.Cond { | |||||
| cond = cond.And(builder.Neq{"dataset.status": DatasetStatusDeleted}) | cond = cond.And(builder.Neq{"dataset.status": DatasetStatusDeleted}) | ||||
| if len(opts.Keyword) > 0 { | if len(opts.Keyword) > 0 { | ||||
| cond = cond.And(builder.Like{"dataset.title", opts.Keyword}) | |||||
| cond = cond.And(builder.Or(builder.Like{"dataset.title", opts.Keyword}, builder.Like{"dataset.description", opts.Keyword})) | |||||
| } | } | ||||
| if len(opts.Category) > 0 { | if len(opts.Category) > 0 { | ||||
| @@ -144,7 +144,7 @@ func SearchDatasetCondition(opts *SearchDatasetOptions) builder.Cond { | |||||
| cond = cond.Or(builder.Eq{"repository.owner_id": opts.OwnerID}) | cond = cond.Or(builder.Eq{"repository.owner_id": opts.OwnerID}) | ||||
| } else { | } else { | ||||
| subCon := builder.NewCond() | subCon := builder.NewCond() | ||||
| subCon = subCon.And(builder.Eq{"repository.owner_id": opts.OwnerID}, builder.Like{"dataset.title", opts.Keyword}) | |||||
| subCon = subCon.And(builder.Eq{"repository.owner_id": opts.OwnerID}, builder.Or(builder.Like{"dataset.title", opts.Keyword}, builder.Like{"dataset.description", opts.Keyword})) | |||||
| cond = cond.Or(subCon) | cond = cond.Or(subCon) | ||||
| } | } | ||||