search: support negated wildcards in post searches.
* Support negated wildcards in searches (e.g. "holding -holding_*") * Raise wildcard limit to matching 25 tags regardless of user level. * Fix wildcards potentially matching empty tags. * Fix wildcard tags being sorted by post count only, and therefore not having a stable ordering when tags have equal post counts. * Fix sidebar to calculate wildcards tags the same way the search does.
This commit is contained in:
@@ -279,6 +279,10 @@ class Tag < ApplicationRecord
|
||||
name_matches(name).or(alias_matches(name))
|
||||
end
|
||||
|
||||
def wildcard_matches(tag, limit: 25)
|
||||
nonempty.name_matches(tag).order(post_count: :desc, name: :asc).limit(limit).pluck(:name)
|
||||
end
|
||||
|
||||
def search(params)
|
||||
q = super
|
||||
|
||||
|
||||
Reference in New Issue
Block a user