diff --git a/app/logical/post_query.rb b/app/logical/post_query.rb index 633c73a23..aea015e10 100644 --- a/app/logical/post_query.rb +++ b/app/logical/post_query.rb @@ -7,7 +7,11 @@ class PostQuery class TagLimitError < Error; end # Metatags that don't count against the user's tag limit. - UNLIMITED_METATAGS = %w[status rating limit] + UNLIMITED_METATAGS = %w[ + status rating limit is id date age filesize filetype parent child md5 width + height duration mpixels ratio score upvote downvotes favcount embedded + tagcount pixiv_id pixiv + ] # Metatags that define the order of search results. These metatags can't be used more than once per query. ORDER_METATAGS = %w[order ordfav ordfavgroup ordpool] diff --git a/test/unit/post_query_builder_test.rb b/test/unit/post_query_builder_test.rb index bdbede2f9..fa1b79c0a 100644 --- a/test/unit/post_query_builder_test.rb +++ b/test/unit/post_query_builder_test.rb @@ -1353,7 +1353,7 @@ class PostQueryBuilderTest < ActiveSupport::TestCase post1 = create(:post, rating: "s") assert_raise(PostQuery::TagLimitError) do - PostQuery.search("a b c rating:s width:10 height:10 user:bob", tag_limit: 5) + PostQuery.search("a b c user:bob fav:bob pool:disgustingly_adorable", tag_limit: 5) end end @@ -1363,6 +1363,7 @@ class PostQueryBuilderTest < ActiveSupport::TestCase assert_tag_match([post1], "aaa bbb rating:s") assert_tag_match([post1], "aaa bbb status:active") assert_tag_match([post1], "aaa bbb limit:20") + assert_tag_match([post1], "aaa bbb filesize:<100mb width:<10000 height:<10000 limit:20") end should "succeed for exclusive tag searches with no other tag" do