Danbooru

Order by comment count?

Posted under Bugs & Features

I'm thinking this would be a useful feature for searching posts. By adding something simple like an age modifier (ex: order:comment_count age:<1d), you could instantly find the most talked about recent uploads.

I wanted to first bring this up on the forums though to gauge interest, before creating an issue on GitHub. Chime in if you're interested, or if you have additional suggestions. Thanks.

kittey said:

Are any of those counts indexed? If not, those searches will probably be too expensive. IIRC, Albert isn’t too keen on adding even more indexes.

Not sure. I'm thinking that indexes won't be needed though, especially if you restrict the search down with tags and/or range specifiers. Then the search can just go on however long the timeout is for your user level (3 seconds - Member, 6 seconds - Gold, 9 Seconds - Platinum; Help:Users). That'll also encourage users to restrict the scope of their search using tags.

Unbreakable said:

What does the last one do? Is it how many different users that added tags to the post?

Yeah. That one would be the least likely to be implemented though given that it relies on the ginormous post versions table.

This was submitted to GitHub with issue #4004 and fixed with issue #4007. That was merged and deployed just today, which means that there are wider variety of metatags to order by now (ex: order:METATAG).

  • comments, active_comments, deleted_comments
  • notes, active_notes, deleted_notes
  • flags, resolved_flags, unresolved_flags
  • children, active_children, deleted_children
  • pools, active_pools, deleted_pools, series_pools, collection_pools
  • appeals
  • approvals
  • replacements

Also, *_count can be used as a replacement for the plurality of any of the above tags. For instance, order:comments and order:comment_count do the same thing.

As noted in the prior post, using other tags and/or range specifiers (Help:Cheatsheet) might be necessary to keep the query from timing out, particularly for those with lower timeouts.

judgemenot said:

Could you please point me to a list of all the criteria one can use with "order:"?

See Help:Cheatsheet and search for “order” if you want explanations for most things you can order by. There’s an itemized list of options for the order meta tag at the bottom of the page.

Also, what is the meaning of 'active' with regard to active_notes, active_children etc?

“Active” means “not deleted”.

1