|
@@ -177,10 +177,8 @@ func (e *EntryQueryBuilder) WithStatuses(statuses []string) *EntryQueryBuilder {
|
|
|
// WithTags filter by a list of entry tags.
|
|
// WithTags filter by a list of entry tags.
|
|
|
func (e *EntryQueryBuilder) WithTags(tags []string) *EntryQueryBuilder {
|
|
func (e *EntryQueryBuilder) WithTags(tags []string) *EntryQueryBuilder {
|
|
|
if len(tags) > 0 {
|
|
if len(tags) > 0 {
|
|
|
- for _, cat := range tags {
|
|
|
|
|
- e.conditions = append(e.conditions, fmt.Sprintf("LOWER($%d) = ANY(LOWER(e.tags::text)::text[])", len(e.args)+1))
|
|
|
|
|
- e.args = append(e.args, cat)
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ e.conditions = append(e.conditions, fmt.Sprintf("LOWER(e.tags::text)::text[] @> LOWER($%d::text)::text[]", len(e.args)+1))
|
|
|
|
|
+ e.args = append(e.args, pq.Array(tags))
|
|
|
}
|
|
}
|
|
|
return e
|
|
return e
|
|
|
}
|
|
}
|