diff --git a/app/models/post.rb b/app/models/post.rb index 9586f49fc..2addde42c 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -1111,7 +1111,7 @@ class Post < ApplicationRecord tags = tags.to_s tags += " rating:s" if CurrentUser.safe_mode? tags += " -status:deleted" if CurrentUser.hide_deleted_posts? && !Tag.has_metatag?(tags, "status", "-status") - tags = Tag.normalize_query(tags) + tags = Tag.normalize_query(tags, normalize_aliases: false) # optimize some cases. these are just estimates but at these # quantities being off by a few hundred doesn't matter much diff --git a/app/models/tag.rb b/app/models/tag.rb index b9e91fa55..d7e2960b7 100644 --- a/app/models/tag.rb +++ b/app/models/tag.rb @@ -272,10 +272,10 @@ class Tag < ApplicationRecord query.to_s.gsub(/\u3000/, " ").strip end - def normalize_query(query, sort: true) + def normalize_query(query, normalize_aliases: true, sort: true) tags = Tag.scan_query(query.to_s) tags = tags.map { |t| Tag.normalize_name(t) } - tags = TagAlias.to_aliased(tags) + tags = TagAlias.to_aliased(tags) if normalize_aliases tags = tags.sort if sort tags = tags.uniq tags.join(" ")